]> source.dussan.org Git - tigervnc.git/commitdiff
Limit the maximum length of a password to 8 characters 1762/head
authorhanjinpeng <hanjinpeng@kylinos.cn>
Tue, 13 Aug 2024 16:56:10 +0000 (00:56 +0800)
committerhanjinpeng <hanjinpeng@kylinos.cn>
Tue, 13 Aug 2024 16:56:10 +0000 (00:56 +0800)
Password should not be greater than 8 characters.
Because only 8 valid characters are used.

unix/vncpasswd/vncpasswd.cxx

index eb8ad037283fa645d01dfd1ab267805decb0fc43..b067719b6ce28e1ecb126495dabc269bd442e5ca 100644 (file)
@@ -149,6 +149,11 @@ static std::vector<uint8_t> readpassword() {
       continue;
     }
 
+    if (first.size() > 8) {
+      fprintf(stderr,"Password should not be greater than 8 characters\nBecause only 8 valid characters are used - try again\n");
+      continue;
+    }
+
 #ifdef HAVE_PWQUALITY
     //the function return score of password quality
     int r = check_passwd_pwquality(passwd);