summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Rayhawk <jrayhawk@fairlystable.org>2025-01-01 11:55:43 -0800
committerJoe Rayhawk <jrayhawk@fairlystable.org>2025-01-01 11:55:43 -0800
commit67eac573f119434fe78f84be6ebf5aa0195e49bb (patch)
tree85ff4541f77753c993c4caa285ab383fe79f7634
parentad88f6d199ad33715645b7eae5881ab3a489a1fb (diff)
downloadpiny-code-67eac573f119434fe78f84be6ebf5aa0195e49bb.tar.gz
piny-code-67eac573f119434fe78f84be6ebf5aa0195e49bb.zip
newuser: improved error path experience
-rwxr-xr-xpinyadmin/sbin/newuser2
-rwxr-xr-xpinyweb/cgi-bin/newuser.cgi2
2 files changed, 2 insertions, 2 deletions
diff --git a/pinyadmin/sbin/newuser b/pinyadmin/sbin/newuser
index e6dd785..858451d 100755
--- a/pinyadmin/sbin/newuser
+++ b/pinyadmin/sbin/newuser
@@ -121,7 +121,7 @@ if ( scalar @ARGV == 3 and $ARGV[0] eq "--batch" ) {
if ( not defined $email or $email eq "" ) { print "Email address is undefined!\n"; exit 3; };
if ( not defined $username or $username eq "" ) { print "Username is undefined!\n"; exit 3; };
if ( $username =~ /^(git|iki)-/ ) { print "Username must not begin with git- or iki-!\n"; exit 3; };
-if ( $username !~ /^[a-zA-Z][a-zA-Z0-9_.-]{0,30}$/ ) { print "Usernames must be less than 32 bytes long, consist only of letters, digits, underscores, periods, and dashes, and must start with a letter. Usernames are case sensitive.\n" };
+if ( $username !~ /^[a-zA-Z][a-zA-Z0-9_.-]{0,30}$/ ) { print "Usernames must be less than 32 bytes long, consist only of letters, digits, underscores, periods, and dashes, and must start with a letter. Usernames are case sensitive.\n"; exit 3; };
if ( not defined $password or $password eq "" ) { print "Password is undefined!\n"; exit 3; };
# Here on down is the actual creation code.
diff --git a/pinyweb/cgi-bin/newuser.cgi b/pinyweb/cgi-bin/newuser.cgi
index 75fa7c8..bb48103 100755
--- a/pinyweb/cgi-bin/newuser.cgi
+++ b/pinyweb/cgi-bin/newuser.cgi
@@ -37,7 +37,7 @@ if( scalar( $q->param("n") ) && scalar( $q->param("a") ) && scalar( $q->param("p
if ( scalar( $q->param("h") ) ) {
if ( scalar( $q->param("h") ) eq $code ) {
unless( open2( OUT, IN, "/usr/bin/sudo", "/usr/sbin/newuser", "--batch", scalar( $q->param("a") ), scalar( $q->param("n") ) ) ) {
- print "could not execute newrepo";
+ print "could not execute newuser";
die;
};
# make things flushier