--- loncom/pwchange 2003/02/03 18:03:52 1.9 +++ loncom/pwchange 2009/07/17 02:20:59 1.10 @@ -9,7 +9,7 @@ # YEAR=2002 # 02/19 Matthew Hall # -# $Id: pwchange,v 1.9 2003/02/03 18:03:52 harris41 Exp $ +# $Id: pwchange,v 1.10 2009/07/17 02:20:59 raeburn Exp $ ### use strict; @@ -52,10 +52,20 @@ foreach (split(//,$pword)) {if ((ord($_) exit 3 if $pbad; # --------------------------------------------------------- Call system command -open OUT,"|passwd --stdin $safe >/dev/null"; -print OUT $pword; -print OUT "\n"; -close OUT; +my $distro; +if (open(PIPE,"perl distprobe|")) { + $distro = ; + close(PIPE); +} +if ($distro =~ /^ubuntu|debian/) { + open(OUT,"|/usr/sbin/usermod -p `mkpasswd $pword` $safe"); + close(OUT); +} else { + open(OUT,"|passwd --stdin $safe >/dev/null"); + print OUT $pword; + print OUT "\n"; + close(OUT); +} # --------------------------------------- exit with status of command execution exit $?/256; 500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.