]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
sunrpc: Remove stray exports without --enable-obsolete-rpc [BZ #23166]
authorFlorian Weimer <fweimer@redhat.com>
Fri, 11 May 2018 13:36:50 +0000 (15:36 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Fri, 11 May 2018 13:36:50 +0000 (15:36 +0200)
This is needed to avoid a warning when linking against libtirpc:

/lib64/libc.so.6: warning: common of `rpc_createerr@@TIRPC_0.3.0' overridden by definition
/usr/lib64/libtirpc.so: warning: defined here

This ld warning is not enabled by default; -Wl,--warn-common enables it.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
ChangeLog
include/rpc/clnt.h
include/rpc/svc.h
sunrpc/rpc_common.c
sunrpc/svcauth_des.c

index 68c9e36819eb89e419d1cc6dda5c8f44de501b23..1e7f94f6cb54c2ce7453eb0b18d6893cd9a4be8b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2018-05-11  Florian Weimer  <fweimer@redhat.com>
+
+       [BZ #23166]
+       * include/rpc/clnt.h (rpc_createerr): Declare hidden alias.
+       * include/rpc/svc.h (svc_pollfd, svc_max_pollfd, svc_fdset):
+       Likewise.
+       * sunrpc/rpc_common.c (svc_fdset, rpc_createerr, svc_pollfd)
+       (svc_max_pollfd): Add nocommon attribute and hidden alias.  Do not
+       export without --enable-obsolete-rpc.
+       * sunrpc/svcauth_des.c (svcauthdes_stats): Turn into compatibility
+       symbol.  This should not have been exported, ever.
+
 2018-05-11  Rafal Luzynski  <digitalfreak@lingonborough.com>
 
        [BZ #23152]
index a397023a9312bf5105eb4d796eb8666888c8ee77..80be0a9cecc6f80337f560ceed13a311ba7b1924 100644 (file)
@@ -28,6 +28,7 @@ libc_hidden_proto (clntudp_create)
 libc_hidden_proto (get_myaddress)
 libc_hidden_proto (clntunix_create)
 libc_hidden_proto (__libc_clntudp_bufcreate)
+libc_hidden_proto (rpc_createerr)
 
 # endif /* !_ISOMAC */
 #endif
index 465bf4427d3c7e493e23832ba3a11f7820c27fe8..40ba2546a9b6abebd2e282d020c294736b65ad37 100644 (file)
@@ -3,6 +3,10 @@
 
 # ifndef _ISOMAC
 
+libc_hidden_proto (svc_pollfd)
+libc_hidden_proto (svc_max_pollfd)
+libc_hidden_proto (svc_fdset)
+
 libc_hidden_proto (xprt_register)
 libc_hidden_proto (xprt_unregister)
 libc_hidden_proto (svc_register)
index 710191163c772d413096d15b3e004e5cc8002900..2d42827a872cbebb839c4bb2d8217ea456cec162 100644 (file)
    the variable is declared.  So we use the section attribute.  */
 struct opaque_auth _null_auth __attribute__ ((nocommon));
 libc_hidden_nolink_sunrpc (_null_auth, GLIBC_2_0)
-fd_set svc_fdset;
-struct rpc_createerr rpc_createerr;
-struct pollfd *svc_pollfd;
-int svc_max_pollfd;
+
+/* The variables need the nocommon attribute, so that it is possible
+   to create aliases and specify symbol versions.  */
+fd_set svc_fdset  __attribute__ ((nocommon));
+libc_hidden_nolink_sunrpc (svc_fdset, GLIBC_2_0)
+struct rpc_createerr rpc_createerr  __attribute__ ((nocommon));
+libc_hidden_nolink_sunrpc (rpc_createerr, GLIBC_2_0)
+struct pollfd *svc_pollfd  __attribute__ ((nocommon));
+libc_hidden_nolink_sunrpc (svc_pollfd, GLIBC_2_2)
+int svc_max_pollfd  __attribute__ ((nocommon));
+libc_hidden_nolink_sunrpc (svc_max_pollfd, GLIBC_2_2)
index f99a5a324fe182b0747e72ee7a00c7197b8a9833..9ce4804239f8fdf17d4128952ac4149caf678587 100644 (file)
@@ -87,16 +87,21 @@ static void cache_ref (uint32_t sid); /* note that sid was ref'd */
 
 static void invalidate (char *cred); /* invalidate entry in cache */
 
-/*
- * cache statistics
- */
+/* Cache statistics.  Accidental historic export without a matching
+   declaration in any header file.  */
+#ifndef SHARED
+static
+#endif
 struct
   {
     u_long ncachehits;         /* times cache hit, and is not replay */
     u_long ncachereplays;      /* times cache hit, and is replay */
     u_long ncachemisses;       /* times cache missed */
   }
-svcauthdes_stats;
+svcauthdes_stats __attribute__ ((nocommon));
+#ifdef SHARED
+compat_symbol (libc, svcauthdes_stats, svcauthdes_stats, GLIBC_2_0);
+#endif
 
 /*
  * Service side authenticator for AUTH_DES