diff options
author | Florian Weimer <fweimer@redhat.com> | 2020-07-08 12:15:23 +0200 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2020-07-08 17:25:57 +0200 |
commit | acb527929d0c2b3bb0798472c42ddb3203729708 (patch) | |
tree | 811e3dccd989b71c1e44b18e9e790538725d2c29 /sunrpc | |
parent | a2a83bf6d9f1d4d297c5378f0fda0d8f85bc75f2 (diff) | |
download | glibc-acb527929d0c2b3bb0798472c42ddb3203729708.tar.gz glibc-acb527929d0c2b3bb0798472c42ddb3203729708.tar.xz glibc-acb527929d0c2b3bb0798472c42ddb3203729708.zip |
Move non-deprecated RPC-related functions from sunrpc to inet
This includes bindresvport and the NSS-related RPC functions. This will simplify the removal of the sunrpc functionality because these functions no longer have to be treated specially.
Diffstat (limited to 'sunrpc')
-rw-r--r-- | sunrpc/Makefile | 9 | ||||
-rw-r--r-- | sunrpc/bindrsvprt.c | 110 | ||||
-rw-r--r-- | sunrpc/etc.rpc | 70 | ||||
-rw-r--r-- | sunrpc/getrpcbyname.c | 32 | ||||
-rw-r--r-- | sunrpc/getrpcbyname_r.c | 31 | ||||
-rw-r--r-- | sunrpc/getrpcbynumber.c | 32 | ||||
-rw-r--r-- | sunrpc/getrpcbynumber_r.c | 31 | ||||
-rw-r--r-- | sunrpc/getrpcent.c | 28 | ||||
-rw-r--r-- | sunrpc/getrpcent_r.c | 32 |
9 files changed, 1 insertions, 374 deletions
diff --git a/sunrpc/Makefile b/sunrpc/Makefile index d5840d0770..2d1861f3dc 100644 --- a/sunrpc/Makefile +++ b/sunrpc/Makefile @@ -32,7 +32,6 @@ include ../Makeconfig # file name limits: # # authunix_prot.c -> authuxprot.c -# bindresvport.c -> bindrsvprt.c # clnt_generic.c -> clnt_gen.c # clnt_perror.c -> clnt_perr.c # clnt_simple.c -> clnt_simp.c @@ -54,7 +53,6 @@ headers-sunrpc = $(addprefix rpc/,auth.h auth_unix.h clnt.h pmap_clnt.h \ key_prot.h) \ $(rpcsvc:%=rpcsvc/%) rpcsvc/bootparam.h headers = rpc/netdb.h -install-others = $(inst_sysconfdir)/rpc generated += $(rpcsvc:%.x=rpcsvc/%.h) $(rpcsvc:%.x=x%.c) $(rpcsvc:%.x=x%.stmp) \ $(rpcsvc:%.x=rpcsvc/%.stmp) rpcgen generated-dirs += rpcsvc @@ -70,13 +68,11 @@ need-export-routines := auth_des auth_unix clnt_gen clnt_perr clnt_tcp \ xdr_intXX_t xdr_mem xdr_ref xdr_sizeof xdr_stdio \ svc_run -routines := auth_none authuxprot bindrsvprt clnt_raw clnt_simp \ +routines := auth_none authuxprot clnt_raw clnt_simp \ rpc_dtable getrpcport pmap_clnt pm_getmaps pmap_prot pmap_prot2 \ 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) \ rpc_gethostbyname ifneq ($(link-obsolete-rpc),yes) @@ -188,9 +184,6 @@ include $(patsubst %,$(..)libof-iterator.mk,$(cpp-srcs-left)) # binary be the second dependency listed in each rule using rpcgen-cmd. rpcgen-cmd = CPP='$(CC) -E -x c-header' $(built-program-file) -Y ../scripts -# Install the rpc data base file. -$(inst_sysconfdir)/rpc: etc.rpc $(+force) - $(do-install) # Generate the rpcsvc headers with rpcgen. # We use a stamp file to avoid unnessary recompilation each time rpcgen is diff --git a/sunrpc/bindrsvprt.c b/sunrpc/bindrsvprt.c deleted file mode 100644 index da33c05101..0000000000 --- a/sunrpc/bindrsvprt.c +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 2010, Oracle America, Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * * Neither the name of the "Oracle America, Inc." nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include <errno.h> -#include <unistd.h> -#include <string.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <netinet/in.h> -#include <libc-lock.h> - -/* - * Locks the static variables in this file. - */ -__libc_lock_define_initialized (static, lock); - -/* - * Bind a socket to a privileged IP port - */ -int -bindresvport (int sd, struct sockaddr_in *sin) -{ - static short port; - struct sockaddr_in myaddr; - int i; - -#define STARTPORT 600 -#define LOWPORT 512 -#define ENDPORT (IPPORT_RESERVED - 1) -#define NPORTS (ENDPORT - STARTPORT + 1) - static short startport = STARTPORT; - - if (sin == (struct sockaddr_in *) 0) - { - sin = &myaddr; - memset (sin, 0, sizeof (*sin)); - sin->sin_family = AF_INET; - } - else if (sin->sin_family != AF_INET) - { - __set_errno (EAFNOSUPPORT); - return -1; - } - - if (port == 0) - { - port = (__getpid () % NPORTS) + STARTPORT; - } - - /* Initialize to make gcc happy. */ - int res = -1; - - int nports = ENDPORT - startport + 1; - int endport = ENDPORT; - - __libc_lock_lock (lock); - - again: - for (i = 0; i < nports; ++i) - { - sin->sin_port = htons (port++); - if (port > endport) - port = startport; - res = __bind (sd, sin, sizeof (struct sockaddr_in)); - if (res >= 0 || errno != EADDRINUSE) - break; - } - - if (i == nports && startport != LOWPORT) - { - startport = LOWPORT; - endport = STARTPORT - 1; - nports = STARTPORT - LOWPORT; - port = LOWPORT + port % (STARTPORT - LOWPORT); - goto again; - } - - __libc_lock_unlock (lock); - - return res; -} -libc_hidden_def (bindresvport) diff --git a/sunrpc/etc.rpc b/sunrpc/etc.rpc deleted file mode 100644 index e099ebb289..0000000000 --- a/sunrpc/etc.rpc +++ /dev/null @@ -1,70 +0,0 @@ -#ident "@(#)rpc 1.11 95/07/14 SMI" /* SVr4.0 1.2 */ -# -# rpc -# -portmapper 100000 portmap sunrpc rpcbind -rstatd 100001 rstat rup perfmeter rstat_svc -rusersd 100002 rusers -nfs 100003 nfsprog -ypserv 100004 ypprog -mountd 100005 mount showmount -ypbind 100007 -walld 100008 rwall shutdown -yppasswdd 100009 yppasswd -etherstatd 100010 etherstat -rquotad 100011 rquotaprog quota rquota -sprayd 100012 spray -3270_mapper 100013 -rje_mapper 100014 -selection_svc 100015 selnsvc -database_svc 100016 -rexd 100017 rex -alis 100018 -sched 100019 -llockmgr 100020 -nlockmgr 100021 -x25.inr 100022 -statmon 100023 -status 100024 -bootparam 100026 -ypupdated 100028 ypupdate -keyserv 100029 keyserver -sunlink_mapper 100033 -tfsd 100037 -nsed 100038 -nsemntd 100039 -showfhd 100043 showfh -ioadmd 100055 rpc.ioadmd -NETlicense 100062 -sunisamd 100065 -debug_svc 100066 dbsrv -ypxfrd 100069 rpc.ypxfrd -bugtraqd 100071 -kerbd 100078 -event 100101 na.event # SunNet Manager -logger 100102 na.logger # SunNet Manager -sync 100104 na.sync -hostperf 100107 na.hostperf -activity 100109 na.activity # SunNet Manager -hostmem 100112 na.hostmem -sample 100113 na.sample -x25 100114 na.x25 -ping 100115 na.ping -rpcnfs 100116 na.rpcnfs -hostif 100117 na.hostif -etherif 100118 na.etherif -iproutes 100120 na.iproutes -layers 100121 na.layers -snmp 100122 na.snmp snmp-cmc snmp-synoptics snmp-unisys snmp-utk -traffic 100123 na.traffic -nfs_acl 100227 -sadmind 100232 -nisd 100300 rpc.nisd -nispasswd 100303 rpc.nispasswdd -ufsd 100233 ufsd -fedfs_admin 100418 -pcnfsd 150001 pcnfs -amd 300019 amq -sgi_fam 391002 fam -bwnfsd 545580417 -fypxfrd 600100069 freebsd-ypxfrd diff --git a/sunrpc/getrpcbyname.c b/sunrpc/getrpcbyname.c deleted file mode 100644 index c82d121c30..0000000000 --- a/sunrpc/getrpcbyname.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (C) 1996-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <https://www.gnu.org/licenses/>. */ - -#include <rpc/netdb.h> - - -#define LOOKUP_TYPE struct rpcent -#define FUNCTION_NAME getrpcbyname -#define DATABASE_NAME rpc -#define ADD_PARAMS const char *name -#define ADD_VARIABLES name -#define BUFLEN 1024 - -/* There is no nscd support for the rpc file. */ -#undef USE_NSCD - -#include "../nss/getXXbyYY.c" diff --git a/sunrpc/getrpcbyname_r.c b/sunrpc/getrpcbyname_r.c deleted file mode 100644 index d87639a3cd..0000000000 --- a/sunrpc/getrpcbyname_r.c +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright (C) 1996-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <https://www.gnu.org/licenses/>. */ - -#include <rpc/netdb.h> - - -#define LOOKUP_TYPE struct rpcent -#define FUNCTION_NAME getrpcbyname -#define DATABASE_NAME rpc -#define ADD_PARAMS const char *name -#define ADD_VARIABLES name - -/* There is no nscd support for the rpc file. */ -#undef USE_NSCD - -#include "../nss/getXXbyYY_r.c" diff --git a/sunrpc/getrpcbynumber.c b/sunrpc/getrpcbynumber.c deleted file mode 100644 index 8eced2e422..0000000000 --- a/sunrpc/getrpcbynumber.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (C) 1996-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <https://www.gnu.org/licenses/>. */ - -#include <rpc/netdb.h> - - -#define LOOKUP_TYPE struct rpcent -#define FUNCTION_NAME getrpcbynumber -#define DATABASE_NAME rpc -#define ADD_PARAMS int number -#define ADD_VARIABLES number -#define BUFLEN 1024 - -/* There is no nscd support for the rpc file. */ -#undef USE_NSCD - -#include "../nss/getXXbyYY.c" diff --git a/sunrpc/getrpcbynumber_r.c b/sunrpc/getrpcbynumber_r.c deleted file mode 100644 index d10f2636b0..0000000000 --- a/sunrpc/getrpcbynumber_r.c +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright (C) 1996-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <https://www.gnu.org/licenses/>. */ - -#include <rpc/netdb.h> - - -#define LOOKUP_TYPE struct rpcent -#define FUNCTION_NAME getrpcbynumber -#define DATABASE_NAME rpc -#define ADD_PARAMS int number -#define ADD_VARIABLES number - -/* There is no nscd support for the rpc file. */ -#undef USE_NSCD - -#include "../nss/getXXbyYY_r.c" diff --git a/sunrpc/getrpcent.c b/sunrpc/getrpcent.c deleted file mode 100644 index 16b1c32d4c..0000000000 --- a/sunrpc/getrpcent.c +++ /dev/null @@ -1,28 +0,0 @@ -/* Copyright (C) 1996-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <https://www.gnu.org/licenses/>. */ - -#include <rpc/netdb.h> - - -#define LOOKUP_TYPE struct rpcent -#define GETFUNC_NAME getrpcent -#define BUFLEN 1024 - -/* There is no nscd support for the rpc file. */ -#undef USE_NSCD - -#include "../nss/getXXent.c" diff --git a/sunrpc/getrpcent_r.c b/sunrpc/getrpcent_r.c deleted file mode 100644 index 419b78c33c..0000000000 --- a/sunrpc/getrpcent_r.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (C) 1996-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <https://www.gnu.org/licenses/>. */ - -#include <netdb.h> - - -#define LOOKUP_TYPE struct rpcent -#define SETFUNC_NAME setrpcent -#define GETFUNC_NAME getrpcent -#define ENDFUNC_NAME endrpcent -#define DATABASE_NAME rpc -#define STAYOPEN int stayopen -#define STAYOPEN_VAR stayopen - -/* There is no nscd support for the rpc file. */ -#undef USE_NSCD - -#include "../nss/getXXent_r.c" |