Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package rpcbind for openSUSE:Factory checked in at 2021-06-01 10:33:37 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rpcbind (Old) and /work/SRC/openSUSE:Factory/.rpcbind.new.1898 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rpcbind" Tue Jun 1 10:33:37 2021 rev:64 rq:895947 version:1.2.6 Changes: -------- --- /work/SRC/openSUSE:Factory/rpcbind/rpcbind.changes 2021-04-22 18:03:20.890449408 +0200 +++ /work/SRC/openSUSE:Factory/.rpcbind.new.1898/rpcbind.changes 2021-06-01 10:33:48.948440608 +0200 @@ -1,0 +2,10 @@ +Mon May 17 07:06:12 UTC 2021 - Petr Vorel <pvo...@suse.cz> + +- Update to rpcbind 1.2.6 +- Remove 0031-rpcbind-manpage.patch (accepted upstream in commit 4bedcee) +- Drop pmap_set.c (installed as pmap_set2): bnc#446388 is from 2008, for + openSUSE 11. +- Refresh 0001-change-lockingdir-to-run.patch +- Replace %setup with %autosetup + +------------------------------------------------------------------- Old: ---- 0031-rpcbind-manpage.patch pmap_set.c rpcbind-1.2.5.tar.bz2 New: ---- rpcbind-1.2.6.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rpcbind.spec ++++++ --- /var/tmp/diff_new_pack.smBs3g/_old 2021-06-01 10:33:49.392441364 +0200 +++ /var/tmp/diff_new_pack.smBs3g/_new 2021-06-01 10:33:49.392441364 +0200 @@ -21,7 +21,7 @@ %define _fillupdir %{_localstatedir}/adm/fillup-templates %endif Name: rpcbind -Version: 1.2.5 +Version: 1.2.6 Release: 0 Summary: Transport independent RPC portmapper # Git-Web: http://git.linux-nfs.org/?p=steved/rpcbind.git;a=summary @@ -30,11 +30,9 @@ URL: http://rpcbind.sourceforge.net Source: https://downloads.sourceforge.net/sourceforge/%{name}/%{name}-%{version}.tar.bz2 Source2: sysconfig.rpcbind -Source4: pmap_set.c Source5: rpc-user.conf Patch1: 0001-systemd-unit-files.patch Patch2: 0001-change-lockingdir-to-run.patch -Patch31: 0031-rpcbind-manpage.patch BuildRequires: libtirpc-devel >= 1.0.1 BuildRequires: libtool BuildRequires: pkgconfig @@ -58,11 +56,7 @@ regards to portmap. %prep -%setup -q -cp %{SOURCE4} . -%patch1 -p1 -%patch2 -p1 -%patch31 -p1 +%autosetup -p1 %build autoreconf -fiv @@ -80,7 +74,6 @@ --with-nss-modules="files usrfiles" make %{?_smp_mflags} -gcc -I/usr/include/tirpc -pie -fpie -fwhole-program -Wl,-z,relro,-z,now %{optflags} pmap_set.c -o pmap_set -ltirpc %sysusers_generate_pre %{SOURCE5} rpc %install @@ -91,8 +84,6 @@ # sysusers.d config mkdir -p %{buildroot}%{_sysusersdir} install -m 644 %{SOURCE5} %{buildroot}%{_sysusersdir}/ -# -install -m 755 pmap_set %{buildroot}/sbin/pmap_set2 # create symlink for rcrpcbind mkdir -p %{buildroot}/%{_sbindir} ln -s service %{buildroot}/%{_sbindir}/rc%{name} @@ -114,7 +105,6 @@ %files %license COPYING %doc AUTHORS README -/sbin/pmap_set2 /sbin/%{name} /bin/rpcinfo /sbin/rpcinfo ++++++ 0001-change-lockingdir-to-run.patch ++++++ --- /var/tmp/diff_new_pack.smBs3g/_old 2021-06-01 10:33:49.412441398 +0200 +++ /var/tmp/diff_new_pack.smBs3g/_new 2021-06-01 10:33:49.412441398 +0200 @@ -11,7 +11,7 @@ index cc848b1..65054ff 100644 --- a/src/rpcbind.c +++ b/src/rpcbind.c -@@ -106,7 +106,7 @@ char *nss_modules = "files"; +@@ -105,7 +105,7 @@ char *nss_modules = "files"; /* who to suid to if -s is given */ #define RUN_AS "daemon" ++++++ rpcbind-1.2.5.tar.bz2 -> rpcbind-1.2.6.tar.bz2 ++++++ ++++ 1664 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/rpcbind-1.2.5/README new/rpcbind-1.2.6/README --- old/rpcbind-1.2.5/README 2018-08-15 16:51:19.000000000 +0200 +++ new/rpcbind-1.2.6/README 2021-05-10 19:10:19.000000000 +0200 @@ -1,3 +1,5 @@ This release was a native source release from Sun. It has been ported from FreeBSD 5.2.1 to GNU/Linux in 2004. +Please send bug reports to: libtirpc-de...@lists.sourceforge.net +or linux-...@vger.kernel.org diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/rpcbind-1.2.5/compile new/rpcbind-1.2.6/compile --- old/rpcbind-1.2.5/compile 2018-08-15 17:00:32.000000000 +0200 +++ new/rpcbind-1.2.6/compile 2021-05-10 19:13:17.000000000 +0200 @@ -1,9 +1,9 @@ -#!/bin/sh +#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. -scriptversion=2016-01-11.22; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2017 Free Software Foundation, Inc. +# Copyright (C) 1999-2020 Free Software Foundation, Inc. # Written by Tom Tromey <tro...@cygnus.com>. # # This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <https://www.gnu.org/licenses/>. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -53,7 +53,7 @@ MINGW*) file_conv=mingw ;; - CYGWIN*) + CYGWIN* | MSYS*) file_conv=cygwin ;; *) @@ -67,7 +67,7 @@ mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; - cygwin/*) + cygwin/* | msys/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) @@ -340,7 +340,7 @@ # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/rpcbind-1.2.5/configure.ac new/rpcbind-1.2.6/configure.ac --- old/rpcbind-1.2.5/configure.ac 2018-08-15 16:51:19.000000000 +0200 +++ new/rpcbind-1.2.6/configure.ac 2021-05-10 19:10:19.000000000 +0200 @@ -1,4 +1,4 @@ -AC_INIT(rpcbind, 1.2.5) +AC_INIT(rpcbind, 1.2.6) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([src/rpcbind.c]) @@ -63,7 +63,7 @@ AC_SEARCH_LIBS([pthread_create], [pthread]) -AC_CHECK_HEADERS([nss.h rpcsvc/mount.h]) +AC_CHECK_HEADERS([nss.h]) # make sbindir available for substitution in config file # 2 "evals" needed to expand variable names diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/rpcbind-1.2.5/man/rpcbind.8 new/rpcbind-1.2.6/man/rpcbind.8 --- old/rpcbind-1.2.5/man/rpcbind.8 2018-08-15 16:51:19.000000000 +0200 +++ new/rpcbind-1.2.6/man/rpcbind.8 2021-05-10 19:10:19.000000000 +0200 @@ -86,9 +86,16 @@ Do not fork and become a background process. .It Fl h Specify specific IP addresses to bind to for UDP requests. -This option -may be specified multiple times and is typically necessary when running -on a multi-homed host. +This option may be specified multiple times and can be used to +restrict the interfaces rpcbind will respond to. +When specifying IP addresses with +.Fl h , +.Nm +will automatically add +.Li 127.0.0.1 +and if IPv6 is enabled, +.Li ::1 +to the list. If no .Fl h option is specified, @@ -99,14 +106,19 @@ .Nm returning a UDP packet from a different IP address than it was sent to. -Note that when specifying IP addresses with -.Fl h , +Note that when .Nm -will automatically add -.Li 127.0.0.1 -and if IPv6 is enabled, -.Li ::1 -to the list. +is controlled via systemd's socket activation, +the +.Fl h +option is ignored. In this case, you need to edit +the +.Nm ListenStream +and +.Nm ListenDgram +definitions in +.Nm /usr/lib/systemd/system/rpcbind.socket +instead. .It Fl i .Dq Insecure mode. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/rpcbind-1.2.5/missing new/rpcbind-1.2.6/missing --- old/rpcbind-1.2.5/missing 2018-08-15 17:00:32.000000000 +0200 +++ new/rpcbind-1.2.6/missing 2021-05-10 19:13:17.000000000 +0200 @@ -1,9 +1,9 @@ -#!/bin/sh +#! /bin/sh # Common wrapper for a few potentially missing GNU programs. -scriptversion=2016-01-11.22; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1996-2017 Free Software Foundation, Inc. +# Copyright (C) 1996-2020 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard <pin...@iro.umontreal.ca>, 1996. # This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <https://www.gnu.org/licenses/>. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -101,9 +101,9 @@ exit $st fi -perl_URL=http://www.perl.org/ -flex_URL=http://flex.sourceforge.net/ -gnu_software_URL=http://www.gnu.org/software +perl_URL=https://www.perl.org/ +flex_URL=https://github.com/westes/flex +gnu_software_URL=https://www.gnu.org/software program_details () { @@ -207,7 +207,7 @@ exit $st # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/rpcbind-1.2.5/src/pmap_svc.c new/rpcbind-1.2.6/src/pmap_svc.c --- old/rpcbind-1.2.5/src/pmap_svc.c 2018-08-15 16:51:19.000000000 +0200 +++ new/rpcbind-1.2.6/src/pmap_svc.c 2021-05-10 19:10:19.000000000 +0200 @@ -50,6 +50,7 @@ #include <sys/types.h> #include <sys/socket.h> #include <stdio.h> +#include <string.h> #include <rpc/rpc.h> #include <rpc/pmap_prot.h> #include <rpc/rpcb_prot.h> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/rpcbind-1.2.5/src/rpcb_stat.c new/rpcbind-1.2.6/src/rpcb_stat.c --- old/rpcbind-1.2.5/src/rpcb_stat.c 2018-08-15 16:51:19.000000000 +0200 +++ new/rpcbind-1.2.6/src/rpcb_stat.c 2021-05-10 19:10:19.000000000 +0200 @@ -151,7 +151,7 @@ rpcbs_rmtcalllist *rl; struct netconfig *nconf; - if (rtype > RPCBVERS_STAT) + if (rtype >= RPCBVERS_STAT) return; for (rl = inf[rtype].rmtinfo; rl; rl = rl->next) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/rpcbind-1.2.5/src/rpcb_svc_com.c new/rpcbind-1.2.6/src/rpcb_svc_com.c --- old/rpcbind-1.2.5/src/rpcb_svc_com.c 2018-08-15 16:51:19.000000000 +0200 +++ new/rpcbind-1.2.6/src/rpcb_svc_com.c 2021-05-10 19:10:19.000000000 +0200 @@ -42,7 +42,7 @@ #include <sys/types.h> #include <sys/stat.h> #include <sys/param.h> -#include <sys/poll.h> +#include <poll.h> #include <bits/poll.h> #include <sys/socket.h> #include <rpc/rpc.h> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/rpcbind-1.2.5/src/rpcbind.c new/rpcbind-1.2.6/src/rpcbind.c --- old/rpcbind-1.2.5/src/rpcbind.c 2018-08-15 16:51:19.000000000 +0200 +++ new/rpcbind-1.2.6/src/rpcbind.c 2021-05-10 19:10:19.000000000 +0200 @@ -42,11 +42,10 @@ #include <sys/types.h> #include <sys/stat.h> -#include <sys/errno.h> #include <sys/resource.h> #include <sys/wait.h> #include <sys/time.h> -#include <sys/signal.h> +#include <signal.h> #include <sys/file.h> #include <sys/socket.h> #include <sys/un.h> @@ -340,7 +339,7 @@ { int fd = -1; struct t_bind taddr; - struct addrinfo hints, *res; + struct addrinfo hints, *res = NULL; struct __rpc_sockinfo si; SVCXPRT *my_xprt = NULL; int status; /* bound checking ? */ @@ -506,7 +505,7 @@ hints.ai_flags |= AI_NUMERICHOST; } else { /* - * Skip if we have an AF_INET6 adress. + * Skip if we have an AF_INET6 address. */ if (inet_pton(AF_INET6, hosts[nhostsbak], host_addr) == 1) @@ -519,7 +518,7 @@ hints.ai_flags |= AI_NUMERICHOST; } else { /* - * Skip if we have an AF_INET adress. + * Skip if we have an AF_INET address. */ if (inet_pton(AF_INET, hosts[nhostsbak], host_addr) == 1) @@ -817,8 +816,12 @@ } #endif + if (res != NULL) + freeaddrinfo(res); return (0); error: + if (res != NULL) + freeaddrinfo(res); close(fd); return (1); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/rpcbind-1.2.5/src/rpcinfo.c new/rpcbind-1.2.6/src/rpcinfo.c --- old/rpcbind-1.2.5/src/rpcinfo.c 2018-08-15 16:51:19.000000000 +0200 +++ new/rpcbind-1.2.6/src/rpcinfo.c 2021-05-10 19:10:19.000000000 +0200 @@ -693,11 +693,11 @@ } if (!(uaddr = taddr2uaddr (nconf, who))) { - uaddr = UNKNOWN; + printf ("%s\t%s\n", UNKNOWN, hostname); + } else { + printf ("%s\t%s\n", uaddr, hostname); + free ((char *) uaddr); } - printf ("%s\t%s\n", uaddr, hostname); - if (strcmp (uaddr, UNKNOWN)) - free ((char *) uaddr); return (FALSE); } @@ -973,6 +973,7 @@ (" program version(s) netid(s) service owner\n"); for (rs = rs_head; rs; rs = rs->next) { + size_t netidmax = sizeof(buf) - 1; char *p = buf; printf ("%10ld ", rs->prog); @@ -985,12 +986,22 @@ } printf ("%-10s", buf); buf[0] = '\0'; - for (nl = rs->nlist; nl; nl = nl->next) - { - strcat (buf, nl->netid); - if (nl->next) - strcat (buf, ","); - } + + for (nl = rs->nlist; nl; nl = nl->next) + { + strncat (buf, nl->netid, netidmax); + if (strlen (nl->netid) < netidmax) + netidmax -= strlen(nl->netid); + else + break; + + if (nl->next && netidmax > 1) + { + strncat (buf, ",", netidmax); + netidmax --; + } + } + printf ("%-32s", buf); rpc = getrpcbynumber (rs->prog); if (rpc) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/rpcbind-1.2.5/src/security.c new/rpcbind-1.2.6/src/security.c --- old/rpcbind-1.2.5/src/security.c 2018-08-15 16:51:19.000000000 +0200 +++ new/rpcbind-1.2.6/src/security.c 2021-05-10 19:10:19.000000000 +0200 @@ -22,29 +22,20 @@ /* * XXX for special case checks in check_callit. */ -#ifdef HAVE_RPCSVC_MOUNT_H -#include <rpcsvc/mount.h> -#include <rpcsvc/rquota.h> -#include <rpcsvc/nfs_prot.h> -#include <rpcsvc/yp.h> -#include <rpcsvc/ypclnt.h> -#include <rpcsvc/yppasswd.h> -#else -# define MOUNTPROC_MNT 1 -# define MOUNTPROC_UMNT 3 -# define NFS_PROGRAM 100003 -# define YPPROG 100004 -# define MOUNTPROG 100005 -# define YPBINDPROG 100007 -# define YPPASSWDPROG 100009 -# define RQUOTAPROG 100011 - -# define YPBINDPROC_SETDOM 2 -# define YPPROC_MATCH 3 -# define YPPROC_FIRST 4 -# define YPPROC_NEXT 5 -# define YPPROC_ALL 8 -#endif +#define MOUNTPROC_MNT 1 +#define MOUNTPROC_UMNT 3 +#define NFS_PROGRAM 100003 +#define YPPROG 100004 +#define MOUNTPROG 100005 +#define YPBINDPROG 100007 +#define YPPASSWDPROG 100009 +#define RQUOTAPROG 100011 + +#define YPBINDPROC_SETDOM 2 +#define YPPROC_MATCH 3 +#define YPPROC_FIRST 4 +#define YPPROC_NEXT 5 +#define YPPROC_ALL 8 #include "rpcbind.h" @@ -154,7 +145,7 @@ #ifdef RPCBIND_DEBUG if (debugging) xlog(LOG_DEBUG, - "Checking caller's adress (port = %d)\n", + "Checking caller's address (port = %d)\n", ntohs(sin->sin_port)); #endif return (sin->sin_addr.s_addr == htonl(INADDR_LOOPBACK)); @@ -166,7 +157,7 @@ #ifdef RPCBIND_DEBUG if (debugging) xlog(LOG_DEBUG, - "Checking caller's adress (port = %d)\n", + "Checking caller's address (port = %d)\n", ntohs(sin6->sin6_port)); #endif return (IN6_IS_ADDR_LOOPBACK(&sin6->sin6_addr) || @@ -355,7 +346,7 @@ logit(deny_severity, sa, args->rmt_proc, args->rmt_prog, ": indirect call not allowed"); #else - logit(0, sa, args->rmt_proc, args->rmt_prog, + logit(LOG_AUTH|LOG_WARNING, sa, args->rmt_proc, args->rmt_prog, ": indirect call not allowed"); #endif return 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/rpcbind-1.2.5/src/util.c new/rpcbind-1.2.6/src/util.c --- old/rpcbind-1.2.5/src/util.c 2018-08-15 16:51:19.000000000 +0200 +++ new/rpcbind-1.2.6/src/util.c 2021-05-10 19:10:19.000000000 +0200 @@ -45,7 +45,7 @@ #include <net/if.h> #include <netinet/in.h> #include <ifaddrs.h> -#include <sys/poll.h> +#include <poll.h> #include <rpc/rpc.h> #include <errno.h> #include <stdlib.h> @@ -103,7 +103,7 @@ addrmerge(struct netbuf *caller, char *serv_uaddr, char *clnt_uaddr, char *netid) { - struct ifaddrs *ifap, *ifp = NULL, *bestif; + struct ifaddrs *ifap, *ifp = NULL, *bestif, *exactif; struct netbuf *serv_nbp = NULL, *hint_nbp = NULL, tbuf; struct sockaddr *caller_sa, *hint_sa, *ifsa, *ifmasksa, *serv_sa; struct sockaddr_storage ss; @@ -157,7 +157,10 @@ * network portion of its address is equal to that of the client. * If so, we have found the interface that we want to use. */ - bestif = NULL; + bestif = NULL; /* first interface UP with same network & family */ + exactif = NULL; /* the interface requested by the client */ + u_int8_t maskAllAddrBits[16] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; /* 16 bytes for IPv6 */ for (ifap = ifp; ifap != NULL; ifap = ifap->ifa_next) { ifsa = ifap->ifa_addr; ifmasksa = ifap->ifa_netmask; @@ -175,8 +178,16 @@ if (!bitmaskcmp(&SA2SINADDR(ifsa), &SA2SINADDR(hint_sa), &SA2SINADDR(ifmasksa), sizeof(struct in_addr))) { - bestif = ifap; - goto found; + if(!bestif) /* for compatibility with previous code */ + bestif = ifap; + /* Is this an exact match? */ + if (!bitmaskcmp(&SA2SINADDR(ifsa), + &SA2SINADDR(hint_sa), maskAllAddrBits, + sizeof(struct in_addr))) { + exactif = ifap; + goto found; + } + /* else go-on looking for an exact match */ } break; #ifdef INET6 @@ -197,8 +208,16 @@ } else if (!bitmaskcmp(&SA2SIN6ADDR(ifsa), &SA2SIN6ADDR(hint_sa), &SA2SIN6ADDR(ifmasksa), sizeof(struct in6_addr))) { - bestif = ifap; - goto found; + if(!bestif) /* for compatibility with previous code */ + bestif = ifap; + /* Is this an exact match? */ + if (!bitmaskcmp(&SA2SIN6ADDR(ifsa), + &SA2SIN6ADDR(hint_sa), maskAllAddrBits, + sizeof(struct in6_addr))) { + exactif = ifap; + goto found; + } + /* else go-on looking for an exact match */ } break; #endif @@ -215,10 +234,13 @@ (bestif->ifa_flags & (IFF_LOOPBACK | IFF_POINTOPOINT)))) bestif = ifap; } + if (bestif == NULL) goto freeit; found: + if(exactif) + bestif = exactif; /* * Construct the new address using the the address from * `bestif', and the port number from `serv_uaddr'. @@ -287,7 +309,7 @@ int s; #endif int ecode; - struct addrinfo hints, *res; + struct addrinfo hints, *res = NULL; memset(&hints, 0, sizeof hints); hints.ai_family = AF_INET; @@ -322,13 +344,20 @@ /* * Now join the RPC ipv6 multicast group on all interfaces. */ - if (getifaddrs(&ifp) < 0) + if (getifaddrs(&ifp) < 0) { + freeaddrinfo (res); return; - + } mreq6.ipv6mr_interface = 0; inet_pton(AF_INET6, RPCB_MULTICAST_ADDR, &mreq6.ipv6mr_multiaddr); s = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP); + if (s < 0) { + if (debugging) + fprintf(stderr, "socket(AF_INET6) failed: %s\n", strerror(errno)); + freeaddrinfo (res); + return; + } /* * Loop through all interfaces. For each IPv6 multicast-capable @@ -351,9 +380,9 @@ if (debugging) perror("setsockopt v6 multicast"); } + close(s); #endif - - /* close(s); */ + freeaddrinfo (res); } struct sockaddr * diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/rpcbind-1.2.5/src/warmstart.c new/rpcbind-1.2.6/src/warmstart.c --- old/rpcbind-1.2.5/src/warmstart.c 2018-08-15 16:51:19.000000000 +0200 +++ new/rpcbind-1.2.6/src/warmstart.c 2021-05-10 19:10:19.000000000 +0200 @@ -35,6 +35,7 @@ #include <sys/types.h> #include <sys/stat.h> #include <stdio.h> +#include <string.h> #include <rpc/rpc.h> #include <rpc/rpcb_prot.h> #include <rpc/xdr.h>