Skip to content

Commit

Permalink
Let pwquality check minimum length
Browse files Browse the repository at this point in the history
This is a policy decision, so let's not enforce something on our own if
there is a system policy to rely on.
  • Loading branch information
CendioOssman committed Aug 15, 2024
1 parent 315b201 commit cd1bb9d
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions unix/vncpasswd/vncpasswd.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,12 @@ static std::vector<uint8_t> readpassword() {
perror("getpassword error");
exit(1);
}

std::string first = passwd;
if (first.size() < 6) {
if (first.empty()) {
fprintf(stderr,"Password not changed\n");
exit(1);
}
fprintf(stderr,"Password must be at least 6 characters - try again\n");
continue;

if (first.empty()) {
fprintf(stderr,"Password not changed\n");
exit(1);
}

if (first.size() > 8) {
Expand All @@ -161,6 +159,11 @@ static std::vector<uint8_t> readpassword() {
printf("Password quality check failed, please set it correctly.\n");
continue;
}
#else
if (first.size() < 6) {
fprintf(stderr,"Password must be at least 6 characters - try again\n");
continue;
}
#endif

passwd = getpassword("Verify:");
Expand Down

0 comments on commit cd1bb9d

Please sign in to comment.