public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/google/grte/v5-2.27/master] sunrpc: Remove stray exports without --enable-obsolete-rpc [BZ #23166]
@ 2021-08-28  0:38 Fangrui Song
  0 siblings, 0 replies; only message in thread
From: Fangrui Song @ 2021-08-28  0:38 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=da768de04f2cdbf6117bddb7a23593d6fb4356fb

commit da768de04f2cdbf6117bddb7a23593d6fb4356fb
Author: Florian Weimer <fweimer@redhat.com>
Date:   Tue May 15 08:21:11 2018 +0200

    sunrpc: Remove stray exports without --enable-obsolete-rpc [BZ #23166]
    
    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>
    
    (cherry picked from commit 89aacb513eb77549a29df2638913a0f8178cf3f5)

Diff:
---
 ChangeLog            | 12 ++++++++++++
 NEWS                 |  1 +
 include/rpc/clnt.h   |  1 +
 include/rpc/svc.h    |  4 ++++
 sunrpc/rpc_common.c  | 15 +++++++++++----
 sunrpc/svcauth_des.c | 13 +++++++++----
 6 files changed, 38 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 23675e75de..fa0394cdce 100644
--- 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]
diff --git a/NEWS b/NEWS
index f82b94f53d..57f6714d89 100644
--- a/NEWS
+++ b/NEWS
@@ -47,6 +47,7 @@ The following bugs are resolved with this release:
   [23137] s390: pthread_join sometimes block indefinitely (on 31bit and libc
     build with -Os)
   [23152] gd_GB: Fix typo in "May" (abbreviated)
+  [23166] sunrpc: Remove stray exports without --enable-obsolete-rpc
 
 \f
 Version 2.27
diff --git a/include/rpc/clnt.h b/include/rpc/clnt.h
index a397023a93..80be0a9cec 100644
--- a/include/rpc/clnt.h
+++ b/include/rpc/clnt.h
@@ -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
diff --git a/include/rpc/svc.h b/include/rpc/svc.h
index 465bf4427d..40ba2546a9 100644
--- a/include/rpc/svc.h
+++ b/include/rpc/svc.h
@@ -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)
diff --git a/sunrpc/rpc_common.c b/sunrpc/rpc_common.c
index 710191163c..2d42827a87 100644
--- a/sunrpc/rpc_common.c
+++ b/sunrpc/rpc_common.c
@@ -46,7 +46,14 @@
    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)
diff --git a/sunrpc/svcauth_des.c b/sunrpc/svcauth_des.c
index f99a5a324f..9ce4804239 100644
--- a/sunrpc/svcauth_des.c
+++ b/sunrpc/svcauth_des.c
@@ -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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-28  0:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-28  0:38 [glibc/google/grte/v5-2.27/master] sunrpc: Remove stray exports without --enable-obsolete-rpc [BZ #23166] Fangrui Song

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).