diff options
author | Pierre Ossman <ossman@cendio.se> | 2024-08-15 14:21:41 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2024-08-15 14:21:41 +0200 |
commit | cd1bb9dd287376431fde77ce22be40b6f9f89897 (patch) | |
tree | 0356e624a54544b0db8999ff3ebeb5ed9ebc9910 | |
parent | 315b2012035b2946acd05ac5c8c6c6a1a66237bb (diff) | |
download | tigervnc-cd1bb9dd287376431fde77ce22be40b6f9f89897.tar.gz tigervnc-cd1bb9dd287376431fde77ce22be40b6f9f89897.zip |
Let pwquality check minimum length
This is a policy decision, so let's not enforce something on our own if
there is a system policy to rely on.
-rw-r--r-- | unix/vncpasswd/vncpasswd.cxx | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/unix/vncpasswd/vncpasswd.cxx b/unix/vncpasswd/vncpasswd.cxx index b17e73dd..6666955f 100644 --- a/unix/vncpasswd/vncpasswd.cxx +++ b/unix/vncpasswd/vncpasswd.cxx @@ -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) { @@ -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:"); |