Allow use of ~ allow dir path
authorJamie Cameron <jcameron@webmin.com>
Sat, 1 Oct 2011 23:42:46 +0000 (16:42 -0700)
committerJamie Cameron <jcameron@webmin.com>
Sat, 1 Oct 2011 23:42:46 +0000 (16:42 -0700)
chooser.cgi

index 675b193..1b4dbb5 100755 (executable)
@@ -24,12 +24,13 @@ if (&get_product_name() eq 'usermin') {
 %access = &get_module_acl();
 
 # Work out root directory
+local @uinfo = getpwnam($remote_user);
 if (!$access{'root'}) {
-       local @uinfo = getpwnam($remote_user);
        $rootdir = $uinfo[7] ? $uinfo[7] : "/";
        }
 else {
        $rootdir = $access{'root'};
+       $rootdir =~ s/^\~/$uinfo[7]/;
        }
 
 # Switch to correct Unix user