diff options
-rwxr-xr-x | pinyweb/cgi-bin/newuser.cgi | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pinyweb/cgi-bin/newuser.cgi b/pinyweb/cgi-bin/newuser.cgi index f03a0f2..8ffaa77 100755 --- a/pinyweb/cgi-bin/newuser.cgi +++ b/pinyweb/cgi-bin/newuser.cgi @@ -5,6 +5,7 @@ use warnings; BEGIN { if ( not defined $ENV{"SUDO_UID"} ) { +# exec( "sudo", "/usr/lib/cgi-bin/piny/newuser.cgi", @ARGV ); my @env = (); foreach my $key ( keys %ENV ) { push @env, "$key=$ENV{$key}" }; exec( "sudo", @env, "/usr/lib/cgi-bin/piny/newuser.cgi", @ARGV ); @@ -87,6 +88,6 @@ sub create_user { my $crypt = crypt( $password, $salt ); my $ret = system("/usr/sbin/piny-suid", $ENV{'REMOTE_USER'}, "/usr/sbin/useradd", "-c", "$email", "-k", "/var/empty", "-g", "users", "-m", "-p", $crypt, "-s", "/usr/bin/pinyshell", $username); - if ($ret) { return $ENV{'REMOTE_USER'} . ' An error occurred creating the user; most likely, that username is already taken.\n'; } + if ($ret) { return 'An error occurred creating the user; most likely, that username is already taken.\n'; } else { return 'Your user has been created. Try logging in!\n'; } }; |