forked from rpms/rpcbind
Updated to latest upstream RC release: rpcbind-0_2_5-rc3 (bz 1431574)
Signed-off-by: Steve Dickson <steved@redhat.com>
This commit is contained in:
parent
714e2e90f5
commit
9ac2b925ab
@ -1,12 +1,11 @@
|
|||||||
diff -up rpcbind-0.2.3/systemd/rpcbind.service.in.orig rpcbind-0.2.3/systemd/rpcbind.service.in
|
diff -up rpcbind-0.2.4/systemd/rpcbind.service.in.orig rpcbind-0.2.4/systemd/rpcbind.service.in
|
||||||
--- rpcbind-0.2.3/systemd/rpcbind.service.in.orig 2016-11-07 14:45:17.440658739 -0500
|
--- rpcbind-0.2.4/systemd/rpcbind.service.in.orig 2017-12-16 15:49:07.830889473 -0500
|
||||||
+++ rpcbind-0.2.3/systemd/rpcbind.service.in 2016-11-07 14:46:50.968844715 -0500
|
+++ rpcbind-0.2.4/systemd/rpcbind.service.in 2017-12-16 15:49:43.156610673 -0500
|
||||||
@@ -10,7 +10,7 @@ After=rpcbind.socket
|
@@ -12,6 +12,7 @@ Wants=rpcbind.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=notify
|
Type=notify
|
||||||
-# distro can provide a drop-in adding EnvironmentFile=-/??? if needed.
|
# distro can provide a drop-in adding EnvironmentFile=-/??? if needed.
|
||||||
+EnvironmentFile=/etc/sysconfig/rpcbind
|
+EnvironmentFile=/etc/sysconfig/rpcbind
|
||||||
ExecStart=@_bindir@/rpcbind $RPCBIND_OPTIONS -w -f
|
ExecStart=@_sbindir@/rpcbind $RPCBIND_OPTIONS -w -f
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
@ -1,34 +1,6 @@
|
|||||||
commit b47e0f12cfa005bb120e018257410663efbd7254
|
diff -up rpcbind-0.2.4/configure.ac.orig rpcbind-0.2.4/configure.ac
|
||||||
Author: Steve Dickson <steved@redhat.com>
|
--- rpcbind-0.2.4/configure.ac.orig 2017-12-16 15:52:22.774298138 -0500
|
||||||
Date: Tue Nov 15 13:32:40 2016 -0500
|
+++ rpcbind-0.2.4/configure.ac 2017-12-16 15:52:45.301075188 -0500
|
||||||
|
|
||||||
Use systemd-tmpfiles to create the warmstart directory
|
|
||||||
|
|
||||||
When systemd is available have it create the /run/rpcbind
|
|
||||||
warmstart directory. Note, the new rpcbind.conf file
|
|
||||||
expects 'rpc' user and group since that those will be
|
|
||||||
the id/gid that will own the directory.
|
|
||||||
|
|
||||||
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
||||||
|
|
||||||
diff --git a/Makefile.am b/Makefile.am
|
|
||||||
index 43c2710..d7ca426 100644
|
|
||||||
--- a/Makefile.am
|
|
||||||
+++ b/Makefile.am
|
|
||||||
@@ -54,6 +54,9 @@ rpcbind_LDADD += $(SYSTEMD_LIBS)
|
|
||||||
systemdsystemunit_DATA = \
|
|
||||||
systemd/rpcbind.service \
|
|
||||||
systemd/rpcbind.socket
|
|
||||||
+
|
|
||||||
+systemdtmpfiles_DATA = \
|
|
||||||
+ systemd/rpcbind.conf
|
|
||||||
endif
|
|
||||||
|
|
||||||
rpcinfo_SOURCES = src/rpcinfo.c
|
|
||||||
diff --git a/configure.ac b/configure.ac
|
|
||||||
index acc6914..81adafc 100644
|
|
||||||
--- a/configure.ac
|
|
||||||
+++ b/configure.ac
|
|
||||||
@@ -52,6 +52,17 @@ AC_ARG_WITH([systemdsystemunitdir],
|
@@ -52,6 +52,17 @@ AC_ARG_WITH([systemdsystemunitdir],
|
||||||
fi
|
fi
|
||||||
AM_CONDITIONAL(SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
|
AM_CONDITIONAL(SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
|
||||||
@ -47,11 +19,22 @@ index acc6914..81adafc 100644
|
|||||||
AS_IF([test x$enable_libwrap = xyes], [
|
AS_IF([test x$enable_libwrap = xyes], [
|
||||||
AC_CHECK_LIB([wrap], [hosts_access], ,
|
AC_CHECK_LIB([wrap], [hosts_access], ,
|
||||||
AC_MSG_ERROR([libwrap support requested but unable to find libwrap]))
|
AC_MSG_ERROR([libwrap support requested but unable to find libwrap]))
|
||||||
diff --git a/systemd/rpcbind.conf b/systemd/rpcbind.conf
|
diff -up rpcbind-0.2.4/Makefile.am.orig rpcbind-0.2.4/Makefile.am
|
||||||
new file mode 100644
|
--- rpcbind-0.2.4/Makefile.am.orig 2017-12-16 15:52:22.774298138 -0500
|
||||||
index 0000000..2f8af45
|
+++ rpcbind-0.2.4/Makefile.am 2017-12-16 15:52:45.301075188 -0500
|
||||||
--- /dev/null
|
@@ -55,6 +55,9 @@ rpcbind_LDADD += $(SYSTEMD_LIBS)
|
||||||
+++ b/systemd/rpcbind.conf
|
systemdsystemunit_DATA = \
|
||||||
|
systemd/rpcbind.service \
|
||||||
|
systemd/rpcbind.socket
|
||||||
|
+
|
||||||
|
+systemdtmpfiles_DATA = \
|
||||||
|
+ systemd/rpcbind.conf
|
||||||
|
endif
|
||||||
|
|
||||||
|
rpcinfo_SOURCES = src/rpcinfo.c
|
||||||
|
diff -up rpcbind-0.2.4/systemd/rpcbind.conf.orig rpcbind-0.2.4/systemd/rpcbind.conf
|
||||||
|
--- rpcbind-0.2.4/systemd/rpcbind.conf.orig 2017-12-16 15:52:45.301075188 -0500
|
||||||
|
+++ rpcbind-0.2.4/systemd/rpcbind.conf 2017-12-16 15:52:45.301075188 -0500
|
||||||
@@ -0,0 +1,2 @@
|
@@ -0,0 +1,2 @@
|
||||||
+#Type Path Mode UID GID Age Argument
|
+#Type Path Mode UID GID Age Argument
|
||||||
+D /run/rpcbind 0700 rpc rpc - -
|
+D /run/rpcbind 0700 rpc rpc - -
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
diff -up rpcbind-0.2.4/configure.ac.orig rpcbind-0.2.4/configure.ac
|
diff -up rpcbind-0.2.4/configure.ac.orig rpcbind-0.2.4/configure.ac
|
||||||
--- rpcbind-0.2.4/configure.ac.orig 2017-01-03 13:51:48.426758826 -0500
|
--- rpcbind-0.2.4/configure.ac.orig 2017-12-16 15:53:47.253462041 -0500
|
||||||
+++ rpcbind-0.2.4/configure.ac 2017-01-16 11:19:12.888958858 -0500
|
+++ rpcbind-0.2.4/configure.ac 2017-12-16 15:54:01.089325106 -0500
|
||||||
@@ -22,8 +22,8 @@ AC_ARG_ENABLE([warmstarts],
|
@@ -22,8 +22,8 @@ AC_ARG_ENABLE([warmstarts],
|
||||||
AM_CONDITIONAL(WARMSTART, test x$enable_warmstarts = xyes)
|
AM_CONDITIONAL(WARMSTART, test x$enable_warmstarts = xyes)
|
||||||
|
|
||||||
@ -13,9 +13,9 @@ diff -up rpcbind-0.2.4/configure.ac.orig rpcbind-0.2.4/configure.ac
|
|||||||
|
|
||||||
AC_ARG_WITH([rpcuser],
|
AC_ARG_WITH([rpcuser],
|
||||||
diff -up rpcbind-0.2.4/configure.orig rpcbind-0.2.4/configure
|
diff -up rpcbind-0.2.4/configure.orig rpcbind-0.2.4/configure
|
||||||
--- rpcbind-0.2.4/configure.orig 2017-01-03 13:51:50.222749413 -0500
|
--- rpcbind-0.2.4/configure.orig 2016-11-30 09:03:59.000000000 -0500
|
||||||
+++ rpcbind-0.2.4/configure 2017-01-16 11:20:29.650978018 -0500
|
+++ rpcbind-0.2.4/configure 2017-12-16 15:54:01.091325086 -0500
|
||||||
@@ -1389,7 +1389,7 @@ Optional Features:
|
@@ -1387,7 +1387,7 @@ Optional Features:
|
||||||
Optional Packages:
|
Optional Packages:
|
||||||
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
|
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
|
||||||
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
|
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
|
||||||
@ -24,7 +24,7 @@ diff -up rpcbind-0.2.4/configure.orig rpcbind-0.2.4/configure
|
|||||||
|
|
||||||
--with-rpcuser=ARG use ARG for RPC [default=root]
|
--with-rpcuser=ARG use ARG for RPC [default=root]
|
||||||
|
|
||||||
@@ -3887,7 +3887,7 @@ fi
|
@@ -3883,7 +3883,7 @@ fi
|
||||||
if test "${with_statedir+set}" = set; then :
|
if test "${with_statedir+set}" = set; then :
|
||||||
withval=$with_statedir;
|
withval=$with_statedir;
|
||||||
else
|
else
|
||||||
@ -35,7 +35,7 @@ diff -up rpcbind-0.2.4/configure.orig rpcbind-0.2.4/configure
|
|||||||
statedir=$with_statedir
|
statedir=$with_statedir
|
||||||
diff -up rpcbind-0.2.4/man/rpcbind-fr.8.orig rpcbind-0.2.4/man/rpcbind-fr.8
|
diff -up rpcbind-0.2.4/man/rpcbind-fr.8.orig rpcbind-0.2.4/man/rpcbind-fr.8
|
||||||
--- rpcbind-0.2.4/man/rpcbind-fr.8.orig 2016-11-28 15:47:28.000000000 -0500
|
--- rpcbind-0.2.4/man/rpcbind-fr.8.orig 2016-11-28 15:47:28.000000000 -0500
|
||||||
+++ rpcbind-0.2.4/man/rpcbind-fr.8 2017-01-16 11:19:12.888958858 -0500
|
+++ rpcbind-0.2.4/man/rpcbind-fr.8 2017-12-16 15:54:01.091325086 -0500
|
||||||
@@ -138,8 +138,8 @@ est redémarré.
|
@@ -138,8 +138,8 @@ est redémarré.
|
||||||
.Xr rpcbind 3 ,
|
.Xr rpcbind 3 ,
|
||||||
.Xr rpcinfo 8
|
.Xr rpcinfo 8
|
||||||
@ -49,7 +49,7 @@ diff -up rpcbind-0.2.4/man/rpcbind-fr.8.orig rpcbind-0.2.4/man/rpcbind-fr.8
|
|||||||
.El
|
.El
|
||||||
diff -up rpcbind-0.2.4/src/rpcbind.c.orig rpcbind-0.2.4/src/rpcbind.c
|
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 2016-11-28 15:47:28.000000000 -0500
|
--- rpcbind-0.2.4/src/rpcbind.c.orig 2016-11-28 15:47:28.000000000 -0500
|
||||||
+++ rpcbind-0.2.4/src/rpcbind.c 2017-01-16 11:20:16.499974736 -0500
|
+++ rpcbind-0.2.4/src/rpcbind.c 2017-12-16 15:54:01.092325076 -0500
|
||||||
@@ -106,7 +106,7 @@ char *nss_modules = "files";
|
@@ -106,7 +106,7 @@ char *nss_modules = "files";
|
||||||
/* who to suid to if -s is given */
|
/* who to suid to if -s is given */
|
||||||
#define RUN_AS "daemon"
|
#define RUN_AS "daemon"
|
||||||
|
@ -1,14 +1,13 @@
|
|||||||
diff -up rpcbind-0.2.4/systemd/rpcbind.service.in.orig rpcbind-0.2.4/systemd/rpcbind.service.in
|
diff -up rpcbind-0.2.4/systemd/rpcbind.service.in.orig rpcbind-0.2.4/systemd/rpcbind.service.in
|
||||||
--- rpcbind-0.2.4/systemd/rpcbind.service.in.orig 2017-01-28 11:47:59.505282030 -0500
|
--- rpcbind-0.2.4/systemd/rpcbind.service.in.orig 2017-12-16 15:46:12.896270101 -0500
|
||||||
+++ rpcbind-0.2.4/systemd/rpcbind.service.in 2017-01-28 13:13:43.763324301 -0500
|
+++ rpcbind-0.2.4/systemd/rpcbind.service.in 2017-12-16 15:46:43.672027210 -0500
|
||||||
@@ -6,8 +6,8 @@ RequiresMountsFor=@statedir@
|
@@ -7,7 +7,8 @@ RequiresMountsFor=@statedir@
|
||||||
|
|
||||||
# Make sure we use the IP addresses listed for
|
# Make sure we use the IP addresses listed for
|
||||||
# rpcbind.socket, no matter how this unit is started.
|
# rpcbind.socket, no matter how this unit is started.
|
||||||
-Wants=rpcbind.socket
|
Requires=rpcbind.socket
|
||||||
-After=rpcbind.socket
|
-Wants=rpcbind.target
|
||||||
+Wants=rpcbind.socket systemd-tmpfiles-setup.service
|
+Wants=rpcbind.target systemd-tmpfiles-setup.service
|
||||||
+After=rpcbind.socket systemd-tmpfiles-setup.service
|
+After=systemd-tmpfiles-setup.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=notify
|
Type=notify
|
||||||
|
362
rpcbind-0.2.5-rc3.patch
Normal file
362
rpcbind-0.2.5-rc3.patch
Normal file
@ -0,0 +1,362 @@
|
|||||||
|
diff --git a/Makefile.am b/Makefile.am
|
||||||
|
index 43c2710..c160a95 100644
|
||||||
|
--- a/Makefile.am
|
||||||
|
+++ b/Makefile.am
|
||||||
|
@@ -29,7 +29,8 @@ if LIBWRAP
|
||||||
|
AM_CPPFLAGS += -DLIBWRAP
|
||||||
|
endif
|
||||||
|
|
||||||
|
-bin_PROGRAMS = rpcbind rpcinfo
|
||||||
|
+bin_PROGRAMS = rpcinfo
|
||||||
|
+sbin_PROGRAMS = rpcbind
|
||||||
|
|
||||||
|
rpcbind_SOURCES = \
|
||||||
|
src/check_bound.c \
|
||||||
|
diff --git a/configure.ac b/configure.ac
|
||||||
|
index 3790310..359a418 100644
|
||||||
|
--- a/configure.ac
|
||||||
|
+++ b/configure.ac
|
||||||
|
@@ -61,9 +61,9 @@ AC_SEARCH_LIBS([pthread_create], [pthread])
|
||||||
|
|
||||||
|
AC_CHECK_HEADERS([nss.h rpcsvc/mount.h])
|
||||||
|
|
||||||
|
-# make bindir available for substitution in config file
|
||||||
|
+# make sbindir available for substitution in config file
|
||||||
|
# 2 "evals" needed to expand variable names
|
||||||
|
-AC_SUBST([_bindir])
|
||||||
|
-AC_CONFIG_COMMANDS_PRE([eval eval _bindir=$bindir])
|
||||||
|
+AC_SUBST([_sbindir])
|
||||||
|
+AC_CONFIG_COMMANDS_PRE([eval eval _sbindir=$sbindir])
|
||||||
|
|
||||||
|
AC_OUTPUT([Makefile systemd/rpcbind.service])
|
||||||
|
diff --git a/src/pmap_svc.c b/src/pmap_svc.c
|
||||||
|
index 4c744fe..a53dd5f 100644
|
||||||
|
--- a/src/pmap_svc.c
|
||||||
|
+++ b/src/pmap_svc.c
|
||||||
|
@@ -175,6 +175,7 @@ pmapproc_change(struct svc_req *rqstp /*__unused*/, SVCXPRT *xprt, unsigned long
|
||||||
|
long ans;
|
||||||
|
uid_t uid;
|
||||||
|
char uidbuf[32];
|
||||||
|
+ int rc = TRUE;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Can't use getpwnam here. We might end up calling ourselves
|
||||||
|
@@ -194,7 +195,8 @@ pmapproc_change(struct svc_req *rqstp /*__unused*/, SVCXPRT *xprt, unsigned long
|
||||||
|
|
||||||
|
if (!svc_getargs(xprt, (xdrproc_t) xdr_pmap, (char *)®)) {
|
||||||
|
svcerr_decode(xprt);
|
||||||
|
- return (FALSE);
|
||||||
|
+ rc = FALSE;
|
||||||
|
+ goto done;
|
||||||
|
}
|
||||||
|
#ifdef RPCBIND_DEBUG
|
||||||
|
if (debugging)
|
||||||
|
@@ -205,7 +207,8 @@ pmapproc_change(struct svc_req *rqstp /*__unused*/, SVCXPRT *xprt, unsigned long
|
||||||
|
|
||||||
|
if (!check_access(xprt, op, reg.pm_prog, PMAPVERS)) {
|
||||||
|
svcerr_weakauth(xprt);
|
||||||
|
- return (FALSE);
|
||||||
|
+ rc = (FALSE);
|
||||||
|
+ goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
rpcbreg.r_prog = reg.pm_prog;
|
||||||
|
@@ -258,7 +261,18 @@ done_change:
|
||||||
|
rpcbs_set(RPCBVERS_2_STAT, ans);
|
||||||
|
else
|
||||||
|
rpcbs_unset(RPCBVERS_2_STAT, ans);
|
||||||
|
- return (TRUE);
|
||||||
|
+done:
|
||||||
|
+ if (!svc_freeargs(xprt, (xdrproc_t) xdr_pmap, (char *)®)) {
|
||||||
|
+#ifdef RPCBIND_DEBUG
|
||||||
|
+ if (debugging) {
|
||||||
|
+ (void) xlog(LOG_DEBUG, "unable to free arguments\n");
|
||||||
|
+ if (doabort) {
|
||||||
|
+ rpcbind_abort();
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+#endif
|
||||||
|
+ }
|
||||||
|
+ return (rc);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ARGSUSED */
|
||||||
|
@@ -272,15 +286,18 @@ pmapproc_getport(struct svc_req *rqstp /*__unused*/, SVCXPRT *xprt)
|
||||||
|
#ifdef RPCBIND_DEBUG
|
||||||
|
char *uaddr;
|
||||||
|
#endif
|
||||||
|
+ int rc = TRUE;
|
||||||
|
|
||||||
|
if (!svc_getargs(xprt, (xdrproc_t) xdr_pmap, (char *)®)) {
|
||||||
|
svcerr_decode(xprt);
|
||||||
|
- return (FALSE);
|
||||||
|
+ rc = FALSE;
|
||||||
|
+ goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!check_access(xprt, PMAPPROC_GETPORT, reg.pm_prog, PMAPVERS)) {
|
||||||
|
svcerr_weakauth(xprt);
|
||||||
|
- return FALSE;
|
||||||
|
+ rc = FALSE;
|
||||||
|
+ goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef RPCBIND_DEBUG
|
||||||
|
@@ -330,21 +347,36 @@ pmapproc_getport(struct svc_req *rqstp /*__unused*/, SVCXPRT *xprt)
|
||||||
|
pmap_ipprot2netid(reg.pm_prot) ?: "<unknown>",
|
||||||
|
port ? udptrans : "");
|
||||||
|
|
||||||
|
- return (TRUE);
|
||||||
|
+done:
|
||||||
|
+ if (!svc_freeargs(xprt, (xdrproc_t) xdr_pmap, (char *)®)) {
|
||||||
|
+#ifdef RPCBIND_DEBUG
|
||||||
|
+ if (debugging) {
|
||||||
|
+ (void) xlog(LOG_DEBUG, "unable to free arguments\n");
|
||||||
|
+ if (doabort) {
|
||||||
|
+ rpcbind_abort();
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+#endif
|
||||||
|
+ }
|
||||||
|
+ return (rc);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ARGSUSED */
|
||||||
|
static bool_t
|
||||||
|
pmapproc_dump(struct svc_req *rqstp /*__unused*/, SVCXPRT *xprt)
|
||||||
|
{
|
||||||
|
+ int rc = TRUE;
|
||||||
|
+
|
||||||
|
if (!svc_getargs(xprt, (xdrproc_t)xdr_void, NULL)) {
|
||||||
|
svcerr_decode(xprt);
|
||||||
|
- return (FALSE);
|
||||||
|
+ rc = FALSE;
|
||||||
|
+ goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!check_access(xprt, PMAPPROC_DUMP, 0, PMAPVERS)) {
|
||||||
|
svcerr_weakauth(xprt);
|
||||||
|
- return FALSE;
|
||||||
|
+ rc = FALSE;
|
||||||
|
+ goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((!svc_sendreply(xprt, (xdrproc_t) xdr_pmaplist_ptr,
|
||||||
|
@@ -354,7 +386,19 @@ pmapproc_dump(struct svc_req *rqstp /*__unused*/, SVCXPRT *xprt)
|
||||||
|
rpcbind_abort();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
- return (TRUE);
|
||||||
|
+
|
||||||
|
+done:
|
||||||
|
+ if (!svc_freeargs(xprt, (xdrproc_t) xdr_void, (char *)NULL)) {
|
||||||
|
+#ifdef RPCBIND_DEBUG
|
||||||
|
+ if (debugging) {
|
||||||
|
+ (void) xlog(LOG_DEBUG, "unable to free arguments\n");
|
||||||
|
+ if (doabort) {
|
||||||
|
+ rpcbind_abort();
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+#endif
|
||||||
|
+ }
|
||||||
|
+ return (rc);
|
||||||
|
}
|
||||||
|
|
||||||
|
int pmap_netid2ipprot(const char *netid)
|
||||||
|
diff --git a/src/rpcb_svc.c b/src/rpcb_svc.c
|
||||||
|
index 709e3fb..091f530 100644
|
||||||
|
--- a/src/rpcb_svc.c
|
||||||
|
+++ b/src/rpcb_svc.c
|
||||||
|
@@ -166,7 +166,7 @@ rpcb_service_3(struct svc_req *rqstp, SVCXPRT *transp)
|
||||||
|
svcerr_decode(transp);
|
||||||
|
if (debugging)
|
||||||
|
(void) xlog(LOG_DEBUG, "rpcbind: could not decode");
|
||||||
|
- return;
|
||||||
|
+ goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rqstp->rq_proc == RPCBPROC_SET
|
||||||
|
diff --git a/src/rpcb_svc_4.c b/src/rpcb_svc_4.c
|
||||||
|
index 5094879..eebbbbe 100644
|
||||||
|
--- a/src/rpcb_svc_4.c
|
||||||
|
+++ b/src/rpcb_svc_4.c
|
||||||
|
@@ -218,7 +218,7 @@ rpcb_service_4(struct svc_req *rqstp, SVCXPRT *transp)
|
||||||
|
svcerr_decode(transp);
|
||||||
|
if (debugging)
|
||||||
|
(void) xlog(LOG_DEBUG, "rpcbind: could not decode\n");
|
||||||
|
- return;
|
||||||
|
+ goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rqstp->rq_proc == RPCBPROC_SET
|
||||||
|
diff --git a/src/rpcb_svc_com.c b/src/rpcb_svc_com.c
|
||||||
|
index 5862c26..9c1c3af 100644
|
||||||
|
--- a/src/rpcb_svc_com.c
|
||||||
|
+++ b/src/rpcb_svc_com.c
|
||||||
|
@@ -612,9 +612,7 @@ rpcbproc_callit_com(struct svc_req *rqstp, SVCXPRT *transp,
|
||||||
|
struct netconfig *nconf;
|
||||||
|
struct netbuf *caller;
|
||||||
|
struct r_rmtcall_args a;
|
||||||
|
- char *buf_alloc = NULL, *outbufp;
|
||||||
|
- char *outbuf_alloc = NULL;
|
||||||
|
- char buf[RPC_BUF_MAX], outbuf[RPC_BUF_MAX];
|
||||||
|
+ char outbuf[RPC_BUF_MAX];
|
||||||
|
struct netbuf *na = (struct netbuf *) NULL;
|
||||||
|
struct rpc_msg call_msg;
|
||||||
|
int outlen;
|
||||||
|
@@ -635,36 +633,10 @@ rpcbproc_callit_com(struct svc_req *rqstp, SVCXPRT *transp,
|
||||||
|
}
|
||||||
|
if (si.si_socktype != SOCK_DGRAM)
|
||||||
|
return; /* Only datagram type accepted */
|
||||||
|
- sendsz = __rpc_get_t_size(si.si_af, si.si_proto, UDPMSGSIZE);
|
||||||
|
- if (sendsz == 0) { /* data transfer not supported */
|
||||||
|
- if (reply_type == RPCBPROC_INDIRECT)
|
||||||
|
- svcerr_systemerr(transp);
|
||||||
|
- return;
|
||||||
|
- }
|
||||||
|
- /*
|
||||||
|
- * Should be multiple of 4 for XDR.
|
||||||
|
- */
|
||||||
|
- sendsz = ((sendsz + 3) / 4) * 4;
|
||||||
|
- if (sendsz > RPC_BUF_MAX) {
|
||||||
|
-#ifdef notyet
|
||||||
|
- buf_alloc = alloca(sendsz); /* not in IDR2? */
|
||||||
|
-#else
|
||||||
|
- buf_alloc = malloc(sendsz);
|
||||||
|
-#endif /* notyet */
|
||||||
|
- if (buf_alloc == NULL) {
|
||||||
|
- if (debugging)
|
||||||
|
- xlog(LOG_DEBUG,
|
||||||
|
- "rpcbproc_callit_com: No Memory!\n");
|
||||||
|
- if (reply_type == RPCBPROC_INDIRECT)
|
||||||
|
- svcerr_systemerr(transp);
|
||||||
|
- return;
|
||||||
|
- }
|
||||||
|
- a.rmt_args.args = buf_alloc;
|
||||||
|
- } else {
|
||||||
|
- a.rmt_args.args = buf;
|
||||||
|
- }
|
||||||
|
+ sendsz = UDPMSGSIZE;
|
||||||
|
|
||||||
|
call_msg.rm_xid = 0; /* For error checking purposes */
|
||||||
|
+ memset(&a, 0, sizeof(a)); /* Zero out the input buffer */
|
||||||
|
if (!svc_getargs(transp, (xdrproc_t) xdr_rmtcall_args, (char *) &a)) {
|
||||||
|
if (reply_type == RPCBPROC_INDIRECT)
|
||||||
|
svcerr_decode(transp);
|
||||||
|
@@ -700,11 +672,11 @@ rpcbproc_callit_com(struct svc_req *rqstp, SVCXPRT *transp,
|
||||||
|
|
||||||
|
rpcbs_rmtcall(versnum - 2, reply_type, a.rmt_prog, a.rmt_vers,
|
||||||
|
a.rmt_proc, transp->xp_netid, rbl);
|
||||||
|
-
|
||||||
|
if (rbl == (rpcblist_ptr)NULL) {
|
||||||
|
#ifdef RPCBIND_DEBUG
|
||||||
|
if (debugging)
|
||||||
|
- xlog(LOG_DEBUG, "not found\n");
|
||||||
|
+ xlog(LOG_DEBUG, "prog %lu vers %lu: not found\n",
|
||||||
|
+ a.rmt_prog, a.rmt_vers);
|
||||||
|
#endif
|
||||||
|
if (reply_type == RPCBPROC_INDIRECT)
|
||||||
|
svcerr_noprog(transp);
|
||||||
|
@@ -818,24 +790,10 @@ rpcbproc_callit_com(struct svc_req *rqstp, SVCXPRT *transp,
|
||||||
|
call_msg.rm_call.cb_rpcvers = RPC_MSG_VERSION;
|
||||||
|
call_msg.rm_call.cb_prog = a.rmt_prog;
|
||||||
|
call_msg.rm_call.cb_vers = a.rmt_vers;
|
||||||
|
- if (sendsz > RPC_BUF_MAX) {
|
||||||
|
-#ifdef notyet
|
||||||
|
- outbuf_alloc = alloca(sendsz); /* not in IDR2? */
|
||||||
|
-#else
|
||||||
|
- outbuf_alloc = malloc(sendsz);
|
||||||
|
-#endif /* notyet */
|
||||||
|
- if (outbuf_alloc == NULL) {
|
||||||
|
- if (reply_type == RPCBPROC_INDIRECT)
|
||||||
|
- svcerr_systemerr(transp);
|
||||||
|
- if (debugging)
|
||||||
|
- xlog(LOG_DEBUG,
|
||||||
|
- "rpcbproc_callit_com: No memory!\n");
|
||||||
|
- goto error;
|
||||||
|
- }
|
||||||
|
- xdrmem_create(&outxdr, outbuf_alloc, sendsz, XDR_ENCODE);
|
||||||
|
- } else {
|
||||||
|
- xdrmem_create(&outxdr, outbuf, sendsz, XDR_ENCODE);
|
||||||
|
- }
|
||||||
|
+
|
||||||
|
+ memset(outbuf, '\0', sendsz); /* Zero out the output buffer */
|
||||||
|
+ xdrmem_create(&outxdr, outbuf, sendsz, XDR_ENCODE);
|
||||||
|
+
|
||||||
|
if (!xdr_callhdr(&outxdr, &call_msg)) {
|
||||||
|
if (reply_type == RPCBPROC_INDIRECT)
|
||||||
|
svcerr_systemerr(transp);
|
||||||
|
@@ -900,10 +858,6 @@ rpcbproc_callit_com(struct svc_req *rqstp, SVCXPRT *transp,
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
outlen = (int) XDR_GETPOS(&outxdr);
|
||||||
|
- if (outbuf_alloc)
|
||||||
|
- outbufp = outbuf_alloc;
|
||||||
|
- else
|
||||||
|
- outbufp = outbuf;
|
||||||
|
|
||||||
|
na = uaddr2taddr(nconf, local_uaddr);
|
||||||
|
if (!na) {
|
||||||
|
@@ -912,7 +866,7 @@ rpcbproc_callit_com(struct svc_req *rqstp, SVCXPRT *transp,
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (sendto(fd, outbufp, outlen, 0, (struct sockaddr *)na->buf, na->len)
|
||||||
|
+ if (sendto(fd, outbuf, outlen, 0, (struct sockaddr *)na->buf, na->len)
|
||||||
|
!= outlen) {
|
||||||
|
if (debugging)
|
||||||
|
xlog(LOG_DEBUG,
|
||||||
|
@@ -927,12 +881,16 @@ error:
|
||||||
|
if (call_msg.rm_xid != 0)
|
||||||
|
(void) free_slot_by_xid(call_msg.rm_xid);
|
||||||
|
out:
|
||||||
|
+ if (!svc_freeargs(transp, (xdrproc_t) xdr_rmtcall_args, (char *) &a)) {
|
||||||
|
+ if (debugging) {
|
||||||
|
+ (void) xlog(LOG_DEBUG, "unable to free arguments\n");
|
||||||
|
+ if (doabort) {
|
||||||
|
+ rpcbind_abort();
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
if (local_uaddr)
|
||||||
|
free(local_uaddr);
|
||||||
|
- if (buf_alloc)
|
||||||
|
- free(buf_alloc);
|
||||||
|
- if (outbuf_alloc)
|
||||||
|
- free(outbuf_alloc);
|
||||||
|
if (na) {
|
||||||
|
free(na->buf);
|
||||||
|
free(na);
|
||||||
|
@@ -1094,7 +1052,6 @@ void
|
||||||
|
my_svc_run()
|
||||||
|
{
|
||||||
|
int poll_ret, check_ret;
|
||||||
|
- int n;
|
||||||
|
|
||||||
|
for (;;) {
|
||||||
|
struct pollfd my_pollfd[svc_max_pollfd];
|
||||||
|
diff --git a/systemd/rpcbind.service.in b/systemd/rpcbind.service.in
|
||||||
|
index e7e86da..7b1c74b 100644
|
||||||
|
--- a/systemd/rpcbind.service.in
|
||||||
|
+++ b/systemd/rpcbind.service.in
|
||||||
|
@@ -2,16 +2,17 @@
|
||||||
|
Description=RPC Bind
|
||||||
|
Documentation=man:rpcbind(8)
|
||||||
|
DefaultDependencies=no
|
||||||
|
+RequiresMountsFor=@statedir@
|
||||||
|
|
||||||
|
# Make sure we use the IP addresses listed for
|
||||||
|
# rpcbind.socket, no matter how this unit is started.
|
||||||
|
-Wants=rpcbind.socket
|
||||||
|
-After=rpcbind.socket
|
||||||
|
+Requires=rpcbind.socket
|
||||||
|
+Wants=rpcbind.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=notify
|
||||||
|
# distro can provide a drop-in adding EnvironmentFile=-/??? if needed.
|
||||||
|
-ExecStart=@_bindir@/rpcbind $RPCBIND_OPTIONS -w -f
|
||||||
|
+ExecStart=@_sbindir@/rpcbind $RPCBIND_OPTIONS -w -f
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
Name: rpcbind
|
Name: rpcbind
|
||||||
Version: 0.2.4
|
Version: 0.2.4
|
||||||
Release: 8.rc2%{?dist}
|
Release: 8.rc3%{?dist}
|
||||||
Summary: Universal Addresses to RPC Program Number Mapper
|
Summary: Universal Addresses to RPC Program Number Mapper
|
||||||
Group: System Environment/Daemons
|
Group: System Environment/Daemons
|
||||||
License: BSD
|
License: BSD
|
||||||
@ -23,7 +23,7 @@ Requires(post): chkconfig systemd
|
|||||||
Requires(preun): systemd
|
Requires(preun): systemd
|
||||||
Requires(postun): systemd coreutils
|
Requires(postun): systemd coreutils
|
||||||
|
|
||||||
Patch001: rpcbind-0.2.5-rc2.patch
|
Patch001: rpcbind-0.2.5-rc3.patch
|
||||||
|
|
||||||
Patch100: rpcbind-0.2.3-systemd-envfile.patch
|
Patch100: rpcbind-0.2.3-systemd-envfile.patch
|
||||||
Patch101: rpcbind-0.2.3-systemd-tmpfiles.patch
|
Patch101: rpcbind-0.2.3-systemd-tmpfiles.patch
|
||||||
@ -66,6 +66,7 @@ autoreconf -fisv
|
|||||||
--with-statedir="%rpcbind_state_dir" \
|
--with-statedir="%rpcbind_state_dir" \
|
||||||
--with-rpcuser="%rpcbind_user_group" \
|
--with-rpcuser="%rpcbind_user_group" \
|
||||||
--with-nss-modules="files altfiles" \
|
--with-nss-modules="files altfiles" \
|
||||||
|
--sbindir=%{_bindir} \
|
||||||
--enable-libwrap \
|
--enable-libwrap \
|
||||||
--enable-debug
|
--enable-debug
|
||||||
|
|
||||||
@ -143,6 +144,9 @@ fi
|
|||||||
%attr(0700, %{rpcbind_user_group}, %{rpcbind_user_group}) %dir %{rpcbind_state_dir}
|
%attr(0700, %{rpcbind_user_group}, %{rpcbind_user_group}) %dir %{rpcbind_state_dir}
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Sat Dec 16 2017 Steve Dickson <steved@redhat.com> - 0.2.4-8.rc3
|
||||||
|
- Updated to latest upstream RC release: rpcbind-0_2_5-rc3 (bz 1431574)
|
||||||
|
|
||||||
* Wed Sep 06 2017 Nils Philippsen <nils@redhat.com> - 0.2.4-8.rc2
|
* Wed Sep 06 2017 Nils Philippsen <nils@redhat.com> - 0.2.4-8.rc2
|
||||||
- create and formally own the state directory so it is available from the time
|
- create and formally own the state directory so it is available from the time
|
||||||
of first installation until reboot
|
of first installation until reboot
|
||||||
|
Loading…
Reference in New Issue
Block a user