Gossamer Forum
Home : General : Perl Programming :

reading /etc/shadow from a CGI script ...

Quote Reply
reading /etc/shadow from a CGI script ...
Hi,

Is it possible to open /etc/shadow (read-only of course), get the user's password and compare it to the user's input, from a CGI script that would be accessed by a browser?
Quote Reply
Re: reading /etc/shadow from a CGI script ... In reply to
To do that would mean opening up the shadow file to the web server's user and would sort of defeat the purpose of having shadowed passwords.
-- Gordon --


------------------
$blah='82:84:70:77';
print chr($_) foreach (split/:/,$blah);

Quote Reply
Re: reading /etc/shadow from a CGI script ... In reply to
that could be dangerous indeed. ok. can anyone provide me a sample script that i can call from a browser that would verify if the name and password entered by the user is indeed valid. am in a SunOS environment.

thanks.
Quote Reply
Re: reading /etc/shadow from a CGI script ... In reply to
Have a look at `perldoc -f getpwent`

Cheers,

Alex
Quote Reply
Re: reading /etc/shadow from a CGI script ... In reply to
I'm having the same problem. I would like to authenticate a user through a form. I'm working on a Unix Openserver 5.0.5. How is it possible to query the names and passwords of my users?

I have tried the command mentioned above but...nothing (

Any help would be appreciate.
Thank you.