summaryrefslogtreecommitdiff
path: root/pinyweb/cgi-bin/newuser.cgi
diff options
context:
space:
mode:
authorIan Duffe <joanofarctangent@gmail.com>2011-01-18 23:45:58 -0800
committerIan Duffe <joanofarctangent@gmail.com>2011-01-18 23:45:58 -0800
commita7614855dec85cbcb1853472f859db3a7242b3fa (patch)
treee5d55ad47b2f3ef2a6f796b4c1ead85e1375306c /pinyweb/cgi-bin/newuser.cgi
parent145dd509a0ed40be03e8b1372cee183703344b36 (diff)
parent30774537433fcf6e7818520cc3e80d36c0a63013 (diff)
downloadpiny-code-a7614855dec85cbcb1853472f859db3a7242b3fa.tar.gz
piny-code-a7614855dec85cbcb1853472f859db3a7242b3fa.zip
Merge branch 'master' of piny.be:/srv/git/piny-code
Conflicts: pinyweb/cgi-bin/newuser.cgi
Diffstat (limited to 'pinyweb/cgi-bin/newuser.cgi')
-rwxr-xr-xpinyweb/cgi-bin/newuser.cgi9
1 files changed, 6 insertions, 3 deletions
diff --git a/pinyweb/cgi-bin/newuser.cgi b/pinyweb/cgi-bin/newuser.cgi
index ee499be..8ffaa77 100755
--- a/pinyweb/cgi-bin/newuser.cgi
+++ b/pinyweb/cgi-bin/newuser.cgi
@@ -5,7 +5,10 @@ use warnings;
BEGIN {
if ( not defined $ENV{"SUDO_UID"} ) {
- exec( "sudo", "/usr/lib/cgi-bin/piny/newuser.cgi", @ARGV );
+# 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 );
};
};
@@ -49,7 +52,7 @@ print start_form( -name => 'newuser_form' );
print start_p, "Enter a username and valid email address for the new user. Please remember that the username may only contain alphanumerics, underscores, periods, and dashes. The username may not begin with a dash, nor may it begin with the strings 'git-' or 'ikiwiki-'.", end_p;
print "<b>KEYS</b>", br;
-for my $key (keys %{$ENV}) {
+for my $key (keys %ENV) {
print $key . " - " . $ENV{$key};
print br;
}
@@ -85,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'; }
};