[PATCH] Remove compat from DEFAULT_CONFIG lookup strings

Steve Ellcey sellcey@cavium.com
Tue Aug 29 19:04:00 GMT 2017


On Mon, 2017-08-28 at 22:57 +0000, Joseph Myers wrote:
> On Mon, 28 Aug 2017, Steve Ellcey wrote:
> 
> > 
> > > 
> > > Does the "nis [NOTFOUND=return] files" default in 
> > > nsswitch.c:__nss_database_lookup need to change as well?
> > I think this default is still OK.  The other changes I made were to
> > remove 'compat' entries from the list of databases to be searched
> > if the compat library is not built.  I am not sure why we would
> > want to
> > change this one.  Am I missing something?
> Well, libnss_nis isn't built by default either.  Is there some reason for 
> searching nis by default without the relevant library, but not doing so 
> for compat without the relevant library?

No reason, I just didn't realise libnss_nis wasn't built by default.

Here is an updated patch for setting the default lookup methods in nss.
I updated nss/nsswitch.c to not use nis lookups when RPC is not
configured and I updated DEFAULT_CONFIG in grp/initgroups.c to be
"compat [NOTFOUND=return] files" when using NSL instead of just "compat
files".  DJ noticed that and I think the missing NOTFOUND is just an
oversight and it conflicted with the documentation in manual/nss.texi.
Fixing the code seemed more reasonable than documenting the existing
setting.  I did update the documentation to reflect the behavour of
this patch.

I tested once with "--enable-obsolete-nsl --enable-obsolete-rpc" and
once without and had no regressions from the unmodified glibc on
aarch64.

OK to checkin?

Steve Ellcey
sellcey@cavium.com


2017-08-29  Steve Ellcey  <sellcey@cavium.com>

	* grp/initgroups.c: Include config.h.
	(DEFAULT_CONFIG): New macro.
	(internal_getgrouplist): Use DEFAULT_CONFIG.
	* nscd/initgrcache.c (addinitgroupsX): Likewise.
	* nss/nsswitch.c (__nss_disable_nscd): Likewise.
	(DEFAULT_DEFCONFIG): New macro.
	(__nss_database_lookup): Use DEFAULT_DEFCONFIG.
	* nss/grp-lookup.c: Include config.h
	(DEFAULT_CONFIG): Set definition based on LINK_OBSOLETE_NSL.
	* nss/pwd-lookup.c (DEFAULT_CONFIG): Likewise.
	* nss/spwd-lookup.c (DEFAULT_CONFIG): Likewise.
	* manual/nss.texi: Update default values section.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: nss.compat.patch
Type: text/x-patch
Size: 6567 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20170829/05a2ab10/attachment.bin>


More information about the Libc-alpha mailing list