diff -Nru rpcbind-0.2.3/debian/changelog rpcbind-0.2.3/debian/changelog --- rpcbind-0.2.3/debian/changelog 2020-07-10 18:26:18.000000000 +0000 +++ rpcbind-0.2.3/debian/changelog 2020-08-10 15:05:43.000000000 +0000 @@ -1,3 +1,15 @@ +rpcbind (0.2.3-0.2ubuntu0.16.04.1) xenial; urgency=medium + + * d/rules, d/control: + - Add dh-autoreconf build-dep and force dh_autoreconf + to fix FTBFS (LP: #1885389) + * d/p/lp304393/0001-rpcbind-Disable-remote-calls-by-default.patch, + d/p/lp304393/0002-rmt-calls.patch, + d/p/lp304393/0003-change-rmtcalls-default-to-enabled.patch: + - Allow disabling rmtcalls port binding (LP: #304393) + + -- Dan Streetman Mon, 10 Aug 2020 11:05:43 -0400 + rpcbind (0.2.3-0.2ubuntu0.1) xenial; urgency=medium * d/rpcbind.service: Add WantedBy=multi-user.target, this should ensure diff -Nru rpcbind-0.2.3/debian/control rpcbind-0.2.3/debian/control --- rpcbind-0.2.3/debian/control 2020-07-10 18:26:18.000000000 +0000 +++ rpcbind-0.2.3/debian/control 2020-08-10 15:02:25.000000000 +0000 @@ -3,7 +3,7 @@ Priority: standard Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Anibal Monsalve Salazar -Build-Depends: dpkg-dev (>= 1.16.1~), debhelper (>= 9), dh-systemd (>= 1.5), autotools-dev, pkg-config, libtirpc-dev (>= 0.2.4-2~), libwrap0-dev, libsystemd-dev [linux-any] +Build-Depends: dpkg-dev (>= 1.16.1~), debhelper (>= 9), dh-autoreconf, dh-systemd (>= 1.5), autotools-dev, pkg-config, libtirpc-dev (>= 0.2.4-2~), libwrap0-dev, libsystemd-dev [linux-any] Standards-Version: 3.9.5 Homepage: http://sourceforge.net/projects/rpcbind/ diff -Nru rpcbind-0.2.3/debian/patches/lp304393/0001-rpcbind-Disable-remote-calls-by-default.patch rpcbind-0.2.3/debian/patches/lp304393/0001-rpcbind-Disable-remote-calls-by-default.patch --- rpcbind-0.2.3/debian/patches/lp304393/0001-rpcbind-Disable-remote-calls-by-default.patch 1970-01-01 00:00:00.000000000 +0000 +++ rpcbind-0.2.3/debian/patches/lp304393/0001-rpcbind-Disable-remote-calls-by-default.patch 2020-08-10 15:01:31.000000000 +0000 @@ -0,0 +1,74 @@ +From 2e9c289246c647e25649914bdb0d9400c66f486e Mon Sep 17 00:00:00 2001 +From: Steve Dickson +Date: Wed, 15 Aug 2018 10:22:36 -0400 +Subject: [PATCH] rpcbind: Disable remote calls by default +Origin: upstream, https://git.linux-nfs.org/?p=steved/rpcbind.git;a=commit;h=2e9c289246c647e25649914bdb0d9400c66f486e +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/cups/+bug/304393 + +Added a new configuration flag --enable-rmtcalls +which will be needed to enable the remote call +functionality. + +This also stops rpcbind from opening up random +listening ports. + +Signed-off-by: Steve Dickson +--- + Makefile.am | 4 ++++ + configure.ac | 4 ++++ + src/rpcbind.c | 6 +++++- + 3 files changed, 13 insertions(+), 1 deletion(-) + +--- a/Makefile.am ++++ b/Makefile.am +@@ -29,6 +29,10 @@ if LIBWRAP + AM_CPPFLAGS += -DLIBWRAP + endif + ++if RMTCALLS ++AM_CPPFLAGS += -DRMTCALLS ++endif ++ + bin_PROGRAMS = rpcbind rpcinfo + + rpcbind_SOURCES = \ +--- a/configure.ac ++++ b/configure.ac +@@ -21,6 +21,10 @@ AC_ARG_ENABLE([warmstarts], + AS_HELP_STRING([--enable-warmstarts], [Enables Warm Starts @<:@default=no@:>@])) + AM_CONDITIONAL(WARMSTART, test x$enable_warmstarts = xyes) + ++AC_ARG_ENABLE([rmtcalls], ++ AS_HELP_STRING([--enable-rmtcalls], [Enables Remote Calls @<:@default=no@:>@])) ++AM_CONDITIONAL(RMTCALLS, test x$enable_rmtcalls = xyes) ++ + AC_ARG_WITH([statedir], + AS_HELP_STRING([--with-statedir=ARG], [use ARG as state dir @<:@default=/tmp@:>@]) + ,, [with_statedir=/tmp]) +--- a/src/rpcbind.c ++++ b/src/rpcbind.c +@@ -796,12 +796,14 @@ got_socket: + } + } + #endif ++ ++ ++#ifdef RMTCALLS + /* + * rmtcall only supported on CLTS transports for now. + */ + if (nconf->nc_semantics == NC_TPI_CLTS) { + status = create_rmtcall_fd(nconf); +- + #ifdef RPCBIND_DEBUG + if (debugging) { + if (status < 0) { +@@ -815,6 +817,8 @@ got_socket: + } + #endif + } ++#endif ++ + return (0); + error: + close(fd); diff -Nru rpcbind-0.2.3/debian/patches/lp304393/0002-rmt-calls.patch rpcbind-0.2.3/debian/patches/lp304393/0002-rmt-calls.patch --- rpcbind-0.2.3/debian/patches/lp304393/0002-rmt-calls.patch 1970-01-01 00:00:00.000000000 +0000 +++ rpcbind-0.2.3/debian/patches/lp304393/0002-rmt-calls.patch 2020-08-10 15:01:31.000000000 +0000 @@ -0,0 +1,125 @@ +Description: Add command line option to enable remote calls at runtime instead build time +Author: Josue Ortega +Last-Update: 2019-09-17 +Origin: upstream, https://salsa.debian.org/debian/rpcbind/-/commit/e7740f47cefa41b6a6044935cab3391f00d46e1f +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=939890 +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/cups/+bug/304393 + +--- a/Makefile.am ++++ b/Makefile.am +@@ -29,10 +29,6 @@ if LIBWRAP + AM_CPPFLAGS += -DLIBWRAP + endif + +-if RMTCALLS +-AM_CPPFLAGS += -DRMTCALLS +-endif +- + bin_PROGRAMS = rpcbind rpcinfo + + rpcbind_SOURCES = \ +--- a/src/rpcbind.c ++++ b/src/rpcbind.c +@@ -88,6 +88,7 @@ int debugging = 0; /* Tell me what's goi + int doabort = 0; /* When debugging, do an abort on errors */ + int dofork = 1; /* fork? */ + int createdsocket = 0; /* Did I create the socket or systemd did it for me? */ ++int rmtcalls = 0; /* Remote calls */ + + rpcblist_ptr list_rbl; /* A list of version 3/4 rpcbind services */ + +@@ -798,12 +799,12 @@ got_socket: + #endif + + +-#ifdef RMTCALLS ++ if (rmtcalls) { + /* + * rmtcall only supported on CLTS transports for now. + */ +- if (nconf->nc_semantics == NC_TPI_CLTS) { +- status = create_rmtcall_fd(nconf); ++ if (nconf->nc_semantics == NC_TPI_CLTS) { ++ status = create_rmtcall_fd(nconf); + #ifdef RPCBIND_DEBUG + if (debugging) { + if (status < 0) { +@@ -816,8 +817,8 @@ got_socket: + } + } + #endif +- } +-#endif ++ } ++ } + + return (0); + error: +@@ -883,7 +884,7 @@ parseargs(int argc, char *argv[]) + { + int c; + oldstyle_local = 1; +- while ((c = getopt(argc, argv, "adh:ilswf")) != -1) { ++ while ((c = getopt(argc, argv, "adh:ilswfr")) != -1) { + switch (c) { + case 'a': + doabort = 1; /* when debugging, do an abort on */ +@@ -913,17 +914,20 @@ parseargs(int argc, char *argv[]) + case 'f': + dofork = 0; + break; ++ case 'r': ++ rmtcalls = 1; ++ break; + case 'w': + #ifdef WARMSTART + warmstart = 1; + break; + default: /* error */ +- fprintf(stderr, "usage: rpcbind [-adhilswf]\n"); ++ fprintf(stderr, "usage: rpcbind [-adhilswfr]\n"); + #else + fprintf(stderr, "-w: rpcbind compiled without WARMSTART support.\n"); + /* FALLTHROUGH */ + default: /* error */ +- fprintf(stderr, "usage: rpcbind [-adhils]\n"); ++ fprintf(stderr, "usage: rpcbind [-adhilsfr]\n"); + #endif + exit (1); + } +--- a/man/rpcbind.8 ++++ b/man/rpcbind.8 +@@ -11,7 +11,7 @@ + .Nd universal addresses to RPC program number mapper + .Sh SYNOPSIS + .Nm +-.Op Fl adhiLls ++.Op Fl adhiLlsr + .Sh DESCRIPTION + The + .Nm +@@ -137,6 +137,11 @@ to do a "warm start" by read a state fil + starts up. The state file is created when + .Nm + terminates. ++.It Fl r ++Turn on remote calls. Cause ++.Nm ++to open up random listening ports. Note that rpcinfo need this feature turned on ++for work properly. + .El + .Sh NOTES + All RPC servers must be restarted if +--- a/configure.ac ++++ b/configure.ac +@@ -21,10 +21,6 @@ AC_ARG_ENABLE([warmstarts], + AS_HELP_STRING([--enable-warmstarts], [Enables Warm Starts @<:@default=no@:>@])) + AM_CONDITIONAL(WARMSTART, test x$enable_warmstarts = xyes) + +-AC_ARG_ENABLE([rmtcalls], +- AS_HELP_STRING([--enable-rmtcalls], [Enables Remote Calls @<:@default=no@:>@])) +-AM_CONDITIONAL(RMTCALLS, test x$enable_rmtcalls = xyes) +- + AC_ARG_WITH([statedir], + AS_HELP_STRING([--with-statedir=ARG], [use ARG as state dir @<:@default=/tmp@:>@]) + ,, [with_statedir=/tmp]) diff -Nru rpcbind-0.2.3/debian/patches/lp304393/0003-change-rmtcalls-default-to-enabled.patch rpcbind-0.2.3/debian/patches/lp304393/0003-change-rmtcalls-default-to-enabled.patch --- rpcbind-0.2.3/debian/patches/lp304393/0003-change-rmtcalls-default-to-enabled.patch 1970-01-01 00:00:00.000000000 +0000 +++ rpcbind-0.2.3/debian/patches/lp304393/0003-change-rmtcalls-default-to-enabled.patch 2020-08-10 15:01:31.000000000 +0000 @@ -0,0 +1,72 @@ +From: Dan Streetman +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/cups/+bug/304393 +Forwarded: not-needed + +Change rmtcalls to default to on, and add check for env param to disable it. + +In Bionic and earlier, rpcbind defaulted to creating a rmtcall port, but +in Focal and later (and in Debian) this has changed to default to *not* +create a rmtcall port, and a cmdline parameter has been added to allow users +to enable the rmtcall port if needed. To backport this functionality allowing +users to choose if the rmtcall port is enabled or not, the default needs to +remain the same as the Ubuntu release initially used, meaning in Bionc and +earlier the default should remain on, to create the rmtcall port. + +This modifies upstream's approach by changing the default back to on, and +adding a check for an env var to *disable* the rmtcalls. This approach +allows retaining backwards compatibility - the default remains the same for +the current release - while also allowing users to disable it if desired, +and preventing breakage if/when the system is upgraded to Focal or later. +On upgrade, the rpcbind code in Focal or later will ignore the env var. + +Note that on upgrade, the default will change - rmtcalls is enabled by default +in Bionic and earlier, and disabled by default in Focal and later - but that +is by design, as the default was intentionally changed by upstream between the +Bionic and Focal releases. This patch only attempts to backport the ability +to choose if rmtcalls is enabled or not, while retaining backwards and forwards +compatibility. + +--- a/src/rpcbind.c ++++ b/src/rpcbind.c +@@ -88,7 +88,7 @@ int debugging = 0; /* Tell me what's goi + int doabort = 0; /* When debugging, do an abort on errors */ + int dofork = 1; /* fork? */ + int createdsocket = 0; /* Did I create the socket or systemd did it for me? */ +-int rmtcalls = 0; /* Remote calls */ ++int rmtcalls = 1; /* Remote calls */ + + rpcblist_ptr list_rbl; /* A list of version 3/4 rpcbind services */ + +@@ -883,6 +883,10 @@ static void + parseargs(int argc, char *argv[]) + { + int c; ++ if (getenv("RPCBIND_RMTCALL_DEFAULT_DISABLED")) { ++ syslog(LOG_INFO, "remote calls disabled by default\n"); ++ rmtcalls = 0; ++ } + oldstyle_local = 1; + while ((c = getopt(argc, argv, "adh:ilswfr")) != -1) { + switch (c) { +--- a/man/rpcbind.8 ++++ b/man/rpcbind.8 +@@ -140,8 +140,17 @@ terminates. + .It Fl r + Turn on remote calls. Cause + .Nm +-to open up random listening ports. Note that rpcinfo need this feature turned on +-for work properly. ++to open up random listening ports. Note that rpcinfo need this feature turned ++on for work properly. Ubuntu note: to retain backwards compatibility with ++existing behavior, in releases Xenial and Bionic, the default for this is ++enabled, so remote calls are turned on by default. To change the default to ++disabled, define the variable ++.Fl RPCBIND_RMTCALL_DEFAULT_DISABLED ++(its value does not matter, it only needs to be defined) in either of the ++config files, /etc/default/rpcbind or /etc/rpcbind.conf. This will work only ++if the service is started by systemd; this will not work if the service is ++started by upstart. In Focal and later, the remote calls default is ++disabled, and the variable is ignored. + .El + .Sh NOTES + All RPC servers must be restarted if diff -Nru rpcbind-0.2.3/debian/patches/series rpcbind-0.2.3/debian/patches/series --- rpcbind-0.2.3/debian/patches/series 2020-07-10 18:26:18.000000000 +0000 +++ rpcbind-0.2.3/debian/patches/series 2020-08-10 15:01:31.000000000 +0000 @@ -4,3 +4,6 @@ run-migration CVE-2015-7236.patch 07-Delete-the-unix-socket-only-if-we-have-created-it.patch +lp304393/0001-rpcbind-Disable-remote-calls-by-default.patch +lp304393/0002-rmt-calls.patch +lp304393/0003-change-rmtcalls-default-to-enabled.patch diff -Nru rpcbind-0.2.3/debian/rules rpcbind-0.2.3/debian/rules --- rpcbind-0.2.3/debian/rules 2020-07-10 18:26:18.000000000 +0000 +++ rpcbind-0.2.3/debian/rules 2020-08-10 15:01:31.000000000 +0000 @@ -26,8 +26,9 @@ CONFIGURE_EXTRA_FLAGS += --with-systemdsystemunitdir=no endif -config.status: configure +config.status: dh_testdir + dh_autoreconf # Add here commands to configure the package. cp -f /usr/share/misc/config.sub /usr/share/misc/config.guess . ./configure $(CROSS) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" --enable-warmstarts --enable-libwrap --with-statedir=/run/rpcbind --with-rpcuser=root $(CONFIGURE_EXTRA_FLAGS)