Date: Thu, 8 Jul 1999 20:59:58 +0100 From: Nik Clayton <nik@nothing-going-on.demon.co.uk> To: Sheldon Hearn <sheldonh@uunet.co.za> Cc: Nik Clayton <nik@nothing-going-on.demon.co.uk>, hackers@freebsd.org Subject: Re: docs/12377: doc patch for login_cap. Message-ID: <19990708205958.A91668@catkin.nothing-going-on.org> In-Reply-To: <97325.931422186@axl.noc.iafrica.com>; from Sheldon Hearn on Thu, Jul 08, 1999 at 10:23:06AM %2B0200 References: <19990708000310.A37390@catkin.nothing-going-on.org> <97325.931422186@axl.noc.iafrica.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Sheldon, On Thu, Jul 08, 1999 at 10:23:06AM +0200, Sheldon Hearn wrote: > > I have done. As far as I can tell, the submitter is saying "Yes, the > > information I was looking for was in the manual page, but it (specifically, > > that the "root" account doesn't use the "default" entry) is buried as > > a throw away comment at the end of a long paragraph." > > No. The PR suggests a fix to a completely different paragraph, > describing a different function. OK. I've looked at this in more detail, and it seems as though two functions are being described in the manual page: There's login_getpwclass(). This function will use the "root" entry for the root user if it exists, before falling back to "default". This is documented as such in the man page, so there are no problems there. In addition, there is login_getuserclass(). According to the PR, this also uses the "root" entry for the root user, if it exists, before falling back to "default" if it doesn't. Having now looked at (but not run) the code in src/lib/libutil/login_cap.c, I'm not convinced this last assertion in the PR is actually the case. It looks as if the code to use "root" instead of "default" first is in login_getpwclass(), but *not* in login_getuserclass(). So the PR is actually wrong about the text to add. That's fair enough. However, IMHO, the man page could be a bit clearer. Specifically, we have a paragraph that explains how defaults are looked up, and explicitly mentions the "default" class. We then have four intervening paragraphs, which do not relate to looking up the "default" entry. Finally, at the end of the fifth paragraph, is the information that login_getpwclass() will use a "root" entry first, before trying for "default" if the user being looked up is "root". This last piece of information really belongs with the earlier paragraph (although it can be repeated later on). With that in mind, how about this patch (in conjunction with the patch to login.conf in the original PR, which just updates a comment)? --- login_cap.3.org Thu Jul 8 13:15:35 1999 +++ login_cap.3 Thu Jul 8 13:22:00 1999 @@ -147,6 +147,11 @@ with that name returned in the .Ar lc_class field. +In addition, if the referenced user has a UID of 0 (normally, +"root", although the user name is not considered) then +.Fn login_getpwclass +will search for a record with an id of "root" before it searches +for the record with the id of "default". .Pp The .Ar lc_cap @@ -231,6 +236,7 @@ .Fn login_getclass restricts loookup only to the system login class database in .Pa /etc/login.conf . +As explained previously, .Fn login_getpwclass only differs from .Fn login_getclass N -- [intentional self-reference] can be easily accommodated using a blessed, non-self-referential dummy head-node whose own object destructor severs the links. -- Tom Christiansen in <375143b5@cs.colorado.edu> To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990708205958.A91668>