Mailing List
Home
Forum Home
Linux - General Red Hat Linux discussion list
Enterprise Linux 3 - Discussion of Red Hat Enterprise Linux 3 (Taroon)
Installation - Getting started with Red Hat Linux
Red Hat Linux 9 - Discussion of Red Hat Linux 9 (Shrike)
Red Hat Linux 7.3 - Discussion of Red Hat Linux 7.3 (Valhalla)
Red Hat Linux 7.2 - Discussion of Red Hat Linux 7.2 (Enigma)
Apache Web Server
Oracle database, Microsoft SQL server ...
Subjects
application/x mplayer2 plugin
RPM error: db4 error(16) from dbenv >remove: Device or resource
   busy
Command stream end of file while reading
X Windows problem (xauth)
Upgrading openoffice 1 1 rpm
FTP: connection refused
FTP: connection refused
mount: /dev/cdrom: is not a valid block device
Dell Precision 650, RedHat 9, no sound
how to trace the cause resulting in the crash of bind server
Virus on the list
UNINSTALL RPM MYSQL
usb pen drives: mounting as a user
broadcom network interface
make mrproper
sendmail configuration on redhat
Couldn 't open PID file /var/run/named/named pid Permission denied
Promise 378 controller
kernel 2 6 and /dev/sound/mixer not found
Problem using up2date
mrtg step by step howto/configuration for a newbie?
Compiling and Installing Kernel 2 6
Can 't locate module ppp0, can 't locate module ppp compress 21
HOW I CAN MAKE BOOTABLE FLOPPY DISKET
Lotus Notes under Wine
/etc/security/limits conf question
Intel E/1000 driver
Command stream end of file while reading
rpm database corrupt
qla2300 modules
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
NIS/Apache/Password Synchronization Issue

NIS/Apache/Password Synchronization Issue

2005-04-19       - By Dozier, Jr., Ken

 Back
Reply:     1     2     3  

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 = @(protected)(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@(protected) <mailto:kdozier@(protected)>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2800.1491" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face="Courier New" color=#000080 size=2><SPAN
class=108360116-19042005>I have written a LAMP(PHP)-based web app for my
employer, but I am having authentication problems that I think&nbsp;may be NIS
and/or Apache related.&nbsp; Everyone with a valid account on our network
should
be able to auth with no problem; however, not everyone is able to do so.&nbsp;
I
was able to login with my old password; but after I changed it, the app won't
authenticate me with the new one.&nbsp; The weird thing is that it will log me
in if I use my previous password.&nbsp; Also, the web server is RHEL 3 and has
no problem logging me in at the console with my new
password.</SPAN></FONT></DIV>
<DIV><FONT face="Courier New" color=#000080 size=2><SPAN
class=108360116-19042005></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" color=#000080 size=2><SPAN
class=108360116-19042005>Our network runs Win2K and RHEL 3 with Samba.&nbsp;
Authentication is via NIS, and the NIS master is a Win2K box.&nbsp; We are
using
the version of Apache that ships with RHEL 3, and PHP is version 4.3.2.&nbsp;
MySQL is also the default RHEL 3&nbsp;version; however, the app doesn't touch
the db until after authenticating the user, so MySQL should not be an
issue.&nbsp; The auth code snippet I am using is below.&nbsp; Thanks for your
help.</SPAN></FONT></DIV>
<DIV><FONT face="Courier New" color=#000080 size=2><SPAN
class=108360116-19042005></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" color=#000080 size=2><SPAN
class=108360116-19042005>&lt;snip&gt;</SPAN></FONT></DIV>
<DIV><FONT face="Courier New" color=#000080 size=2><SPAN
class=108360116-19042005>// Compare user input with NIS
info.</SPAN></FONT></DIV>
<DIV><FONT face="Courier New" color=#000080 size=2><SPAN
class=108360116-19042005>$nis_data = @(protected)(yp_get_default_domain(),
"passwd.byname", $username);</SPAN></FONT></DIV>
<DIV><FONT face="Courier New" color=#000080 size=2><SPAN
class=108360116-19042005>if (strlen($nis_data))</SPAN></FONT></DIV>
<DIV><FONT face="Courier New" color=#000080 size=2><SPAN
class=108360116-19042005>{</SPAN></FONT></DIV>
<DIV><FONT face="Courier New" color=#000080 size=2><SPAN
class=108360116-19042005>&nbsp; $nis_data = explode(":",
$nis_data);</SPAN></FONT></DIV>
<DIV><FONT face="Courier New" color=#000080 size=2><SPAN
class=108360116-19042005>&nbsp;&nbsp;$salted = crypt($password,
$nis_data[1]);</SPAN></FONT></DIV>
<DIV><FONT face="Courier New" color=#000080 size=2><SPAN
class=108360116-19042005>&nbsp; if ($salted == $nis_data[1])</SPAN></FONT></DIV>
<DIV><FONT face="Courier New" color=#000080 size=2><SPAN
class=108360116-19042005>&nbsp;&nbsp;&nbsp; return true;</SPAN></FONT></DIV>
<DIV><FONT face="Courier New" color=#000080 size=2><SPAN
class=108360116-19042005>}</SPAN></FONT></DIV>
<DIV><FONT face="Courier New" color=#000080 size=2><SPAN
class=108360116-19042005>else</SPAN></FONT></DIV>
<DIV><FONT face="Courier New" color=#000080 size=2><SPAN
class=108360116-19042005>&nbsp; return false;</SPAN></FONT></DIV>
<DIV><FONT face="Courier New" color=#000080 size=2><SPAN
class=108360116-19042005>&lt;/snip&gt;</SPAN></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face="Palatino Linotype" color=#000080><STRONG
>Ken
Dozier</STRONG></FONT></DIV>
<DIV align=left><FONT face="Palatino Linotype" color=#0000ff
size=2><EM>Microcomputer Support Specialist.</EM></FONT></DIV>
<DIV align=left><FONT face="Palatino Linotype" color=#000080
size=2><STRONG>Barton College</STRONG></FONT></DIV>
<DIV align=left><FONT face="Palatino Linotype" color=#000080 size=2>400 ACC
Drive</FONT></DIV>
<DIV align=left><FONT face="Palatino Linotype" color=#000080 size=2>Wilson, NC
27893</FONT></DIV>
<DIV align=left><FONT face="Palatino Linotype" color=#0000ff
size=2><EM>252.399.6437</EM></FONT></DIV>
<DIV align=left><FONT face="Palatino Linotype" size=2><A
href="mailto:kdozier@(protected)"><EM>kdozier@(protected)</EM></A></FONT></DIV>
<DIV>&nbsp;</DIV></BODY></HTML>

--
Taroon-list mailing list
Taroon-list@(protected)
http://www.redhat.com/mailman/listinfo/taroon-list

Earn $52 per hosting referral at Lunarpages.