From patchwork Fri Jan 16 23:46:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roland McGrath X-Patchwork-Id: 430071 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 8152E1401DA for ; Sat, 17 Jan 2015 10:47:03 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:content-type :content-transfer-encoding:from:to:subject:message-id:date; q= dns; s=default; b=rBFk3tVGAAj+3CuwY7uC0T1KBxOW2Ufq5l2SlncMSzGNLk RjCDURLrV1C94u4vjU8hm02ugFyczfROQpoY+0PoNM0BIyaPC+zIaYhJLAp7CPxR uW922ZpzrNlTb0FNZbO9n0TmTe1+SEzlqBEggPJ1WKxrEIjONohYccRqpFqXQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:content-type :content-transfer-encoding:from:to:subject:message-id:date; s= default; bh=jDvR+EP4CL8vMaurCe1O/pgKMMc=; b=HTjaOGGtttco1P9cqPvS th/jPaei+jVpNeY1DJvSeRTUdWUl1tl34/Bg+HyKMabFrbxxY4sqqj2ooOjRVyyG FO8MfE5kB5/jGxBryvz7/1rD/0VcpXzexKKmQEwCIXUZDKwvr0/UN2GJ4GFXX9ch UDFhSL2gypZG3RsuNTvW3PY= Received: (qmail 24903 invoked by alias); 16 Jan 2015 23:46:57 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 24893 invoked by uid 89); 16 Jan 2015 23:46:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: topped-with-meat.com MIME-Version: 1.0 From: Roland McGrath To: "GNU C. Library" Subject: [PATCH roland/sunrpc] Exclude rpcent functions and NSS backends for rpc, key when excluding sunrpc. Message-Id: <20150116234650.3CDF42C39DB@topped-with-meat.com> Date: Fri, 16 Jan 2015 15:46:50 -0800 (PST) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=SvUDtp+0 c=1 sm=1 tr=0 a=WkljmVdYkabdwxfqvArNOQ==:117 a=14OXPxybAAAA:8 a=kj9zAlcOel0A:10 a=hOe2yjtxAAAA:8 a=pyvhPjrkZk3Yb4uLcDYA:9 a=CjuIK1q_8ugA:10 The rpcent functions (from ) are useless in a C library that does not include sunrpc support. The getpublickey function was already excluded, but its NSS backends were not. This change just moves around and conditionalizes the code so that those are left out when sunrpc is also left out entirely. It has no effect on existing configurations, which still build in sunrpc. A future follow-on change that should be made eventually is to make the rpcent functions unlinkable like the rest of sunrpc, when compiling a compat configuration without --enable-obsolete-rpc. Tested with 'make check-abi' on i686-linux-gnu and x86_64-linux-gnu. If nobody objects, I'll commit this on Tuesday. Thanks, Roland * inet/Versions (libc: GLIBC_2.0): Move getrpcbyname, getrpcbyname_r, getrpcbynumber, getrpcbynumber_r, getrpcent, getrpcent_r, endrpcent, setrpcent, and getrpcport to ... * sunrpc/Versions (libc: GLIBC_2.0): ... here. * inet/Versions (libc: GLIBC_2.1.2): Move getrpcbyname_r, getrpcbynumber_r, and getrpcent_r to ... * sunrpc/Versions (libc: GLIBC_2.1.2): ... this new set. * inet/getrpcbyname.c: Moved ... * sunrpc/getrpcbyname.c: ... here. * inet/getrpcbyname_r.c: Moved ... * sunrpc/getrpcbyname_r.c: ... here. * inet/getrpcbynumber.c: Moved ... * sunrpc/getrpcbynumber.c: ... here. * inet/getrpcbynumber_r.c: Moved ... * sunrpc/getrpcbynumber_r.c: ... here. * inet/getrpcent.c: Moved ... * sunrpc/getrpcent.c: ... here. * inet/getrpcent_r.c: Moved ... * sunrpc/getrpcent_r.c: ... here. * inet/Makefile (routines): Move those to ... * sunrpc/Makefile (routines): ... here. * nss/Makefile (databases): Add key and rpc only if sunrpc appears in the $(subdirs) list. diff --git a/inet/Makefile b/inet/Makefile index 267f060..f1d871f 100644 --- a/inet/Makefile +++ b/inet/Makefile @@ -37,8 +37,6 @@ routines := htonl htons \ getproto getproto_r getprtent getprtent_r getprtname getprtname_r \ getsrvbynm getsrvbynm_r getsrvbypt getsrvbypt_r getservent \ getservent_r \ - getrpcent getrpcbyname getrpcbynumber \ - getrpcent_r getrpcbyname_r getrpcbynumber_r \ ether_aton ether_aton_r ether_hton ether_line \ ether_ntoa ether_ntoa_r ether_ntoh \ rcmd rexec ruserpass \ diff --git a/inet/Versions b/inet/Versions index 0650719..56eb274 100644 --- a/inet/Versions +++ b/inet/Versions @@ -7,8 +7,7 @@ libc { rexecoptions; # e* - endaliasent; endhostent; endnetent; endnetgrent; endprotoent; endrpcent; - endservent; + endaliasent; endhostent; endnetent; endnetgrent; endprotoent; endservent; # e* ether_aton; ether_aton_r; ether_hostton; ether_line; ether_ntoa; @@ -21,9 +20,8 @@ libc { gethostent_r; getnetbyaddr; getnetbyaddr_r; getnetbyname; getnetbyname_r; getnetent; getnetent_r; getnetgrent; getnetgrent_r; getprotobyname; getprotobyname_r; getprotobynumber; - getprotobynumber_r; getprotoent; getprotoent_r; getrpcbyname; - getrpcbyname_r; getrpcbynumber; getrpcbynumber_r; getrpcent; getrpcent_r; - getrpcport; getservbyname; getservbyname_r; getservbyport; + getprotobynumber_r; getprotoent; getprotoent_r; + getservbyname; getservbyname_r; getservbyport; getservbyport_r; getservent; getservent_r; # h* @@ -41,7 +39,7 @@ libc { rcmd; rexec; rresvport; ruserok; ruserpass; # s* - setaliasent; setnetent; setnetgrent; setprotoent; setrpcent; setservent; + setaliasent; setnetent; setnetgrent; setprotoent; setservent; } GLIBC_2.1 { # variables in normal name space @@ -55,8 +53,7 @@ libc { getaliasbyname_r; getaliasent_r; gethostbyaddr_r; gethostbyname2_r; gethostbyname_r; gethostent_r; getnetbyaddr_r; getnetbyname_r; getnetent_r; getnetgrent_r; getprotobyname_r; getprotobynumber_r; - getprotoent_r; getrpcbyname_r; getrpcbynumber_r; getrpcent_r; - getservbyname_r; + getprotoent_r; getservbyname_r; } GLIBC_2.2 { # i* diff --git a/nss/Makefile b/nss/Makefile index d419baf..f94ef92 100644 --- a/nss/Makefile +++ b/nss/Makefile @@ -31,8 +31,12 @@ routines = nsswitch getnssent getnssent_r digits_dots \ # These are the databases that go through nss dispatch. # Caution: if you add a database here, you must add its real name # in databases.def, too. -databases = proto service hosts network grp pwd rpc ethers \ - spwd netgrp key alias sgrp +databases = proto service hosts network grp pwd ethers \ + spwd netgrp alias sgrp + +ifneq (,$(filter sunrpc,$(subdirs))) +databases += key rpc +endif others := getent makedb install-bin := getent makedb diff --git a/sunrpc/Makefile b/sunrpc/Makefile index b65f2f5..c29f4a9 100644 --- a/sunrpc/Makefile +++ b/sunrpc/Makefile @@ -76,6 +76,8 @@ routines := auth_none authuxprot bindrsvprt clnt_raw clnt_simp \ pmap_rmt rpc_prot rpc_common rpc_cmsg svc_auth svc_authux svc_raw \ svc_simple xdr_float xdr_rec publickey authdes_prot \ des_crypt des_impl des_soft key_prot openchild rtime svcauth_des \ + getrpcent getrpcbyname getrpcbynumber \ + getrpcent_r getrpcbyname_r getrpcbynumber_r \ clnt_unix svc_unix create_xid $(need-export-routines) ifneq ($(link-obsolete-rpc),yes) # We only add the RPC for compatibility to libc.so. diff --git a/sunrpc/Versions b/sunrpc/Versions index a11dd8d..77bc6a4 100644 --- a/sunrpc/Versions +++ b/sunrpc/Versions @@ -21,8 +21,13 @@ libc { clnt_perror; clnt_spcreateerror; clnt_sperrno; clnt_sperror; clntraw_create; clnttcp_create; clntudp_bufcreate; clntudp_create; + # e* + endrpcent; + # g* get_myaddress; getpublickey; getsecretkey; + getrpcbyname; getrpcbyname_r; getrpcbynumber; getrpcbynumber_r; + getrpcent; getrpcent_r; getrpcport; # p* pmap_getmaps; pmap_getport; pmap_rmtcall; pmap_set; pmap_unset; @@ -31,6 +36,7 @@ libc { registerrpc; # s* + setrpcent; svc_exit; svc_getreq; svc_getreqset; svc_register; svc_run; svc_sendreply; svc_unregister; svcerr_auth; svcerr_decode; svcerr_noproc; svcerr_noprog; svcerr_progvers; svcerr_systemerr; @@ -106,6 +112,9 @@ libc { xdr_hyper; xdr_u_hyper; xdr_longlong_t; xdr_u_longlong_t; xdr_int64_t; xdr_uint64_t; } + GLIBC_2.1.2 { + getrpcbyname_r; getrpcbynumber_r; getrpcent_r; + } GLIBC_2.2 { svc_getreq_common; svc_getreq_poll; svc_max_pollfd; svc_pollfd; } diff --git a/inet/getrpcbyname.c b/sunrpc/getrpcbyname.c similarity index 100% rename from inet/getrpcbyname.c rename to sunrpc/getrpcbyname.c diff --git a/inet/getrpcbyname_r.c b/sunrpc/getrpcbyname_r.c similarity index 100% rename from inet/getrpcbyname_r.c rename to sunrpc/getrpcbyname_r.c diff --git a/inet/getrpcbynumber.c b/sunrpc/getrpcbynumber.c similarity index 100% rename from inet/getrpcbynumber.c rename to sunrpc/getrpcbynumber.c diff --git a/inet/getrpcbynumber_r.c b/sunrpc/getrpcbynumber_r.c similarity index 100% rename from inet/getrpcbynumber_r.c rename to sunrpc/getrpcbynumber_r.c diff --git a/inet/getrpcent.c b/sunrpc/getrpcent.c similarity index 100% rename from inet/getrpcent.c rename to sunrpc/getrpcent.c diff --git a/inet/getrpcent_r.c b/sunrpc/getrpcent_r.c similarity index 100% rename from inet/getrpcent_r.c rename to sunrpc/getrpcent_r.c