Compare commits
10 Commits
1e158db931
...
4d4d341ad4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4d4d341ad4 | ||
|
|
8ae29c09d1 | ||
|
|
6a34adaa73 | ||
|
|
a145d9ec94 | ||
|
|
0e1272e14f | ||
|
|
882eb1b24c | ||
|
|
7d11612cbf | ||
|
|
574cefcacb | ||
|
|
221f9e846c | ||
|
|
666cd89f79 |
139
backport-debian-enable-rmt-calls-with-r.patch
Normal file
139
backport-debian-enable-rmt-calls-with-r.patch
Normal file
@ -0,0 +1,139 @@
|
||||
Description: Add command line option to enable remote calls at runtime
|
||||
instead build time
|
||||
Author: Josue Ortega <josue@debian.org>
|
||||
Last-Update: 2019-09-17
|
||||
|
||||
Conflict:NA
|
||||
Reference:https://sources.debian.org/data/main/r/rpcbind/1.2.5-9/debian/patches/00-rmt-calls.patch
|
||||
|
||||
---
|
||||
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 d2a0352..1402ff4 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 fbf0ace..2efd0e4 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
|
||||
@@ -149,6 +149,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 24f42f8..3223eda 100644
|
||||
--- a/src/rpcbind.c
|
||||
+++ b/src/rpcbind.c
|
||||
@@ -87,6 +87,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 */
|
||||
|
||||
@@ -807,12 +808,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) {
|
||||
@@ -825,8 +826,8 @@ got_socket:
|
||||
}
|
||||
}
|
||||
#endif
|
||||
- }
|
||||
-#endif
|
||||
+ }
|
||||
+ }
|
||||
|
||||
if (res != NULL)
|
||||
freeaddrinfo(res);
|
||||
@@ -896,7 +897,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 */
|
||||
@@ -926,13 +927,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
|
||||
|
||||
@ -1,33 +1,40 @@
|
||||
diff -up rpcbind-0.2.4/src/rpcbind.c.orig rpcbind-0.2.4/src/rpcbind.c
|
||||
--- rpcbind-0.2.4/src/rpcbind.c.orig 2017-03-21 10:12:35.005190509 -0400
|
||||
+++ rpcbind-0.2.4/src/rpcbind.c 2017-03-21 10:36:45.510507649 -0400
|
||||
@@ -144,6 +144,8 @@ static void rbllist_add(rpcprog_t, rpcve
|
||||
--- rpcbind-1.2.6/src/rpcbind.c 2023-03-27 15:17:28.116410124 +0800
|
||||
+++ rpcbind-1.2.6-dev/src/rpcbind.c 2023-03-27 15:37:14.215749666 +0800
|
||||
@@ -143,6 +143,10 @@ static void rbllist_add(rpcprog_t, rpcve
|
||||
static void terminate(int);
|
||||
static void parseargs(int, char *[]);
|
||||
|
||||
+#ifndef WITHOUT_SYSTEMD
|
||||
+char *systemdtmp = "/usr/bin/systemd-tmpfiles --create rpcbind.conf";
|
||||
+#endif
|
||||
+
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
@@ -151,13 +153,21 @@ main(int argc, char *argv[])
|
||||
@@ -150,13 +154,27 @@ main(int argc, char *argv[])
|
||||
void *nc_handle; /* Net config handle */
|
||||
struct rlimit rl;
|
||||
int maxrec = RPC_MAXDATASIZE;
|
||||
+#ifndef WITHOUT_SYSTEMD
|
||||
+ int once = 1;
|
||||
+#endif
|
||||
|
||||
parseargs(argc, argv);
|
||||
|
||||
+#ifndef WITHOUT_SYSTEMD
|
||||
+tryagain:
|
||||
+#endif
|
||||
/* Check that another rpcbind isn't already running. */
|
||||
if ((rpcbindlockfd = (open(RPCBINDDLOCK,
|
||||
- O_RDONLY|O_CREAT, 0444))) == -1)
|
||||
+ O_RDONLY|O_CREAT, 0444))) == -1) {
|
||||
+#ifndef WITHOUT_SYSTEMD
|
||||
+ if (once) {
|
||||
+ once = system(systemdtmp); /* set once to avoid a warning */
|
||||
+ once = 0;
|
||||
+ goto tryagain;
|
||||
+ }
|
||||
+#endif
|
||||
err(1, "%s", RPCBINDDLOCK);
|
||||
+ }
|
||||
|
||||
|
||||
57
rpcbind.spec
57
rpcbind.spec
@ -3,7 +3,7 @@
|
||||
|
||||
Name: rpcbind
|
||||
Version: 1.2.6
|
||||
Release: 3
|
||||
Release: 8
|
||||
Summary: Universal addresses to RPC program number mapper
|
||||
License: BSD
|
||||
|
||||
@ -28,6 +28,7 @@ Patch104: %{name}-0.2.4-systemd-rundir.patch
|
||||
Patch105: bugfix-rpcbind-GETADDR-return-client-ip.patch
|
||||
Patch6001: CVE-2017-8779.patch
|
||||
Patch6002: backport-fix-double-free-in-init_transport.patch
|
||||
Patch6003: backport-debian-enable-rmt-calls-with-r.patch
|
||||
Patch9000: bugfix-listen-tcp-port-111.patch
|
||||
|
||||
Provides: portmap = %{version}-%{release}
|
||||
@ -79,25 +80,29 @@ if ! getent passwd rpc >/dev/null ; then
|
||||
fi
|
||||
|
||||
%post
|
||||
%systemd_post %{name}.service %{name}.socket
|
||||
%systemd_post %{name}.socket %{name}.service
|
||||
|
||||
%preun
|
||||
%systemd_preun %{name}.service %{name}.socket
|
||||
|
||||
%postun
|
||||
%systemd_postun_with_restart %{name}.service %{name}.socket
|
||||
|
||||
%triggerun -- %{name} < 0.2.0-15
|
||||
%{_bindir}/systemd-sysv-convert --save %{name} >/dev/null 2>&1 ||:
|
||||
/bin/systemctl --no-reload enable %{name}.service >/dev/null 2>&1
|
||||
/sbin/chkconfig --del %{name} >/dev/null 2>&1 || :
|
||||
/bin/systemctl try-restart %{name}.service >/dev/null 2>&1 || :
|
||||
%systemd_postun_with_restart %{name}.socket %{name}.service
|
||||
|
||||
%triggerin -- %{name} > 0.2.2-2.0
|
||||
if systemctl -q is-enabled %{name}.socket
|
||||
then
|
||||
/bin/systemctl reenable %{name}.socket >/dev/null 2>&1 || :
|
||||
/bin/systemctl restart %{name}.socket >/dev/null 2>&1 || :
|
||||
/bin/systemctl reenable %{name}.socket >/dev/null 2>&1 || :
|
||||
/bin/systemctl restart %{name}.socket >/dev/null 2>&1 || :
|
||||
fi
|
||||
|
||||
if [ ! -d /var/lib/rpcbind ]
|
||||
then
|
||||
mkdir /var/lib/rpcbind
|
||||
chown rpc:rpc /var/lib/rpcbind
|
||||
if [ -x /usr/sbin/restorecon ]
|
||||
then
|
||||
/usr/sbin/restorecon /var/lib/rpcbind
|
||||
fi
|
||||
fi
|
||||
|
||||
%files
|
||||
@ -117,6 +122,36 @@ fi
|
||||
%{_mandir}/man8/*.8.gz
|
||||
|
||||
%changelog
|
||||
* Wed Dec 18 2024 sunsuwan <sunsuwan3@huawei.com> - 1.2.6-8
|
||||
- Type:bugfix
|
||||
- Id:NA
|
||||
- SUG:NA
|
||||
- DESC:add back the mistakenly deleted triggerin
|
||||
|
||||
* Mon May 29 2023 liuhaipeng <liuhaipeng@xfusion.com> - 1.2.6-7
|
||||
- Type:bugfix
|
||||
- Id:NA
|
||||
- SUG:NA
|
||||
- DESC:fix the upgrade or upgrade exception alarm
|
||||
|
||||
* Mon May 22 2023 sunsuwan <sunsuwan3@huawei.com> - 1.2.6-6
|
||||
- Type:bugfix
|
||||
- Id:NA
|
||||
- SUG:NA
|
||||
- DESC:add a user directory when the rpc user directory does not exist
|
||||
|
||||
* Mon Mar 27 2023 wangqing <wangqing151@huawei.com> - 1.2.6-5
|
||||
- Type:bugfix
|
||||
- Id:NA
|
||||
- SUG:NA
|
||||
- DESC:add macro WITHOUT_SYSTEMD to relieve dependence on systemd
|
||||
|
||||
* Wed Mar 30 2022 kircher <majun65@huawei.com> - 1.2.6-4
|
||||
- Type:bugfix
|
||||
- Id:NA
|
||||
- SUG:NA
|
||||
- DESC:enable rmt-calls with -r
|
||||
|
||||
* Mon Feb 28 2022 quanhongfei <quanhongfei@h-partners.com> - 1.2.6-3
|
||||
- Type:bugfix
|
||||
- Id:NA
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
#
|
||||
# Optional arguments passed to rpcbind. See rpcbind(8)
|
||||
RPCBIND_ARGS=""
|
||||
RPCBIND_OPTIONS="-r"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user