about summary refs log tree commit diff
path: root/nss/nss_database.h
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2021-02-15 21:34:23 -0500
committerDJ Delorie <dj@redhat.com>2021-03-09 14:34:50 -0500
commit9b456c5da968ee832ea4b2b73a18a5bf6d2118a6 (patch)
treee0f9e838dd5862499207e16cf6e8b3d15d49d374 /nss/nss_database.h
parent24eb3be5db5befefe4bcf0f438bf6629a9c3a608 (diff)
downloadglibc-9b456c5da968ee832ea4b2b73a18a5bf6d2118a6.tar.gz
glibc-9b456c5da968ee832ea4b2b73a18a5bf6d2118a6.tar.xz
glibc-9b456c5da968ee832ea4b2b73a18a5bf6d2118a6.zip
nss: fix nss_database_lookup2's alternate handling [BZ #27416]
__nss_database_lookup2's extra arguments were left unused in the
nsswitch reloading patch set; this broke compat (default config
ignored) and shadow files (secondary name ignored) which relies on
these fallbacks.

This patch adds in the previous behavior by correcting the
initialization of the database list to reflect the fallbacks.  This
means that the nss_database_lookup2 interface no longer needs to be
passed the fallback info, so API and callers were adjusted.

Since all callers needed to be edited anyway, the calls were changed
from __nss_database_lookup2 to the faster __nss_database_get.  This
was an intended optimization which was deferred during the initial
lookup changes to avoid touching so many files.

The test case verifies that compat targets work (passwd) and that the
default configuration works (group).  Tested on x86-64.
Diffstat (limited to 'nss/nss_database.h')
-rw-r--r--nss/nss_database.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/nss/nss_database.h b/nss/nss_database.h
index 1f827e6def..d4b23b5295 100644
--- a/nss/nss_database.h
+++ b/nss/nss_database.h
@@ -52,12 +52,11 @@ enum nss_database
   NSS_DATABASE_COUNT
 };
 
-
 /* Looks up the action list for DB and stores it in *ACTIONS.  Returns
    true on success or false on failure.  Success can mean that
    *ACTIONS is NULL.  */
-bool __nss_database_get (enum nss_database db, nss_action_list *actions)
-  attribute_hidden;
+bool __nss_database_get (enum nss_database db, nss_action_list *actions);
+libc_hidden_proto (__nss_database_get)
 
 /* Like __nss_database_get, but does not reload /etc/nsswitch.conf
    from disk.  This assumes that there has been a previous successful