]> git.ipfire.org Git - thirdparty/glibc.git/commit
nsswitch: handle missing actions properly
authorDJ Delorie <dj@redhat.com>
Thu, 10 Dec 2020 02:46:30 +0000 (21:46 -0500)
committerDJ Delorie <dj@redhat.com>
Mon, 14 Dec 2020 17:19:43 +0000 (12:19 -0500)
commitd2e929a907914e233d001d1dd5e3143e84fa69e0
treee0fc726fa628727fee23a86a6053f9107502c84b
parent2ee7711bdd7de9dd30073b223ce29d5cd50320f6
nsswitch: handle missing actions properly

Some internal functions need to know if a database has a nonzero
list of actions; success getting the database does not guarantee
that.  Add checks for such as needed.

Skip the ":" in each nsswitch.conf line so as not to add a dummy
action libnss_:.so

See also https://bugzilla.redhat.com/show_bug.cgi?id=1906066

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
12 files changed:
grp/Makefile
grp/initgroups.c
grp/tst-initgroups1.c [new file with mode: 0644]
grp/tst-initgroups1.root/etc/group [new file with mode: 0644]
grp/tst-initgroups1.root/etc/nsswitch.conf [new file with mode: 0644]
grp/tst-initgroups1.root/etc/passwd [new file with mode: 0644]
grp/tst-initgroups2.c [new file with mode: 0644]
grp/tst-initgroups2.root/etc/group [new file with mode: 0644]
grp/tst-initgroups2.root/etc/nsswitch.conf [new file with mode: 0644]
grp/tst-initgroups2.root/etc/passwd [new file with mode: 0644]
nss/nss_database.c
nss/nsswitch.c