version 1.8, 2000/10/30 02:31:45
|
version 1.9, 2000/10/30 02:42:17
|
Line 105 if ($username ne $safeusername) {
|
Line 105 if ($username ne $safeusername) {
|
exit 9; |
exit 9; |
} |
} |
my $pbad=0; |
my $pbad=0; |
map {if (($_<32)&&($_>126)){$pbad=1;}} (split(//,$oldpwd)); |
map {if ((ord($_)<32)||(ord($_)>126)){$pbad=1;}} (split(//,$password1)); |
map {if (($_<32)&&($_>126)){$pbad=1;}} (split(//,$newpwd)); |
map {if ((ord($_)<32)||(ord($_)>126)){$pbad=1;}} (split(//,$password2)); |
if ($pbad) { |
if ($pbad) { |
print "Error. A password entry had an invalid character.\n"; |
print "Error. A password entry had an invalid character.\n"; |
unlink('/tmp/lock_lcpasswd'); |
unlink('/tmp/lock_lcpasswd'); |
Line 150 if (system('/usr/sbin/usermod','-G',$saf
|
Line 150 if (system('/usr/sbin/usermod','-G',$saf
|
# for crazy characters in the password, and the setuid environment of perl |
# for crazy characters in the password, and the setuid environment of perl |
# requires me to make everything safe. |
# requires me to make everything safe. |
|
|
my $pbad=0; |
|
map {if (($_<32)&&($_>126)){$pbad=1;}} (split(//,$oldpwd)); |
|
map {if (($_<32)&&($_>126)){$pbad=1;}} (split(//,$newpwd)); |
|
if ($pbad) { |
|
print "Error. A password entry had an invalid character.\n"; |
|
unlink('/tmp/lock_lcpasswd'); |
|
exit 10; |
|
} |
|
|
|
# Grab the line corresponding to username |
# Grab the line corresponding to username |
|
open (IN, "</etc/passwd"); |
|
@lines=<IN>; |
|
close IN; |
my ($userid,$useroldcryptpwd); |
my ($userid,$useroldcryptpwd); |
my @F; my @U; |
my @F; my @U; |
for my $l (@lines) { |
for my $l (@lines) { |
Line 174 if (!defined($userid)) {
|
Line 168 if (!defined($userid)) {
|
exit 5; |
exit 5; |
} |
} |
|
|
# Verify password entry |
|
if (crypt($oldpwd,$useroldcryptpwd) ne $useroldcryptpwd) { |
|
print "Error. Invalid entry of current password.\n" unless $noprint; |
|
unlink('/tmp/lock_lcpasswd'); |
|
exit 6; |
|
} |
|
|
|
# Construct new password entry (random salt) |
# Construct new password entry (random salt) |
my $newcryptpwd=crypt($newpwd,(join '', ('.', '/', 0..9, 'A'..'Z', 'a'..'z')[rand 64, rand 64])); |
my $newcryptpwd=crypt($newpwd,(join '', ('.', '/', 0..9, 'A'..'Z', 'a'..'z')[rand 64, rand 64])); |
$U[1]=$newcryptpwd; |
$U[1]=$newcryptpwd; |
Line 226 $<=$wwwid; # unfool the program
|
Line 213 $<=$wwwid; # unfool the program
|
# Make final modifications to the user directory. |
# Make final modifications to the user directory. |
# Add a public_html file with a stand-in index.html file. |
# Add a public_html file with a stand-in index.html file. |
|
|
|
system('/bin/chmod','-R','0640',"/home/$safeusername"); |
|
system('/bin/chmod','0750',"/home/$safeusername"); |
mkdir "/home/$safeusername/public_html",0750; |
mkdir "/home/$safeusername/public_html",0750; |
# chmod -R |
|
open OUT,">/home/$safeusername/public_html"; |
open OUT,">/home/$safeusername/public_html"; |
print OUT<<END; |
print OUT<<END; |
<HTML> |
<HTML> |