]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
nss: Remove effectively unused __nss_*_database variables
authorFlorian Weimer <fweimer@redhat.com>
Tue, 18 Nov 2025 19:18:06 +0000 (20:18 +0100)
committerFlorian Weimer <fweimer@redhat.com>
Tue, 18 Nov 2025 19:18:06 +0000 (20:18 +0100)
Use of this cache was removed in commit f8847d83e17774ed5e9c0f75ef693
("nsswitch: use new internal API (core)").

Reviewed-by: Collin Funk <collin.funk1@gmail.com>
nss/XXX-lookup.c
nss/nsswitch.c
nss/nsswitch.h
nss/tst-rfc3484-2.c
nss/tst-rfc3484-3.c
nss/tst-rfc3484.c

index 525b4d6304d5ae242e9af41b2f7baa1182b7e18e..6f5ea35d293292d9f0d58deed51a65080e5c132d 100644 (file)
 #define CONCAT2_1(Pre, Name) CONCAT2_2 (Pre, Name)
 #define CONCAT2_2(Pre, Name) Pre##Name
 
-#define DATABASE_NAME_SYMBOL CONCAT3_1 (__nss_, DATABASE_NAME, _database)
-#define DATABASE_NAME_STRING STRINGIFY1 (DATABASE_NAME)
-#define STRINGIFY1(Name) STRINGIFY2 (Name)
-#define STRINGIFY2(Name) #Name
-
 int
 DB_LOOKUP_FCT (nss_action_list *ni, const char *fct_name, const char *fct2_name,
               void **fctp)
 {
-  if (! __nss_database_get (DATABASE_NAME_ID, &DATABASE_NAME_SYMBOL))
+  nss_action_list actions;
+  if (! __nss_database_get (DATABASE_NAME_ID, &actions))
     return -1;
 
-  *ni = DATABASE_NAME_SYMBOL;
+  *ni = actions;
 
   /* We want to know about it if we've somehow got a NULL action list;
    in the past, we had bad state if seccomp interfered with setup. */
index d1bff6721dd57db6f040183e605ebd41676cc50d..b23bb4c2c19fa534bd073e6e075b6c1de1e0542a 100644 (file)
 #include <sysdep.h>
 #include <config.h>
 
-/* Declare external database variables.  */
-#define DEFINE_DATABASE(name)                                                \
-  nss_action_list __nss_##name##_database attribute_hidden;                  \
-  weak_extern (__nss_##name##_database)
-#include "databases.def"
-#undef DEFINE_DATABASE
-
-
 #ifdef USE_NSCD
 /* Flags whether custom rules for database is set.  */
 bool __nss_database_custom[NSS_DBSIDX_max];
index fd37379377d4adbdd0f88691dbf1db5c60d8400a..9799627aa24f6428951d6f42541e7e8aef1c9bf4 100644 (file)
@@ -184,10 +184,9 @@ libc_hidden_proto (__nss_hostname_digits_dots)
 #define MAX_NR_ADDRS    48
 
 /* Prototypes for __nss_*_lookup2 functions.  */
-#define DEFINE_DATABASE(arg)                                                 \
-  extern struct nss_action *__nss_##arg##_database attribute_hidden;                 \
-  int __nss_##arg##_lookup2 (struct nss_action **, const char *,                     \
-                            const char *, void **);                          \
+#define DEFINE_DATABASE(arg)                                           \
+  int __nss_##arg##_lookup2 (struct nss_action **, const char *,       \
+                            const char *, void **);                    \
   libc_hidden_proto (__nss_##arg##_lookup2)
 #include "databases.def"
 #undef DEFINE_DATABASE
index a5f8f82c040568af2c920b42f4db6bf9e7c03e49..7f89e1527c74d96fd2cdc17047a2f782d9a3e86e 100644 (file)
@@ -59,8 +59,6 @@ _res_hconf_init (void)
 #undef USE_NSCD
 #include "getaddrinfo.c"
 
-nss_action_list __nss_hosts_database attribute_hidden;
-
 /* This is the beginning of the real test code.  The above defines
    (among other things) the function rfc3484_sort.  */
 
index edf0b7db2e427109b8a2de6cd1ebd4a84a97d7ba..23aebfd54aeabf46c558ed413ee77d5f63d43740 100644 (file)
@@ -59,8 +59,6 @@ _res_hconf_init (void)
 #undef USE_NSCD
 #include "getaddrinfo.c"
 
-nss_action_list __nss_hosts_database attribute_hidden;
-
 /* This is the beginning of the real test code.  The above defines
    (among other things) the function rfc3484_sort.  */
 
index 5b4a0c5b823fba9c49eb434902ce98db0fb15aad..f882f95f84a17cfa048328f786302b49db7ee576 100644 (file)
@@ -59,8 +59,6 @@ _res_hconf_init (void)
 #undef USE_NSCD
 #include "getaddrinfo.c"
 
-nss_action_list __nss_hosts_database attribute_hidden;
-
 /* This is the beginning of the real test code.  The above defines
    (among other things) the function rfc3484_sort.  */