[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

NIS/Apache/Password Synchronization Issue



I have written a LAMP(PHP)-based web app for my employer, but I am having authentication problems that I think may be NIS and/or Apache related.  Everyone with a valid account on our network should be able to auth with no problem; however, not everyone is able to do so.  I was able to login with my old password; but after I changed it, the app won't authenticate me with the new one.  The weird thing is that it will log me in if I use my previous password.  Also, the web server is RHEL 3 and has no problem logging me in at the console with my new password.
 
Our network runs Win2K and RHEL 3 with Samba.  Authentication is via NIS, and the NIS master is a Win2K box.  We are using the version of Apache that ships with RHEL 3, and PHP is version 4.3.2.  MySQL is also the default RHEL 3 version; however, the app doesn't touch the db until after authenticating the user, so MySQL should not be an issue.  The auth code snippet I am using is below.  Thanks for your help.
 
<snip>
// Compare user input with NIS info.
$nis_data = @yp_match(yp_get_default_domain(), "passwd.byname", $username);
if (strlen($nis_data))
{
  $nis_data = explode(":", $nis_data);
  $salted = crypt($password, $nis_data[1]);
  if ($salted == $nis_data[1])
    return true;
}
else
  return false;
</snip>
 
Ken Dozier
Microcomputer Support Specialist.
Barton College
400 ACC Drive
Wilson, NC 27893
252.399.6437
kdozier barton edu
 

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]