aboutsummaryrefslogtreecommitdiffstats
path: root/unix/vncserver/vncserver.in
diff options
context:
space:
mode:
authorTAKAHASHI Shuuji <shuuji3@gmail.com>2022-12-14 15:36:59 +0000
committerTAKAHASHI Shuuji <shuuji3@gmail.com>2022-12-14 15:36:59 +0000
commitcc6f68b974e5a7e2222b59308c33f3af6bac4245 (patch)
tree5861e9e1c9494e35d7f9c8a2c1e8ad1ee3189a9d /unix/vncserver/vncserver.in
parent4f6d4895c3420e5ac301a916bced4a0065a19183 (diff)
downloadtigervnc-cc6f68b974e5a7e2222b59308c33f3af6bac4245.tar.gz
tigervnc-cc6f68b974e5a7e2222b59308c33f3af6bac4245.zip
Improve error message when `passwd `file has a bad permission
Diffstat (limited to 'unix/vncserver/vncserver.in')
-rwxr-xr-xunix/vncserver/vncserver.in4
1 files changed, 3 insertions, 1 deletions
diff --git a/unix/vncserver/vncserver.in b/unix/vncserver/vncserver.in
index 91b0f162..95d672b1 100755
--- a/unix/vncserver/vncserver.in
+++ b/unix/vncserver/vncserver.in
@@ -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";
}
}