Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old May 10th, 2006, 2:55 PM   #1
titaniumdecoy
Expert Programmer
 
titaniumdecoy's Avatar
 
Join Date: Nov 2005
Posts: 903
Rep Power: 3 titaniumdecoy is on a distinguished road
Send a message via AIM to titaniumdecoy
Using the shell to check passwords?

I'm not sure whether this should be under PHP or Bash/Shell Scripting.

I'm attempting to write a PHP frontend for the Unix rcs utility for a classroom environment. In order to work with multiple users I need to verify the password that user enters coincides with that user's account name on the server. How can I do this? What I have come up with so far is the following:

// Read $user and $pass and run through 
// escapeshellarg()/escapeshellcmd() functions
$result = system("echo $pass | login $user");
Is using login insecure or a bad idea for some reason? More importantly, after this code has been executed (assuming the login was successful) will further calls to system() be under this user? Is there any way to test the output ($result) of this call to determine whether the login was successful under any Unix system (as the output after login varies on most systems)? Is there a better way to accomplish this?

Thanks.
titaniumdecoy is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 6:48 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC