]> git.ipfire.org Git - thirdparty/glibc.git/commit
nsswitch: return result when nss database is locked [BZ #27343]
authorSergei Trofimovich <slyfox@gentoo.org>
Fri, 5 Feb 2021 07:32:18 +0000 (07:32 +0000)
committerDJ Delorie <dj@redhat.com>
Sat, 6 Feb 2021 03:35:25 +0000 (22:35 -0500)
commit17f0ff097887008b2d3dca270c8ffbb4b43a8749
treee095c36b9e761911e342ee7f651cb6f02d3e0d9f
parent9826b03b747b841f5fc6de2054bf1ef3f5c4bdf3
nsswitch: return result when nss database is locked [BZ #27343]

Before the change nss_database_check_reload_and_get() did not populate
the '*result' value when it returned success in a case of chroot
detection. This caused initgroups() to use garage pointer in the
following test (extracted from unbound):

```

int main() {
    // load some NSS modules
    struct passwd * pw = getpwnam("root");

    chdir("/tmp");
    chroot("/tmp");
    chdir("/");
    // access nsswitch.conf in a chroot
    initgroups("root", 0);
}
```

Reviewed-by: DJ Delorie <dj@redhat.com>
nss/nss_database.c