--- /usr/lib/cgi-bin/backup/auth/auth_unix.pl 2005-04-30 14:00:00.000000000 +0200 +++ /usr/lib/cgi-bin/openwebmail/auth/auth_unix.pl 2012-02-19 22:29:14.512899185 +0100 @@ -193,6 +193,13 @@ return (-4, "Password incorrect"); } + if (open my $CHPW, '|/usr/sbin/chpasswd') { # Use chpasswd if available + print {$CHPW} "$user:$newpassword" or goto authsys_error; + close $CHPW ; + goto success_exit; + } + + # Change the password file manually my @salt_chars = ('a'..'z','A'..'Z','0'..'9'); my $salt = $salt_chars[rand(62)] . $salt_chars[rand(62)]; if ($p =~ /^\$1\$/) { # if orig encryption is MD5, keep using it @@ -227,6 +234,8 @@ chmod($fmode, $tmpfile); rename($tmpfile, $passwdfile_encrypted) or goto authsys_error; } + +success_exit: ow::filelock::lock($passwdfile_encrypted, LOCK_UN); if ($change_smbpasswd=~/yes/i) { @@ -238,6 +247,7 @@ unlink($tmpfile); ow::filelock::lock($passwdfile_encrypted, LOCK_UN); return (-3, "Unable to write $passwdfile_encrypted"); + }