[3/4] sunrpc: Do not export getrpcport by default

Message ID 881da15729e93f2b8a8a80c0386b5759a8093b30.1594062056.git.fweimer@redhat.com
State New
Headers show
Series
  • sunrpc symbol cleanups
Related show

Commit Message

Alejandro Colomar via Libc-alpha July 6, 2020, 7:03 p.m.
This function looks like an NSS function, but is actually a wrapper
around pmap_getport, so it should only be exported with
--enable-obsolete-rpc.
---
 sunrpc/getrpcport.c | 5 +++++
 1 file changed, 5 insertions(+)

-- 
2.25.4

Comments

Alejandro Colomar via Libc-alpha July 6, 2020, 8:38 p.m. | #1
On Mon, Jul 6, 2020 at 12:06 PM Florian Weimer via Libc-alpha
<libc-alpha@sourceware.org> wrote:
>

> This function looks like an NSS function, but is actually a wrapper

> around pmap_getport, so it should only be exported with

> --enable-obsolete-rpc.

> ---

>  sunrpc/getrpcport.c | 5 +++++

>  1 file changed, 5 insertions(+)

>

> diff --git a/sunrpc/getrpcport.c b/sunrpc/getrpcport.c

> index 7d4b23865f..5dd635735c 100644

> --- a/sunrpc/getrpcport.c

> +++ b/sunrpc/getrpcport.c

> @@ -66,3 +66,8 @@ getrpcport (const char *host, u_long prognum, u_long versnum, u_int proto)

>      return 0;

>    return pmap_getport (&addr, prognum, versnum, proto);

>  }

> +#ifdef SHARED

> +# ifndef EXPORT_RPC_SYMBOLS

> +compat_symbol (libc, getrpcport, getrpcport, GLIBC_2_0);

> +# endif

> +#endif

> --

> 2.25.4

>

>


LGTM.

Thanks.

-- 
H.J.

Patch

diff --git a/sunrpc/getrpcport.c b/sunrpc/getrpcport.c
index 7d4b23865f..5dd635735c 100644
--- a/sunrpc/getrpcport.c
+++ b/sunrpc/getrpcport.c
@@ -66,3 +66,8 @@  getrpcport (const char *host, u_long prognum, u_long versnum, u_int proto)
     return 0;
   return pmap_getport (&addr, prognum, versnum, proto);
 }
+#ifdef SHARED
+# ifndef EXPORT_RPC_SYMBOLS
+compat_symbol (libc, getrpcport, getrpcport, GLIBC_2_0);
+# endif
+#endif