--- loncom/Attic/lcuseradd 2000/10/30 02:42:17 1.9 +++ loncom/Attic/lcuseradd 2000/10/30 02:57:47 1.11 @@ -157,6 +157,7 @@ close IN; my ($userid,$useroldcryptpwd); my @F; my @U; for my $l (@lines) { + chop $l; @F=split(/\:/,$l); if ($F[0] eq $username) {($userid,$useroldcryptpwd)=($F[2],$F[1]); @U=@F;} } @@ -169,7 +170,7 @@ if (!defined($userid)) { } # Construct new password entry (random salt) -my $newcryptpwd=crypt($newpwd,(join '', ('.', '/', 0..9, 'A'..'Z', 'a'..'z')[rand 64, rand 64])); +my $newcryptpwd=crypt($password1,(join '', ('.', '/', 0..9, 'A'..'Z', 'a'..'z')[rand 64, rand 64])); $U[1]=$newcryptpwd; my $userline=join(':',@U); my $rootid=&enable_root_capability; @@ -205,8 +206,8 @@ unless ($smbexist) { close OUT; } open(OUT,"|/usr/bin/smbpasswd -s $safeusername>/dev/null"); -print OUT $newpwd; print OUT "\n"; -print OUT $newpwd; print OUT "\n"; +print OUT $password1; print OUT "\n"; +print OUT $password1; print OUT "\n"; close OUT; $<=$wwwid; # unfool the program @@ -216,7 +217,7 @@ $<=$wwwid; # unfool the program system('/bin/chmod','-R','0640',"/home/$safeusername"); system('/bin/chmod','0750',"/home/$safeusername"); mkdir "/home/$safeusername/public_html",0750; -open OUT,">/home/$safeusername/public_html"; +open OUT,">/home/$safeusername/public_html/index.html"; print OUT< @@ -239,7 +240,7 @@ This area provides for: END close OUT; - +system('/bin/chown','-R',"$safeusername:$safeusername","/home/$safeusername"); &disable_root_capability; unlink('/tmp/lock_lcpasswd'); exit 0;