--- loncom/Attic/lcuseradd 2004/08/05 20:47:27 1.27 +++ loncom/Attic/lcuseradd 2004/08/06 10:29:37 1.28 @@ -6,7 +6,7 @@ # with adding a user with filesystem privileges (e.g. author) # # -# $Id: lcuseradd,v 1.27 2004/08/05 20:47:27 albertel Exp $ +# $Id: lcuseradd,v 1.28 2004/08/06 10:29:37 foxr Exp $ ### ############################################################################### @@ -147,14 +147,12 @@ unless (&try_to_lock("/tmp/lock_lcpasswd my @input; if (@ARGV>=3) { @input=@ARGV; -} -elsif (@ARGV) { +} elsif (@ARGV) { print("Error. This program needs at least 3 command-line arguments (username, ". "password 1, password 2 [errorfile]).\n") unless $noprint; unlink('/tmp/lock_lcpasswd'); &Exit(2); -} -else { +} else { @input=<>; if (@input < 3) { print("Error. At least three lines should be entered into standard input.\n") @@ -208,8 +206,7 @@ if($error_file) { Exit(14); } - } - else { + } else { $error_file=""; print "Invalid error filename\n" unless $noprint; Exit(14); @@ -334,8 +331,7 @@ sub enable_root_capability { if ($wwwid==$>) { ($<,$>)=($>,0); ($(,$))=($),0); - } - else { + } else { # root capability is already enabled } return $>; @@ -346,8 +342,7 @@ sub disable_root_capability { if ($wwwid==$<) { ($<,$>)=($>,$<); ($(,$))=($),$(); - } - else { + } else { # root capability is already disabled } } @@ -376,8 +371,7 @@ sub try_to_lock { } sleep 3; $lastpid=$currentpid; - } - else { + } else { last; } if ($_==10) {