about summary refs log tree commit diff
path: root/nss/nsswitch.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2019-05-15 13:51:35 +0200
committerFlorian Weimer <fweimer@redhat.com>2019-05-15 15:07:49 +0200
commita9368c34d70cef91ca59b09941f496df11d6b146 (patch)
tree238aa331f31e567299bcc80b49de7f4f8707a1a3 /nss/nsswitch.c
parentd50f09181eca10a91fd9035bb90711b265770dc9 (diff)
downloadglibc-a9368c34d70cef91ca59b09941f496df11d6b146.tar.gz
glibc-a9368c34d70cef91ca59b09941f496df11d6b146.tar.xz
glibc-a9368c34d70cef91ca59b09941f496df11d6b146.zip
nss: Turn __nss_database_lookup into a compatibility symbol
The function uses the internal service_user type, so it is not
really usable from the outside of glibc.  Rename the function
to __nss_database_lookup2 for internal use, and change
__nss_database_lookup to always indicate failure to the caller.

__nss_next already was a compatibility symbol.  The new
implementation always fails and no longer calls __nss_next2.

unscd, the alternative nscd implementation, does not use
__nss_database_lookup, so it is not affected by this change.
Diffstat (limited to 'nss/nsswitch.c')
-rw-r--r--nss/nsswitch.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/nss/nsswitch.c b/nss/nsswitch.c
index 3d828f9a21..c4a9ffb575 100644
--- a/nss/nsswitch.c
+++ b/nss/nsswitch.c
@@ -115,8 +115,8 @@ static void (*nscd_init_cb) (size_t, struct traced_file *);
 /* -1 == database not found
     0 == database entry pointer stored */
 int
-__nss_database_lookup (const char *database, const char *alternate_name,
-		       const char *defconfig, service_user **ni)
+__nss_database_lookup2 (const char *database, const char *alternate_name,
+			const char *defconfig, service_user **ni)
 {
   /* Prevent multiple threads to change the service table.  */
   __libc_lock_lock (lock);
@@ -185,7 +185,7 @@ __nss_database_lookup (const char *database, const char *alternate_name,
 
   return *ni != NULL ? 0 : -1;
 }
-libc_hidden_def (__nss_database_lookup)
+libc_hidden_def (__nss_database_lookup2)
 
 
 /* -1 == not found
@@ -260,16 +260,6 @@ __nss_next2 (service_user **ni, const char *fct_name, const char *fct2_name,
 }
 libc_hidden_def (__nss_next2)
 
-
-int
-attribute_compat_text_section
-__nss_next (service_user **ni, const char *fct_name, void **fctp, int status,
-	    int all_values)
-{
-  return __nss_next2 (ni, fct_name, NULL, fctp, status, all_values);
-}
-
-
 int
 __nss_configure_lookup (const char *dbname, const char *service_line)
 {
@@ -835,7 +825,7 @@ nss_load_all_libraries (const char *service, const char *def)
 {
   service_user *ni = NULL;
 
-  if (__nss_database_lookup (service, NULL, def, &ni) == 0)
+  if (__nss_database_lookup2 (service, NULL, def, &ni) == 0)
     while (ni != NULL)
       {
 	nss_load_library (ni);