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

Re: perl or libc6 bug?: getpwnam('root') in NIS environment

On Wed, Apr 14, 1999 at 08:38:04PM -0700, Stephen Zander wrote:
: >>>>> "Heiko" == Heiko Schlittermann <heiko@datom.de> writes:
:     Heiko> #! /usr/bin/perl print (getpwnam('root'))[1], "\n";
:     Heiko> returns the root encrypted password from the NIS-Servers
:     Heiko> /etc/shadow ...!!
:     Heiko> /etc/nsswitch reads as: passwd: files nis #compat
:     Heiko> group: files nis #compat shadow: files nis #compat
:     Heiko> And root is in /etc/{passwd,shadow} on the local host.
: A patched perl performs a getspnam call as part of perl's getpwnam
: call.  This will work iff you have sufficient privileges, as you would
: expect, otherwise you get 'undef' for that value.

Yes, this is reproducable:  perls getpwnam('root') returns 'x' if called 
by joe user and if called by root it returns the crypted passwd string.

: 1) perl isn't patched and getpwnam is broken.
: 2) perl is patched and getspnam is broken.
: 3) perl is patched and nothing is broken.
: My money's on 3).  Are you *sure* that it's the encrypted password of
: the NIS server and not the root password for the client?

Sure. Both machines have different root passwords.

    Best Regards from Dresden/Germany
    Viele Gruesse aus Dresden
    Heiko Schlittermann
[internet & unix support ----------------- Heiko Schlittermann]
[<a href="http://debian.schlittermann.de/";> Debian 2.1 CD </a>]
[Heiko Schlittermann HS12-RIPE finger:heiko@schlittermann.de -]
[pgp: A1 7D F6 7B 69 73 48 35  E1 DE 21 A7 A8 9A 77 92 -------]

Reply to: