From fa4308c5426e4525e67476f83f09633ed7567486 Mon Sep 17 00:00:00 2001 From: Dmitry Maksyoma Date: Fri, 6 Aug 2021 22:25:09 +1200 Subject: [PATCH] vncserver: print user permissions --- unix/vncserver | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/unix/vncserver b/unix/vncserver index 51423b4..1e08377 100755 --- a/unix/vncserver +++ b/unix/vncserver @@ -906,12 +906,17 @@ sub AtLeastOneUserConfigured { sub LoadKasmPasswdUsers { my @result = (); + my %permissionExplanations = ("w" => "can use keyboard and mouse", + "o" => "can add/remove users", + "ow" => "can use keyboard and mouse, add/remove users", + "" => "can only view"); open(FH, '<', $kasmPasswdFile) or return @result; while(){ - $_ =~ /^([^:]+):/ or die "$kasmPasswdFile is incorrect"; - push(@result, $1); + chomp $_; + my ($name, $__, $permissions) = split(':', $_); + push(@result, "$name ($permissionExplanations{$permissions})"); } close(FH); @@ -919,7 +924,6 @@ sub LoadKasmPasswdUsers { return @result; } - sub MakeXCookie { # Make an X server cookie and set up the Xauthority file # mcookie is a part of util-linux, usually only GNU/Linux systems have it.