diff options
author | Milan Jurik <Milan.Jurik@Sun.COM> | 2009-05-08 10:18:07 +0100 |
---|---|---|
committer | Milan Jurik <Milan.Jurik@Sun.COM> | 2009-05-08 10:18:07 +0100 |
commit | c9d66ba7a02565d1320b4a0780e249cfe8c02612 (patch) | |
tree | 0c04908749e8ea8b18ecc91ade79caf8ae6ff843 /usr/src/lib/libc | |
parent | a234c3c9d43545879dbc055e14b73c147cc93aff (diff) | |
download | illumos-gate-c9d66ba7a02565d1320b4a0780e249cfe8c02612.tar.gz |
6786945 incorrect handling of non existant backend
Diffstat (limited to 'usr/src/lib/libc')
-rw-r--r-- | usr/src/lib/libc/port/gen/nss_common.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/usr/src/lib/libc/port/gen/nss_common.c b/usr/src/lib/libc/port/gen/nss_common.c index d82075b30b..67228d6162 100644 --- a/usr/src/lib/libc/port/gen/nss_common.c +++ b/usr/src/lib/libc/port/gen/nss_common.c @@ -1506,20 +1506,23 @@ nss_getent_u(nss_db_root_t *rootp, nss_db_initf_t initf, n_src++; } while (n_src < s->max_src && (be = nss_get_backend_u(&rootp, s, n_src)) == 0); + contextp->be = be; if (be == 0) { /* * This is the case where we failed to get the backend * for the last source. We exhausted all sources. + * + * We need to do cleanup ourselves because end_iter_u() + * does not do it for be == 0. */ + NSS_UNREF_UNLOCK(rootp, s); + contextp->s = 0; + break; + } else { NSS_UNLOCK(rootp); - nss_endent_u(rootp, initf, contextpp); - nss_delete(rootp); - return (NSS_SUCCESS); + contextp->n_src = n_src; + (void) NSS_INVOKE_DBOP(be, NSS_DBOP_SETENT, 0); } - NSS_UNLOCK(rootp); - contextp->n_src = n_src; - contextp->be = be; - (void) NSS_INVOKE_DBOP(be, NSS_DBOP_SETENT, 0); } /* Got to the end of the sources without finding another entry */ end_iter_u(rootp, contextp); |