]> git.ipfire.org Git - thirdparty/glibc.git/commit
nsswitch: do not reload if "/" changes
authorDJ Delorie <dj@redhat.com>
Sat, 16 Jan 2021 00:50:00 +0000 (19:50 -0500)
committerDJ Delorie <dj@redhat.com>
Wed, 27 Jan 2021 18:35:15 +0000 (13:35 -0500)
commit429029a73ec2dba7f808f69ec8b9e3d84e13e804
treecfe71d0e361692d5aabff4d8eaa00f2638f69fe4
parent01cdcf783a666481133d4975b1980624b0ef4799
nsswitch: do not reload if "/" changes

https://sourceware.org/bugzilla/show_bug.cgi?id=27077

Before reloading nsswitch.conf, verify that the root directory
hasn't changed - if it has, it's likely that we've entered a
container and should not trust the nsswitch inside the container
nor load any shared objects therein.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
nss/Makefile
nss/nss_database.c
nss/nss_module.c
nss/nss_module.h
nss/tst-reload2.c [new file with mode: 0644]
nss/tst-reload2.root/etc/nsswitch.conf [new file with mode: 0644]
nss/tst-reload2.root/subdir/etc/group [new file with mode: 0644]
nss/tst-reload2.root/subdir/etc/nsswitch.conf [new file with mode: 0644]
nss/tst-reload2.root/tst-reload2.script [new file with mode: 0644]