From 498eb1c4b3707d3278fb242a1be49ee388c5952a7f293ede9fc92f2bd9d1da28 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Mon, 25 Aug 2008 02:58:08 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/rpcbind?expand=0&rev=1 --- .gitattributes | 23 ++++++ .gitignore | 1 + ready | 0 rpcbind-0.1.4-iff_up.patch | 12 ++++ rpcbind-0.1.4-localaddr.patch | 100 ++++++++++++++++++++++++++ rpcbind-0.1.5-1.tar.bz2 | 3 + rpcbind.changes | 27 +++++++ rpcbind.init | 84 ++++++++++++++++++++++ rpcbind.spec | 131 ++++++++++++++++++++++++++++++++++ rpcbind.xml | 93 ++++++++++++++++++++++++ sysconfig.rpcbind | 9 +++ 11 files changed, 483 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 ready create mode 100644 rpcbind-0.1.4-iff_up.patch create mode 100644 rpcbind-0.1.4-localaddr.patch create mode 100644 rpcbind-0.1.5-1.tar.bz2 create mode 100644 rpcbind.changes create mode 100644 rpcbind.init create mode 100644 rpcbind.spec create mode 100644 rpcbind.xml create mode 100644 sysconfig.rpcbind diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/ready b/ready new file mode 100644 index 0000000..473a0f4 diff --git a/rpcbind-0.1.4-iff_up.patch b/rpcbind-0.1.4-iff_up.patch new file mode 100644 index 0000000..134ac00 --- /dev/null +++ b/rpcbind-0.1.4-iff_up.patch @@ -0,0 +1,12 @@ +--- rpcbind-0.1.4/src/util.c.iff_up 2007-05-22 11:14:39.000000000 -0400 ++++ rpcbind-0.1.4/src/util.c 2007-05-22 11:14:56.000000000 -0400 +@@ -359,7 +359,8 @@ network_init() + * interface, join the RPC multicast group on that interface. + */ + for (ifap = ifp; ifap != NULL; ifap = ifap->ifa_next) { +- if (ifap->ifa_addr->sa_family != AF_INET6 || ++ if (!ifap->ifa_addr || ++ ifap->ifa_addr->sa_family != AF_INET6 || + !(ifap->ifa_flags & IFF_MULTICAST)) + continue; + ifindex = if_nametoindex(ifap->ifa_name); diff --git a/rpcbind-0.1.4-localaddr.patch b/rpcbind-0.1.4-localaddr.patch new file mode 100644 index 0000000..519dbff --- /dev/null +++ b/rpcbind-0.1.4-localaddr.patch @@ -0,0 +1,100 @@ +commit 913c1d3396ba57052054d6da0745b29f82ece4eb +Author: Steve Dickson +Date: Mon Dec 17 14:28:03 2007 -0500 + + Changed is_loopback() and check_access() see if the calling + address is an address on a local interface, just not a loopback + address. + + Signed-off-by: Steve Dickson + +diff --git a/src/security.c b/src/security.c +index 7e6f3a9..b1a2b76 100644 +--- a/src/security.c ++++ b/src/security.c +@@ -31,6 +31,7 @@ + + #ifdef LIBWRAP + # include ++# include + #ifndef LIBWRAP_ALLOW_FACILITY + # define LIBWRAP_ALLOW_FACILITY LOG_AUTH + #endif +@@ -61,6 +62,49 @@ int log_severity = PORTMAP_LOG_FACILITY|PORTMAP_LOG_SEVERITY; + + extern int verboselog; + ++#ifdef LIBWRAP ++static int localaddr(struct sockaddr *addr) ++{ ++ static struct ifaddrs *ifp = NULL; ++ struct ifaddrs *ifa = NULL; ++ void *caller, *localip; ++ struct sockaddr_in *sin; ++ struct sockaddr_in6 *sin6; ++ ++ if (ifp == NULL && getifaddrs (&ifp) < 0) { ++ perror ("getifaddrs"); ++ return 0; ++ } ++ ++ if (addr->sa_family == AF_INET) ++ caller = (void *)&((struct sockaddr_in *)addr)->sin_addr; ++ else ++ caller = (void *)&((struct sockaddr_in6 *)addr)->sin6_addr; ++ ++ for (ifa = ifp; ifa; ifa = ifa->ifa_next) { ++ socklen_t salen; ++ ++ if (ifa->ifa_addr == NULL) ++ continue; ++ ++ if (ifa->ifa_addr->sa_family == AF_INET) { ++ salen = sizeof (struct sockaddr_in); ++ sin = (struct sockaddr_in *)ifa->ifa_addr; ++ localip = (void *)&sin->sin_addr; ++ } else if (ifa->ifa_addr->sa_family == AF_INET6) { ++ sin6 = (struct sockaddr_in6 *)ifa->ifa_addr; ++ localip = (void *)&sin6->sin6_addr; ++ } else ++ continue; ++ ++ if (memcmp(localip, caller, salen) == 0) ++ return 1; ++ } ++ ++ return 0; ++} ++#endif ++ + int + check_access(SVCXPRT *xprt, rpcproc_t proc, void *args, unsigned int rpcbvers) + { +@@ -115,7 +159,7 @@ check_access(SVCXPRT *xprt, rpcproc_t proc, void *args, unsigned int rpcbvers) + } + + #ifdef LIBWRAP +- if (addr->sa_family == AF_LOCAL) ++ if (addr->sa_family == AF_LOCAL || localaddr(addr)) + return 1; + request_init(&req, RQ_DAEMON, "rpcbind", RQ_CLIENT_SIN, addr, 0); + sock_methods(&req); +@@ -147,13 +191,17 @@ is_loopback(struct netbuf *nbuf) + case AF_INET: + if (!oldstyle_local) + return 0; ++ if (localaddr(addr)) ++ return 1; + sin = (struct sockaddr_in *)addr; +- return ((sin->sin_addr.s_addr == htonl(INADDR_LOOPBACK)) && ++ return ((sin->sin_addr.s_addr == htonl(INADDR_LOOPBACK)) && + (ntohs(sin->sin_port) < IPPORT_RESERVED)); + #ifdef INET6 + case AF_INET6: + if (!oldstyle_local) + return 0; ++ if (localaddr(addr)) ++ return 1; + sin6 = (struct sockaddr_in6 *)addr; + return ((IN6_IS_ADDR_LOOPBACK(&sin6->sin6_addr) || + (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr) && diff --git a/rpcbind-0.1.5-1.tar.bz2 b/rpcbind-0.1.5-1.tar.bz2 new file mode 100644 index 0000000..9e07575 --- /dev/null +++ b/rpcbind-0.1.5-1.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cdfb3dfda8e8e2fee33a172a88fa9a0ec9194286ddf054f1484cbcffdb59d366 +size 265920 diff --git a/rpcbind.changes b/rpcbind.changes new file mode 100644 index 0000000..e94ddbd --- /dev/null +++ b/rpcbind.changes @@ -0,0 +1,27 @@ +------------------------------------------------------------------- +Mon Aug 18 17:41:18 CEST 2008 - mkoenig@suse.de + +- use version in Provides/Obsoletes + +------------------------------------------------------------------- +Fri Jul 18 15:54:26 CEST 2008 - mkoenig@suse.de + +- update to version 0.1.5 +- license change to BSD-3 +- patches merged + rpcbind-0.1.4-compile.patch + rpcbind-0.1.4-debug.patch + rpcbind-0.1.4-libwrap.patch + rpcbind-0.1.4-recvfrom-fix.patch + rpcbind-0.1.4-rpcuser.patch + rpcbind-0.1.4-warmstarts-cleanup.patch + rpcbind-0.1.4-warmstarts.patch + +------------------------------------------------------------------- +Wed Apr 2 14:21:49 CEST 2008 - mkoenig@suse.de + +- initial packaging, version 0.1.4 [fate#300607] +- add patches from Steve Dickson, including fixes and + support for debug and warmstart +- build as PIE + diff --git a/rpcbind.init b/rpcbind.init new file mode 100644 index 0000000..f1e4ed6 --- /dev/null +++ b/rpcbind.init @@ -0,0 +1,84 @@ +#!/bin/sh +# +### BEGIN INIT INFO +# Provides: portmap rpcbind +# Required-Start: $network $syslog +# Required-Stop: $network $syslog +# Default-Start: 3 5 +# Default-Stop: 0 1 2 4 6 +# Short-Description: TI-RPC program number mapper +# Description: TI-RPC program number mapper +### END INIT INFO +# +RPCBIND_BIN=/sbin/rpcbind +test -x $RPCBIND_BIN || { echo "$RPCBIND_BIN not installed"; + if [ "$1" = "stop" ]; then exit 0; + else exit 5; fi; } + +. /etc/sysconfig/rpcbind + +. /etc/rc.status + +# Reset status of this service +rc_reset + +case "$1" in + start) + echo -n "Starting rpcbind " + /sbin/startproc $RPCBIND_BIN $OPTIONS $RPCBIND_OPTIONS + + rc_status -v + ;; + stop) + echo -n "Shutting down rpcbind " + + /sbin/killproc -TERM $RPCBIND_BIN + + rc_status -v + ;; + try-restart|condrestart) + ## Do a restart only if the service was active before. + ## Note: try-restart is now part of LSB (as of 1.9). + ## RH has a similar command named condrestart. + if test "$1" = "condrestart"; then + echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}" + fi + $0 status + if test $? = 0; then + # do a warmstart in this case, keeping the state + OPTIONS="-w" $0 restart + else + rc_reset # Not running is not a failure. + fi + # Remember status and be quiet + rc_status + ;; + restart) + ## Stop the service and regardless of whether it was + ## running or not, start it again. + $0 stop + $0 start + + rc_status + ;; + force-reload) + $0 try-restart + rc_status + ;; + reload) + # rpcbind does not support reload on signal + rc_failed 3 + rc_status -v + ;; + status) + echo -n "Checking for service rpcbind " + /sbin/checkproc $RPCBIND_BIN + + rc_status -v + ;; + *) + echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}" + exit 1 + ;; +esac +rc_exit diff --git a/rpcbind.spec b/rpcbind.spec new file mode 100644 index 0000000..0dc8c24 --- /dev/null +++ b/rpcbind.spec @@ -0,0 +1,131 @@ +# +# spec file for package rpcbind (Version 0.1.5) +# +# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# + +# norootforbuild + +BuildRequires: libtirpc-devel tcpd-devel + +Name: rpcbind +License: BSD 3-Clause +Group: Productivity/Networking/System +AutoReqProv: on +Version: 0.1.5 +Release: 2 +Summary: Transport independent RPC portmapper +Url: http://nfsv4.bullopensource.org/doc/tirpc_rpcbind.php +Source: %{name}-%{version}-1.tar.bz2 +Source1: rpcbind.init +Source2: sysconfig.rpcbind +Source3: rpcbind.xml +Patch4: rpcbind-0.1.4-iff_up.patch +Patch6: rpcbind-0.1.4-localaddr.patch +BuildRoot: %{_tmppath}/%{name}-%{version}-build +Provides: portmap = 6.0+git20070716 +Obsoletes: portmap < 6.0+git20070716 +PreReq: %insserv_prereq %fillup_prereq + +%description +Rpcbind is a replacement for portmap. Whereas portmap supports only UDP +and TCP transports over INET (IPv4), rpcbind can be configured to work +on various transports supported by the TI-RPC. This includes TCP and +UDP over IPv6. Moreover, rpcbind provides additional functions in +regards to portmap. + + + +Authors: +-------- + Gilles Quillard + Vincent ROQUETA + +%prep +%setup -n rpcbind-0.1.5-1 +%patch4 -p1 +%patch6 -p1 + +%build +autoreconf -fi +./configure --prefix=%{_prefix} \ + --bindir=/sbin \ + --mandir=%{_mandir} \ + --localstatedir=%{_localstatedir} \ + --enable-libwrap \ + --enable-warmstarts \ + --with-statedir=%{_localstatedir}/lib/rpcbind \ + --enable-debug \ + CFLAGS="$RPM_OPT_FLAGS -fpie" \ + LDFLAGS="-pie" +make + +%install +make install DESTDIR=$RPM_BUILD_ROOT +mkdir -p $RPM_BUILD_ROOT/etc/init.d/ +install -m 755 %{SOURCE1} $RPM_BUILD_ROOT/etc/init.d/rpcbind +ln -s /etc/init.d/rpcbind $RPM_BUILD_ROOT/sbin/rcrpcbind +mkdir -p $RPM_BUILD_ROOT%_localstatedir/lib/rpcbind +# for now remove this man page since it conflicts with glibc +rm -f $RPM_BUILD_ROOT%{_mandir}/man8/rpcinfo.8 +# fillup template +mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates +install -m 644 %{SOURCE2} $RPM_BUILD_ROOT/var/adm/fillup-templates/ +mkdir -p $RPM_BUILD_ROOT%_datadir/omc/svcinfo.d +install -m 644 %{SOURCE3} $RPM_BUILD_ROOT%_datadir/omc/svcinfo.d/ + +%clean +rm -rf $RPM_BUILD_ROOT + +%preun +%stop_on_removal rpcbind + +%post +%fillup_and_insserv -y rpcbind + +%postun +%restart_on_update rpcbind +%insserv_cleanup + +%files +%defattr(-,root,root) +%doc AUTHORS ChangeLog COPYING NEWS README +/sbin/rpcbind +/sbin/rpcinfo +%doc %{_mandir}/*/* +%config /etc/init.d/rpcbind +/sbin/rcrpcbind +%{_localstatedir}/lib/rpcbind +/var/adm/fillup-templates/sysconfig.rpcbind +%{_datadir}/omc/svcinfo.d/rpcbind.xml + +%changelog +* Mon Aug 18 2008 mkoenig@suse.de +- use version in Provides/Obsoletes +* Fri Jul 18 2008 mkoenig@suse.de +- update to version 0.1.5 +- license change to BSD-3 +- patches merged + rpcbind-0.1.4-compile.patch + rpcbind-0.1.4-debug.patch + rpcbind-0.1.4-libwrap.patch + rpcbind-0.1.4-recvfrom-fix.patch + rpcbind-0.1.4-rpcuser.patch + rpcbind-0.1.4-warmstarts-cleanup.patch + rpcbind-0.1.4-warmstarts.patch +* Wed Apr 02 2008 mkoenig@suse.de +- initial packaging, version 0.1.4 [fate#300607] +- add patches from Steve Dickson, including fixes and + support for debug and warmstart +- build as PIE diff --git a/rpcbind.xml b/rpcbind.xml new file mode 100644 index 0000000..d5f7c52 --- /dev/null +++ b/rpcbind.xml @@ -0,0 +1,93 @@ + + + + + + + Rpcbind + + + + Transport independent RPC portmapping daemon + + + + + /sbin/rcrpcbind start + + + /sbin/rcrpcbind restart + + + /sbin/rcrpcbind stop + + + /sbin/rcrpcbind status + + + + + rpcbind + /sbin/rpcbind + + + + + + + network + syslog + + + + + diff --git a/sysconfig.rpcbind b/sysconfig.rpcbind new file mode 100644 index 0000000..2d3023a --- /dev/null +++ b/sysconfig.rpcbind @@ -0,0 +1,9 @@ +## Path: Network/RPC/Rpcbind +## Description: Rpcbind startup options +## Type: string +## Default: "" +# +# Startup options for rpcbind +# +RPCBIND_OPTIONS="" +