I am having a problem using perl to authorize users
for a web project I am working on.
I am using getpwnam $user[1]; to
get the users password to compare to the crypted version of it.
However when running the perl script, I only get x,
the shadowed version of it. To get the right crypted password, I need to
be logged in as root.
Does anyone know how to accomplish this in
perl?
Thanks
Greg R.
<Code Snip>
$login=$config{'login'}; $passwd=$config{'passwd'}; $term=$config{'term'}; $crypted=(getpwnam $login)[1]; $sum_var=crypt($passwd,$crypted); $uid=(getpwnam $login)[2];
if($term ne 'c1'){ if ($uid > 0) { if ($sum_var eq $crypted) { print "<title>Verification</title><script language=javascript>"; print <<endjava; function verify() { window.location="http://raldev/cgi-bin/sti/check.cgi?term=$term&login=$login" } endjava print "</script></head><body bgcolor=white > exit; } else{ print "</head><body bgcolor=white><font size=8><br><br><hr>Incorrect Password.<hr> <br><br><center><a href='http://raldev/sti/login.html'>BACK</a></center></body></html>"; } </End Code Snip>
|
- Re: Perl and Shadowed passwords Greg Robertson
- Re: Perl and Shadowed passwords \"Anth Courtney\"