diff options
-rw-r--r-- | libpiny/lib/Piny/Repo.pm | 10 | ||||
-rwxr-xr-x | pinyadmin/sbin/newuser | 4 | ||||
-rwxr-xr-x | pinyweb/cgi-bin/newuser.cgi | 2 |
3 files changed, 10 insertions, 6 deletions
diff --git a/libpiny/lib/Piny/Repo.pm b/libpiny/lib/Piny/Repo.pm index c4ec47a..d213168 100644 --- a/libpiny/lib/Piny/Repo.pm +++ b/libpiny/lib/Piny/Repo.pm @@ -262,6 +262,10 @@ sub rebuild_git { }; }; + unless( -d $s->path . "/incoming" ) { + mkdir( $s->path . "/incoming" ) or die "Could not mkdir incoming: $!"; + }; + unless( -d $s->path . "/snowflakes" ) { mkdir( $s->path . "/snowflakes" ) or die "Could not mkdir snowflakes: $!"; }; @@ -301,10 +305,10 @@ sub rebuild_git { }; # FIXME: we should verify we are not breaking someone else's object hardlinks with these chmod or chown operations - system( "/usr/bin/find " . $s->path . "/refs " . $s->path . "/info " . $s->path . "/branches " . $s->path . "/objects " . $s->path . "/logs " . $s->path . "/HEAD " . $s->path . "/snowflakes -type d -print0 | /usr/bin/xargs -0 /bin/chmod $dirperm" ) and die "Could not chmod shared git resources!"; + system( "/usr/bin/find " . $s->path . "/refs " . $s->path . "/info " . $s->path . "/branches " . $s->path . "/objects " . $s->path . "/logs " . $s->path . "/HEAD " . $s->path . "/incoming " . $s->path . "/snowflakes -type d -print0 | /usr/bin/xargs -0 /bin/chmod $dirperm" ) and die "Could not chmod shared git resources!"; system( "/usr/bin/find " . $s->path . "/objects " . "-type f -print0 | /usr/bin/xargs -0 --no-run-if-empty /bin/chmod $immutablefileperm" ) and die "Could not chmod shared git resources!"; # most files are either immutable or replaced at link level - system( "/usr/bin/find " . $s->path . "/refs " . $s->path . "/info " . $s->path . "/branches " . $s->path . "/logs " . $s->path . "/HEAD " . $s->path . "/snowflakes -type f -print0 | /usr/bin/xargs -0 /bin/chmod $fileperm" ) and die "Could not chmod shared git resources!"; # most files are either immutable or replaced at link level - system( "/usr/bin/find " . $s->path . "/refs " . $s->path . "/info " . $s->path . "/branches " . $s->path . "/objects " . $s->path . "/logs " . $s->path . "/HEAD " . $s->path . "/snowflakes -print0 | /usr/bin/xargs -0 /bin/chgrp " . $s->group->name ) and die "Could not chgrp shared git resources!"; + system( "/usr/bin/find " . $s->path . "/refs " . $s->path . "/info " . $s->path . "/branches " . $s->path . "/logs " . $s->path . "/HEAD " . $s->path . "/incoming " . $s->path . "/snowflakes -type f -print0 | /usr/bin/xargs -0 /bin/chmod $fileperm" ) and die "Could not chmod shared git resources!"; # most files are either immutable or replaced at link level + system( "/usr/bin/find " . $s->path . "/refs " . $s->path . "/info " . $s->path . "/branches " . $s->path . "/objects " . $s->path . "/logs " . $s->path . "/HEAD " . $s->path . "/incoming " . $s->path . "/snowflakes -print0 | /usr/bin/xargs -0 /bin/chgrp " . $s->group->name ) and die "Could not chgrp shared git resources!"; $ENV{"GIT_DIR"} = $s->path; system( "/usr/bin/git", "config", "gitweb.owner", $s->owner->email->address ) and die "Could not git config gitweb.owner!"; diff --git a/pinyadmin/sbin/newuser b/pinyadmin/sbin/newuser index e6dd785..58ab96b 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. @@ -137,7 +137,7 @@ To: $dest Subject: Creating piny account $username Content-type: text/plain; charset=us-ascii -A new piny account ``$username'' has been created. +A new piny account ``$username'' is in the process of being created. Email: $email END 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 |