Help diagnosing NIS breakage ?
wpaul at FreeBSD.ORG
Tue Jul 15 10:44:16 PDT 2003
> > > > On a client bound to this server, please do:
> > > > % ypwhich -m
> > >
> > > Thanks for getting back to me on this. First off, apologies if I'd
> > > failed to mention the server before...Now, on a -CURRENT NIS client
> > > (with rev 1.81
> > > getpwent.c):
> > > $ ypwhich -m
> > > shadow dc3
> > > passwd.byuid dc3
> > [...]
> > Ok, so it does support the YPPROC_MASTER procedure. Let's try
> > something a little different. This time, do:
> > % ypwhich -m master.passwd.byname
> > And show the results. Might as well try ypwhich -m
> > master.passwd.byuid too, though the result will probably be the same.
> Ok....Using getpwent.c v1.82 with your diff:
> # id robin
> id: robin: no such user
> # ypwhich -m master.passwd.byname
> # ypwhich -m master.passwd.byuid
ARRRRGH!!!! Ok, first, whoever is responsible for this NIS server
implementation is an idiot. It appears the YPPROC_MASTER procedure does
no argument validation and always returns success even for maps that
don't exist. This is why revision 1.182 fails in your case: using
yp_master() to check for the master.passwd maps succeeds, which makes
the code think it should be doing master.passwd lookups (which ultimately
fail when the actual lookup is performed).
Fortunately, it looks like YPPROC_ORDER works correctly:
fbsd5 at test [~]$ ypwhich
fbsd5 at test [~]$ ypwhich -m master.passwd.byname
fbsd5 at test [~]$ yppoll master.passwd.byname
yppoll: no such map master.passwd.byname. Reason: No such map in server's domain
fbsd5 at test [~]$ yppoll passwd.byname
Map passwd.byname has order number 10683. Wed Dec 31 21:58:03 1969
The master server is dc3.
Second, I'm an idiot because I made a mistake in the patch I provided:
the nis_map() function should return NS_UNAVAIL if yp_order() fails,
rather than falling through and returning NS_SUCCESS all the time.
I uploaded a new diff, please test this instead:
Thanks for providing me access to this machine, it helped me realize
where I'd gone wrong in my patch. If this works for you, and if nobody
objects, I will check it in.
-Bill Paul (510) 749-2329 | Senior Engineer, Master of Unix-Fu
wpaul at windriver.com | Wind River Systems
"If stupidity were a handicap, you'd have the best parking spot."
More information about the freebsd-current