From 37d7a2686a8737f4a11024ccfe965a168664b91e Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 8 Feb 2021 20:35:00 +0800 Subject: [PATCH 1/2] remove rmt-call and disable rpcbind.service --- bugfix-rmt-calls.patch | 136 +++++++++++++++++++++++++++++++++++++++++ rpcbind.spec | 13 +++- rpcbind.sysconfig | 1 + 3 files changed, 149 insertions(+), 1 deletion(-) create mode 100644 bugfix-rmt-calls.patch diff --git a/bugfix-rmt-calls.patch b/bugfix-rmt-calls.patch new file mode 100644 index 0000000..61ce3ac --- /dev/null +++ b/bugfix-rmt-calls.patch @@ -0,0 +1,136 @@ +From f2e2c1e85f32e4bb8be66f67efbab43e65dfb573 Mon Sep 17 00:00:00 2001 +Description: Add command line option to enable remote calls at runtime instead build time +Author: Josue Ortega +Last-Update: 2019-09-17 + +--- + Makefile.am | 4 ---- + configure.ac | 4 ---- + man/rpcbind.8 | 7 ++++++- + src/rpcbind.c | 18 +++++++++++------- + 4 files changed, 17 insertions(+), 16 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index bcdd69f..3efe198 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -29,10 +29,6 @@ if LIBWRAP + AM_CPPFLAGS += -DLIBWRAP + endif + +-if RMTCALLS +-AM_CPPFLAGS += -DRMTCALLS +-endif +- + bin_PROGRAMS = rpcinfo + sbin_PROGRAMS = rpcbind + +diff --git a/configure.ac b/configure.ac +index 9f494ea..65c2dc7 100644 +--- 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=/run/rpcbind@:>@]) + ,, [with_statedir=/run/rpcbind]) +diff --git a/man/rpcbind.8 b/man/rpcbind.8 +index af6200f..e396372 100644 +--- 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 file when + 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. (This flag is a Debian extension.) + .El + .Sh NOTES + All RPC servers must be restarted if +diff --git a/src/rpcbind.c b/src/rpcbind.c +index fd8cab4..c43489d 100644 +--- a/src/rpcbind.c ++++ b/src/rpcbind.c +@@ -88,6 +88,7 @@ int debugging = 0; /* Tell me what's going on */ + 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 */ + +@@ -806,12 +807,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) { +@@ -824,8 +825,8 @@ got_socket: + } + } + #endif +- } +-#endif ++ } ++ } + + return (0); + error: +@@ -891,7 +892,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 */ +@@ -921,13 +922,16 @@ parseargs(int argc, char *argv[]) + case 'f': + dofork = 0; + break; ++ case 'r': ++ rmtcalls = 1; ++ break; + #ifdef WARMSTART + case 'w': + warmstart = 1; + break; + #endif + default: /* error */ +- fprintf(stderr, "usage: rpcbind [-adhilswf]\n"); ++ fprintf(stderr, "usage: rpcbind [-adhilswfr]\n"); + exit (1); + } + } +-- +2.23.0 + diff --git a/rpcbind.spec b/rpcbind.spec index be0a579..9ffadfa 100644 --- a/rpcbind.spec +++ b/rpcbind.spec @@ -3,7 +3,7 @@ Name: rpcbind Version: 1.2.5 -Release: 2 +Release: 4 Summary: Universal addresses to RPC program number mapper License: BSD @@ -27,8 +27,10 @@ Patch103: %{name}-0.2.4-systemd-service.patch Patch104: %{name}-0.2.4-systemd-rundir.patch Patch6000: bugfix-%{name}-GETADDR-return-client-ip.patch Patch6001: CVE-2017-8779.patch +Patch6002: bugfix-rmt-calls.patch Patch9000: bugfix-listen-tcp-port-111.patch + Provides: portmap = %{version}-%{release} Obsoletes: portmap <= 4.0-65.3 @@ -78,12 +80,15 @@ fi %post %systemd_post %{name}.service %{name}.socket +systemctl disable %{name}.service > /dev/null 2>&1 %preun %systemd_preun %{name}.service %{name}.socket +systemctl disable %{name}.service > /dev/null 2>&1 %postun %systemd_postun_with_restart %{name}.service %{name}.socket +systemctl disable %{name}.service > /dev/null 2>&1 %triggerun -- %{name} < 0.2.0-15 %{_bindir}/systemd-sysv-convert --save %{name} >/dev/null 2>&1 ||: @@ -115,6 +120,12 @@ fi %{_mandir}/man8/*.8.gz %changelog +* Mon Feb 8 2021 hanzhijun - 1.2.5-4 +- Type:bugfix +- Id:NA +- SUG:NA +- DESC:remove config rmtcall and disable rpcbind.service default + * Thu Oct 10 2019 openEuler Buildteam - 1.2.5-2 - Type:bugfix - Id:NA diff --git a/rpcbind.sysconfig b/rpcbind.sysconfig index 4b35e37..ed3f3b7 100644 --- a/rpcbind.sysconfig +++ b/rpcbind.sysconfig @@ -1,3 +1,4 @@ # # Optional arguments passed to rpcbind. See rpcbind(8) RPCBIND_ARGS="" +RPCBIND_OPTIONS="-r" -- Gitee From 37566b4f47fd461c61c4e6b6796f3dbd13dbe3c0 Mon Sep 17 00:00:00 2001 From: compile_success Date: Thu, 25 Feb 2021 20:03:48 +0800 Subject: [PATCH 2/2] fix uninstall warning info --- rpcbind.spec | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/rpcbind.spec b/rpcbind.spec index 9ffadfa..fa8fad9 100644 --- a/rpcbind.spec +++ b/rpcbind.spec @@ -3,7 +3,7 @@ Name: rpcbind Version: 1.2.5 -Release: 4 +Release: 5 Summary: Universal addresses to RPC program number mapper License: BSD @@ -80,15 +80,15 @@ fi %post %systemd_post %{name}.service %{name}.socket -systemctl disable %{name}.service > /dev/null 2>&1 +systemctl disable %{name}.service > /dev/null 2>&1 ||: %preun %systemd_preun %{name}.service %{name}.socket -systemctl disable %{name}.service > /dev/null 2>&1 +systemctl disable %{name}.service > /dev/null 2>&1 ||: %postun %systemd_postun_with_restart %{name}.service %{name}.socket -systemctl disable %{name}.service > /dev/null 2>&1 +systemctl disable %{name}.service > /dev/null 2>&1 ||: %triggerun -- %{name} < 0.2.0-15 %{_bindir}/systemd-sysv-convert --save %{name} >/dev/null 2>&1 ||: @@ -120,6 +120,12 @@ fi %{_mandir}/man8/*.8.gz %changelog +* Thu Feb 25 2021 zhujunhao - 1.2.5-5 +- Type:bugfix +- Id:NA +- SUG:NA +- DESC:fix uninstall package warning info + * Mon Feb 8 2021 hanzhijun - 1.2.5-4 - Type:bugfix - Id:NA -- Gitee