Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Jun 1999 23:56:07 -0400 (EDT)
From:      Mike Nowlin <mike@argos.org>
To:        John Baldwin <jobaldwi@vt.edu>
Cc:        Wes Peters <wes@softweyr.com>, freebsd-security@FreeBSD.ORG
Subject:   Re: NIS strangeness
Message-ID:  <Pine.LNX.4.05.9906062349490.4215-100000@jason.argos.org>
In-Reply-To: <199906070227.WAA09234@smtp4.erols.com>

next in thread | previous in thread | raw e-mail | index | archive | help

More info about this whole problem:

> > I'm not so sure about that *.  If "ypmatch -k username passwd" works,
> > the network transport and NIS parts are working just fine.


Basically, if "root" is who's calling getpwnam(), the NIS lookup fails.
If any other user calls getpwnam(), it works.  Example:

--------------------
#include <sys/types.h>
#include <pwd.h>

main()
{
   struct passwd *pwdinfo;

   pwdinfo = getpwnam("steph");
   printf("Name: %s\n", pwdinfo->pw_name);
   printf("Passwd: %s\n", pwdinfo->pw_passwd);
}
------------------  (It sucks, I know...  But it was to test a theory.)

If root runs this program, it SEGV's and blows up.  But if anybody else
runs it, it comes back with 

Name: steph
Passwd: *

...as expected.  (Steph is another NIS-defined user.)

If I replace "steph" with "mike" in the above program, both root &
non-root can run it fine.  "mike" is NOT a NIS-defined user -- that one
actually exists in the local password file.

I can do a "ypcat master.passwd", "ypcat passwd", or "ypmatch rubino
master.passwd", and they all work -- it's not a missing master.passwd map.

This is slowly driving me insane...

--Mike




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-security" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.4.05.9906062349490.4215-100000>