about summary refs log tree commit diff
path: root/nss/nsswitch.c
diff options
context:
space:
mode:
Diffstat (limited to 'nss/nsswitch.c')
-rw-r--r--nss/nsswitch.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/nss/nsswitch.c b/nss/nsswitch.c
index 40109c744d..5b46d06c6a 100644
--- a/nss/nsswitch.c
+++ b/nss/nsswitch.c
@@ -81,7 +81,10 @@ __nss_database_lookup2 (const char *database, const char *alternate_name,
   if (database_names[database_id] == NULL)
     return -1;
 
-  if (__nss_database_get (database_id, ni))
+  /* If *NI is NULL, the database was not mentioned in nsswitch.conf.
+     If *NI is not NULL, but *NI->module is NULL, the database was in
+     nsswitch.conf but listed no actions.  We test for the former.  */
+  if (__nss_database_get (database_id, ni) && *ni != NULL)
     {
       /* Success.  */
       return 0;