]> source.dussan.org Git - tigervnc.git/commitdiff
Improve error message when `passwd `file has a bad permission 1562/head
authorTAKAHASHI Shuuji <shuuji3@gmail.com>
Wed, 14 Dec 2022 15:36:59 +0000 (15:36 +0000)
committerTAKAHASHI Shuuji <shuuji3@gmail.com>
Wed, 14 Dec 2022 15:36:59 +0000 (15:36 +0000)
unix/vncserver/vncserver.in

index 91b0f1621fbcb277241f3762b59a3823c96d335e..95d672b17d698a15ec7847b1eb50f163a9b49190 100755 (executable)
@@ -150,8 +150,10 @@ if ($config{'password'} ||
 
 if ((!$securityTypeArgSpecified || $vncAuthEnabled) && !$passwordArgSpecified) {
     ($z,$z,$mode) = stat("$vncUserDir/passwd");
-    if (!(-e "$vncUserDir/passwd") || ($mode & 077)) {
+    if (! -e "$vncUserDir/passwd") {
         die "VNC authentication enabled, but no password file created.\n";
+    } elsif ($mode & 077) {
+        die "$vncUserDir/passwd must NOT be accessible by others. Set permission to 0600.\n";
     }
 }