]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix multiple definitions of __nss_*_database (bug 22918)
authorAndreas Schwab <schwab@linux-m68k.org>
Fri, 2 Mar 2018 22:07:14 +0000 (23:07 +0100)
committerAndreas Schwab <schwab@linux-m68k.org>
Sat, 3 Mar 2018 16:44:24 +0000 (17:44 +0100)
ChangeLog
nscd/gai.c
nss/nsswitch.c
nss/nsswitch.h
posix/tst-rfc3484-2.c
posix/tst-rfc3484-3.c
posix/tst-rfc3484.c

index f2dd409fd2d0a51a6e91869abdca92ec08d51609..775e4c6ab3a4982f21d22d49c195e008d42d0287 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2018-03-03  Andreas Schwab  <schwab@linux-m68k.org>
+
+       [BZ #22918]
+       * nss/nsswitch.h (DEFINE_DATABASE): Don't define __nss_*_database.
+       * nss/nsswitch.c (DEFINE_DATABASE): Define __nss_*_database here.
+       * nscd/gai.c (__nss_hosts_database): Readd definition.
+       * posix/tst-rfc3484.c (__nss_hosts_database): Likewise.
+       * posix/tst-rfc3484-3.c (__nss_hosts_database): Likewise.
+       * posix/tst-rfc3484-2.c (__nss_hosts_database): Likewise.
+
 2018-03-02  Joseph Myers  <joseph@codesourcery.com>
 
        * sysdeps/powerpc/ifunc-sel.h (ifunc_sel): Make always_inline.
index d0817477976c0bdf95f9b28ee9f71ebaf14de199..576fd0045b4abf361693efcd400dcee9a30e3237 100644 (file)
@@ -45,3 +45,6 @@
 #ifdef HAVE_LIBIDN
 # include <libidn/idn-stub.c>
 #endif
+
+/* Some variables normally defined in libc.  */
+service_user *__nss_hosts_database attribute_hidden;
index 4b8deedabf8bae4119b80a0dc3519366017af7e3..ee46f24424bc1ca2085f4fd7f1060ae330ee5bae 100644 (file)
@@ -62,7 +62,7 @@ static service_library *nss_new_service (name_database *database,
 
 /* Declare external database variables.  */
 #define DEFINE_DATABASE(name)                                                \
-  extern service_user *__nss_##name##_database attribute_hidden;             \
+  service_user *__nss_##name##_database attribute_hidden;                    \
   weak_extern (__nss_##name##_database)
 #include "databases.def"
 #undef DEFINE_DATABASE
index eccb535ef535f87656c8c3083583b5419a94f317..63573b9ebc830d07105e88de2740101a4056761f 100644 (file)
@@ -226,10 +226,10 @@ libc_hidden_proto (__nss_hostname_digits_dots)
 #define MAX_NR_ADDRS    48
 
 /* Prototypes for __nss_*_lookup2 functions.  */
-#define DEFINE_DATABASE(arg)                               \
-  service_user *__nss_##arg##_database attribute_hidden;    \
-  int __nss_##arg##_lookup2 (service_user **, const char *, \
-                            const char *, void **);        \
+#define DEFINE_DATABASE(arg)                                                 \
+  extern service_user *__nss_##arg##_database attribute_hidden;                      \
+  int __nss_##arg##_lookup2 (service_user **, const char *,                  \
+                            const char *, void **);                          \
   libc_hidden_proto (__nss_##arg##_lookup2)
 #include "databases.def"
 #undef DEFINE_DATABASE
index f509534ca9b99775880ba6fa90f11d6fbe4251b3..8c64ac59ff5777ce3b7e0fb504415a75652808da 100644 (file)
@@ -58,6 +58,7 @@ _res_hconf_init (void)
 #undef USE_NSCD
 #include "../sysdeps/posix/getaddrinfo.c"
 
+service_user *__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 ae44087a105eeeb04c51a071b7e7e10278a1d003..1c61aaf84484fba3458b6286dbb28d48f37e380e 100644 (file)
@@ -58,6 +58,7 @@ _res_hconf_init (void)
 #undef USE_NSCD
 #include "../sysdeps/posix/getaddrinfo.c"
 
+service_user *__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 7f191abbbc541dd4a36c840b4ea4d59995221a07..8f45848e44608f8fa94aa96e5ab87fede15d396a 100644 (file)
@@ -58,6 +58,7 @@ _res_hconf_init (void)
 #undef USE_NSCD
 #include "../sysdeps/posix/getaddrinfo.c"
 
+service_user *__nss_hosts_database attribute_hidden;
 
 /* This is the beginning of the real test code.  The above defines
    (among other things) the function rfc3484_sort.  */