Compare commits
36 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
333233b7d5 | ||
|
|
466d52c13d | ||
|
|
03a3b8332e | ||
|
|
71db4a3831 | ||
|
|
33d953ba50 | ||
|
|
58b2707a1d | ||
|
|
38448bc8b7 | ||
|
|
bf5e416b30 | ||
|
|
a2291b98bb | ||
|
|
fc619cdcef | ||
|
|
425689735d | ||
|
|
2376822f36 | ||
|
|
48fb6226ed | ||
|
|
dff6ecad48 | ||
|
|
44324f80ac | ||
|
|
46ccf3be73 | ||
|
|
8dc2f3003d | ||
|
|
c01c84e6ff | ||
|
|
85806f502e | ||
|
|
6101200022 | ||
|
|
f9cc7db67b | ||
|
|
b6cfae01a2 | ||
|
|
e7af3ee141 | ||
|
|
3d509e2d2c | ||
|
|
106cdc1057 | ||
|
|
37c6c9056d | ||
|
|
43178e7a5b | ||
|
|
c31ad06462 | ||
|
|
2fe1941633 | ||
|
|
4ebf00837d | ||
|
|
aefb4fab97 | ||
|
|
eb2280538b | ||
|
|
e371446c90 | ||
|
|
d344d78664 | ||
|
|
aa31180791 | ||
|
|
ce8c000bb1 |
12 changed files with 233 additions and 1013 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -1,4 +1,4 @@
|
||||||
rpcbind-0.2.4
|
|
||||||
/rpcbind-0.2.4.tar.bz2
|
|
||||||
x86_64
|
x86_64
|
||||||
Makefile
|
Makefile
|
||||||
|
rpcbind-1.2.8-build/
|
||||||
|
/rpcbind-1.2.8.tar.bz2
|
||||||
|
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
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-12-16 15:49:07.830889473 -0500
|
|
||||||
+++ rpcbind-0.2.4/systemd/rpcbind.service.in 2017-12-16 15:49:43.156610673 -0500
|
|
||||||
@@ -12,6 +12,7 @@ Wants=rpcbind.target
|
|
||||||
[Service]
|
|
||||||
Type=notify
|
|
||||||
# distro can provide a drop-in adding EnvironmentFile=-/??? if needed.
|
|
||||||
+EnvironmentFile=/etc/sysconfig/rpcbind
|
|
||||||
ExecStart=@_sbindir@/rpcbind $RPCBIND_OPTIONS -w -f
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
diff -up rpcbind-0.2.4/configure.ac.orig rpcbind-0.2.4/configure.ac
|
diff -up rpcbind-1.2.7/configure.ac.orig rpcbind-1.2.7/configure.ac
|
||||||
--- rpcbind-0.2.4/configure.ac.orig 2017-12-16 15:52:22.774298138 -0500
|
--- rpcbind-1.2.7/configure.ac.orig 2024-07-25 11:55:23.000000000 -0400
|
||||||
+++ rpcbind-0.2.4/configure.ac 2017-12-16 15:52:45.301075188 -0500
|
+++ rpcbind-1.2.7/configure.ac 2024-07-25 16:55:38.334208493 -0400
|
||||||
@@ -52,6 +52,17 @@ AC_ARG_WITH([systemdsystemunitdir],
|
@@ -73,6 +73,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 ])
|
||||||
|
|
||||||
|
|
@ -19,10 +19,10 @@ diff -up rpcbind-0.2.4/configure.ac.orig rpcbind-0.2.4/configure.ac
|
||||||
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 -up rpcbind-0.2.4/Makefile.am.orig rpcbind-0.2.4/Makefile.am
|
diff -up rpcbind-1.2.7/Makefile.am.orig rpcbind-1.2.7/Makefile.am
|
||||||
--- rpcbind-0.2.4/Makefile.am.orig 2017-12-16 15:52:22.774298138 -0500
|
--- rpcbind-1.2.7/Makefile.am.orig 2024-07-25 11:55:23.000000000 -0400
|
||||||
+++ rpcbind-0.2.4/Makefile.am 2017-12-16 15:52:45.301075188 -0500
|
+++ rpcbind-1.2.7/Makefile.am 2024-07-25 16:55:38.335208500 -0400
|
||||||
@@ -55,6 +55,9 @@ rpcbind_LDADD += $(SYSTEMD_LIBS)
|
@@ -59,6 +59,9 @@ rpcbind_LDADD += $(SYSTEMD_LIBS)
|
||||||
systemdsystemunit_DATA = \
|
systemdsystemunit_DATA = \
|
||||||
systemd/rpcbind.service \
|
systemd/rpcbind.service \
|
||||||
systemd/rpcbind.socket
|
systemd/rpcbind.socket
|
||||||
|
|
@ -32,9 +32,9 @@ diff -up rpcbind-0.2.4/Makefile.am.orig rpcbind-0.2.4/Makefile.am
|
||||||
endif
|
endif
|
||||||
|
|
||||||
rpcinfo_SOURCES = src/rpcinfo.c
|
rpcinfo_SOURCES = src/rpcinfo.c
|
||||||
diff -up rpcbind-0.2.4/systemd/rpcbind.conf.orig rpcbind-0.2.4/systemd/rpcbind.conf
|
diff -up rpcbind-1.2.7/systemd/rpcbind.conf.orig rpcbind-1.2.7/systemd/rpcbind.conf
|
||||||
--- rpcbind-0.2.4/systemd/rpcbind.conf.orig 2017-12-16 15:52:45.301075188 -0500
|
--- rpcbind-1.2.7/systemd/rpcbind.conf.orig 2024-07-25 16:55:38.335208500 -0400
|
||||||
+++ rpcbind-0.2.4/systemd/rpcbind.conf 2017-12-16 15:52:45.301075188 -0500
|
+++ rpcbind-1.2.7/systemd/rpcbind.conf 2024-07-25 16:55:38.335208500 -0400
|
||||||
@@ -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,61 +0,0 @@
|
||||||
diff -up rpcbind-0.2.4/configure.ac.orig rpcbind-0.2.4/configure.ac
|
|
||||||
--- rpcbind-0.2.4/configure.ac.orig 2017-12-16 15:53:47.253462041 -0500
|
|
||||||
+++ rpcbind-0.2.4/configure.ac 2017-12-16 15:54:01.089325106 -0500
|
|
||||||
@@ -22,8 +22,8 @@ AC_ARG_ENABLE([warmstarts],
|
|
||||||
AM_CONDITIONAL(WARMSTART, test x$enable_warmstarts = xyes)
|
|
||||||
|
|
||||||
AC_ARG_WITH([statedir],
|
|
||||||
- AS_HELP_STRING([--with-statedir=ARG], [use ARG as state dir @<:@default=/var/run/rpcbind@:>@])
|
|
||||||
- ,, [with_statedir=/var/run/rpcbind])
|
|
||||||
+ AS_HELP_STRING([--with-statedir=ARG], [use ARG as state dir @<:@default=/run/rpcbind@:>@])
|
|
||||||
+ ,, [with_statedir=/run/rpcbind])
|
|
||||||
AC_SUBST([statedir], [$with_statedir])
|
|
||||||
|
|
||||||
AC_ARG_WITH([rpcuser],
|
|
||||||
diff -up rpcbind-0.2.4/configure.orig rpcbind-0.2.4/configure
|
|
||||||
--- rpcbind-0.2.4/configure.orig 2016-11-30 09:03:59.000000000 -0500
|
|
||||||
+++ rpcbind-0.2.4/configure 2017-12-16 15:54:01.091325086 -0500
|
|
||||||
@@ -1387,7 +1387,7 @@ Optional Features:
|
|
||||||
Optional Packages:
|
|
||||||
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
|
|
||||||
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
|
|
||||||
- --with-statedir=ARG use ARG as state dir [default=/var/run/rpcbind]
|
|
||||||
+ --with-statedir=ARG use ARG as state dir [default=/run/rpcbind]
|
|
||||||
|
|
||||||
--with-rpcuser=ARG use ARG for RPC [default=root]
|
|
||||||
|
|
||||||
@@ -3883,7 +3883,7 @@ fi
|
|
||||||
if test "${with_statedir+set}" = set; then :
|
|
||||||
withval=$with_statedir;
|
|
||||||
else
|
|
||||||
- with_statedir=/var/run/rpcbind
|
|
||||||
+ with_statedir=/run/rpcbind
|
|
||||||
fi
|
|
||||||
|
|
||||||
statedir=$with_statedir
|
|
||||||
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 2017-12-16 15:54:01.091325086 -0500
|
|
||||||
@@ -138,8 +138,8 @@ est redémarré.
|
|
||||||
.Xr rpcbind 3 ,
|
|
||||||
.Xr rpcinfo 8
|
|
||||||
.Sh FILES
|
|
||||||
-.Bl -tag -width /var/run/rpcbind.sock -compact
|
|
||||||
-.It Pa /var/run/rpcbind.sock
|
|
||||||
+.Bl -tag -width /run/rpcbind.sock -compact
|
|
||||||
+.It Pa /run/rpcbind.sock
|
|
||||||
.Sh TRADUCTION
|
|
||||||
Aurelien CHARBON (Sept 2003)
|
|
||||||
.El
|
|
||||||
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 2017-12-16 15:54:01.092325076 -0500
|
|
||||||
@@ -106,7 +106,7 @@ char *nss_modules = "files";
|
|
||||||
/* who to suid to if -s is given */
|
|
||||||
#define RUN_AS "daemon"
|
|
||||||
|
|
||||||
-#define RPCBINDDLOCK "/var/run/rpcbind.lock"
|
|
||||||
+#define RPCBINDDLOCK RPCBIND_STATEDIR "/rpcbind.lock"
|
|
||||||
|
|
||||||
int runasdaemon = 0;
|
|
||||||
int insecure = 0;
|
|
||||||
|
|
@ -1,16 +1,16 @@
|
||||||
diff -up rpcbind-0.2.4/src/rpcbind.c.orig rpcbind-0.2.4/src/rpcbind.c
|
diff -up rpcbind-1.2.8/src/rpcbind.c.orig rpcbind-1.2.8/src/rpcbind.c
|
||||||
--- rpcbind-0.2.4/src/rpcbind.c.orig 2017-03-21 10:12:35.005190509 -0400
|
--- rpcbind-1.2.8/src/rpcbind.c.orig 2025-07-26 16:57:24.000000000 -0400
|
||||||
+++ rpcbind-0.2.4/src/rpcbind.c 2017-03-21 10:36:45.510507649 -0400
|
+++ rpcbind-1.2.8/src/rpcbind.c 2025-07-26 17:15:51.933467872 -0400
|
||||||
@@ -144,6 +144,8 @@ static void rbllist_add(rpcprog_t, rpcve
|
@@ -214,6 +214,8 @@ static void version()
|
||||||
static void terminate(int);
|
fprintf(stderr, "\n");
|
||||||
static void parseargs(int, char *[]);
|
}
|
||||||
|
|
||||||
+char *systemdtmp = "/usr/bin/systemd-tmpfiles --create rpcbind.conf";
|
+char *systemdtmp = "/usr/bin/systemd-tmpfiles --create rpcbind.conf";
|
||||||
+
|
+
|
||||||
int
|
int
|
||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
@@ -151,13 +153,21 @@ main(int argc, char *argv[])
|
@@ -221,13 +223,21 @@ main(int argc, char *argv[])
|
||||||
void *nc_handle; /* Net config handle */
|
void *nc_handle; /* Net config handle */
|
||||||
struct rlimit rl;
|
struct rlimit rl;
|
||||||
int maxrec = RPC_MAXDATASIZE;
|
int maxrec = RPC_MAXDATASIZE;
|
||||||
|
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
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-12-16 15:46:12.896270101 -0500
|
|
||||||
+++ rpcbind-0.2.4/systemd/rpcbind.service.in 2017-12-16 15:46:43.672027210 -0500
|
|
||||||
@@ -7,7 +7,8 @@ RequiresMountsFor=@statedir@
|
|
||||||
# Make sure we use the IP addresses listed for
|
|
||||||
# rpcbind.socket, no matter how this unit is started.
|
|
||||||
Requires=rpcbind.socket
|
|
||||||
-Wants=rpcbind.target
|
|
||||||
+Wants=rpcbind.target systemd-tmpfiles-setup.service
|
|
||||||
+After=systemd-tmpfiles-setup.service
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=notify
|
|
||||||
|
|
@ -1,185 +0,0 @@
|
||||||
diff --git a/src/pmap_svc.c b/src/pmap_svc.c
|
|
||||||
index 4c744fe..e926cdc 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,16 @@ 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 *)®)) {
|
|
||||||
+ if (debugging) {
|
|
||||||
+ (void) xlog(LOG_DEBUG, "unable to free arguments\n");
|
|
||||||
+ if (doabort) {
|
|
||||||
+ rpcbind_abort();
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ return (rc);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ARGSUSED */
|
|
||||||
@@ -272,15 +284,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 +345,34 @@ 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 *)®)) {
|
|
||||||
+ if (debugging) {
|
|
||||||
+ (void) xlog(LOG_DEBUG, "unable to free arguments\n");
|
|
||||||
+ if (doabort) {
|
|
||||||
+ rpcbind_abort();
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ 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 +382,17 @@ pmapproc_dump(struct svc_req *rqstp /*__unused*/, SVCXPRT *xprt)
|
|
||||||
rpcbind_abort();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
- return (TRUE);
|
|
||||||
+
|
|
||||||
+done:
|
|
||||||
+ if (!svc_freeargs(xprt, (xdrproc_t) xdr_void, (char *)NULL)) {
|
|
||||||
+ if (debugging) {
|
|
||||||
+ (void) xlog(LOG_DEBUG, "unable to free arguments\n");
|
|
||||||
+ if (doabort) {
|
|
||||||
+ rpcbind_abort();
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ 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..cb63afd 100644
|
|
||||||
--- a/src/rpcb_svc_com.c
|
|
||||||
+++ b/src/rpcb_svc_com.c
|
|
||||||
@@ -927,6 +927,14 @@ 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)
|
|
||||||
diff --git a/systemd/rpcbind.service.in b/systemd/rpcbind.service.in
|
|
||||||
index e7e86da..03a9e0b 100644
|
|
||||||
--- a/systemd/rpcbind.service.in
|
|
||||||
+++ b/systemd/rpcbind.service.in
|
|
||||||
@@ -2,6 +2,7 @@
|
|
||||||
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.
|
|
||||||
|
|
@ -1,310 +0,0 @@
|
||||||
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..d36b090 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);
|
|
||||||
diff --git a/systemd/rpcbind.service.in b/systemd/rpcbind.service.in
|
|
||||||
index e7e86da..03a9e0b 100644
|
|
||||||
--- a/systemd/rpcbind.service.in
|
|
||||||
+++ b/systemd/rpcbind.service.in
|
|
||||||
@@ -2,6 +2,7 @@
|
|
||||||
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.
|
|
||||||
|
|
@ -1,362 +0,0 @@
|
||||||
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
|
|
||||||
64
rpcbind-1.2.5-rpcinfo-bufoverflow.patch
Normal file
64
rpcbind-1.2.5-rpcinfo-bufoverflow.patch
Normal file
|
|
@ -0,0 +1,64 @@
|
||||||
|
commit 0bc1c0ae7ce61a7ac8a8e9a9b2086268f011abf0
|
||||||
|
Author: Steve Dickson <steved@redhat.com>
|
||||||
|
Date: Tue Oct 9 09:19:50 2018 -0400
|
||||||
|
|
||||||
|
rpcinfo: Fix stack buffer overflow
|
||||||
|
|
||||||
|
*** buffer overflow detected ***: rpcinfo terminated
|
||||||
|
======= Backtrace: =========
|
||||||
|
/lib64/libc.so.6(+0x721af)[0x7ff24c4451af]
|
||||||
|
/lib64/libc.so.6(__fortify_fail+0x37)[0x7ff24c4ccdc7]
|
||||||
|
/lib64/libc.so.6(+0xf8050)[0x7ff24c4cb050]
|
||||||
|
rpcinfo(+0x435f)[0xef3be2635f]
|
||||||
|
rpcinfo(+0x1c62)[0xef3be23c62]
|
||||||
|
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7ff24c3f36e5]
|
||||||
|
rpcinfo(+0x2739)[0xef3be24739]
|
||||||
|
======= Memory map: ========
|
||||||
|
...
|
||||||
|
The patch below fixes it.
|
||||||
|
|
||||||
|
Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
|
||||||
|
Signed-off-by: Thomas Blume <thomas.blume@suse.com>
|
||||||
|
Signed-off-by: Steve Dickson <steved@redhat.com>
|
||||||
|
|
||||||
|
diff --git a/src/rpcinfo.c b/src/rpcinfo.c
|
||||||
|
index 9b46864..cfdba88 100644
|
||||||
|
--- a/src/rpcinfo.c
|
||||||
|
+++ b/src/rpcinfo.c
|
||||||
|
@@ -973,6 +973,7 @@ rpcbdump (dumptype, netid, argc, argv)
|
||||||
|
(" 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 @@ rpcbdump (dumptype, netid, argc, argv)
|
||||||
|
}
|
||||||
|
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)
|
||||||
198
rpcbind.spec
198
rpcbind.spec
|
|
@ -3,52 +3,53 @@
|
||||||
%global rpcbind_state_dir %{_rundir}/rpcbind
|
%global rpcbind_state_dir %{_rundir}/rpcbind
|
||||||
|
|
||||||
Name: rpcbind
|
Name: rpcbind
|
||||||
Version: 0.2.4
|
Version: 1.2.8
|
||||||
Release: 10.rc3%{?dist}.1
|
Release: 0%{?dist}
|
||||||
Summary: Universal Addresses to RPC Program Number Mapper
|
Summary: Universal Addresses to RPC Program Number Mapper
|
||||||
Group: System Environment/Daemons
|
License: BSD-3-Clause
|
||||||
License: BSD
|
|
||||||
URL: http://nfsv4.bullopensource.org
|
URL: http://nfsv4.bullopensource.org
|
||||||
|
|
||||||
Source0: http://downloads.sourceforge.net/rpcbind/%{name}-%{version}.tar.bz2
|
Source0: http://downloads.sourceforge.net/rpcbind/%{name}-%{version}.tar.bz2
|
||||||
Source1: %{name}.sysconfig
|
Source1: %{name}.sysconfig
|
||||||
|
|
||||||
Requires: glibc-common setup
|
Requires: glibc-common setup
|
||||||
|
Requires: libtirpc >= 1.3.5
|
||||||
Conflicts: man-pages < 2.43-12
|
Conflicts: man-pages < 2.43-12
|
||||||
|
BuildRequires: make
|
||||||
BuildRequires: automake, autoconf, libtool, systemd, systemd-devel
|
BuildRequires: automake, autoconf, libtool, systemd, systemd-devel
|
||||||
BuildRequires: libtirpc-devel, quota-devel
|
BuildRequires: libtirpc-devel, quota-devel
|
||||||
Requires(pre): coreutils shadow-utils
|
Requires(pre): coreutils
|
||||||
Requires(post): chkconfig systemd
|
Requires(post): systemd
|
||||||
Requires(preun): systemd
|
Requires(preun): systemd
|
||||||
Requires(postun): systemd coreutils
|
Requires(postun): systemd coreutils
|
||||||
|
|
||||||
Patch001: rpcbind-0.2.5-rc3.patch
|
Patch100: rpcbind-0.2.3-systemd-tmpfiles.patch
|
||||||
|
Patch101: rpcbind-0.2.4-systemd-rundir.patch
|
||||||
Patch100: rpcbind-0.2.3-systemd-envfile.patch
|
|
||||||
Patch101: rpcbind-0.2.3-systemd-tmpfiles.patch
|
|
||||||
Patch102: rpcbind-0.2.4-runstatdir.patch
|
|
||||||
Patch103: rpcbind-0.2.4-systemd-service.patch
|
|
||||||
Patch104: rpcbind-0.2.4-systemd-rundir.patch
|
|
||||||
|
|
||||||
Provides: portmap = %{version}-%{release}
|
Provides: portmap = %{version}-%{release}
|
||||||
Obsoletes: portmap <= 4.0-65.3
|
Obsoletes: portmap <= 4.0-65.3
|
||||||
|
|
||||||
|
%if "%{_sbindir}" == "%{_bindir}"
|
||||||
|
# Compat symlinks for Requires in other packages.
|
||||||
|
# We rely on filesystem to create the symlinks for us.
|
||||||
|
Requires: filesystem(unmerged-sbin-symlinks)
|
||||||
|
Provides: /usr/sbin/rpcbind
|
||||||
|
Provides: /usr/sbin/rpcinfo
|
||||||
|
%endif
|
||||||
|
|
||||||
%description
|
%description
|
||||||
The rpcbind utility is a server that converts RPC program numbers into
|
The rpcbind utility is a server that converts RPC program numbers into
|
||||||
universal addresses. It must be running on the host to be able to make
|
universal addresses. It must be running on the host to be able to make
|
||||||
RPC calls on a server on that machine.
|
RPC calls on a server on that machine.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q
|
%autosetup -p1
|
||||||
|
|
||||||
# 1401561 - rpcbind-0.2.3-12.rc2.fc24 fails to start at boot
|
# Create a sysusers.d config file
|
||||||
%patch001 -p1
|
cat >rpcbind.sysusers.conf <<EOF
|
||||||
|
u rpc 32 'Rpcbind Daemon' /var/lib/rpcbind -
|
||||||
|
EOF
|
||||||
|
|
||||||
%patch100 -p1
|
|
||||||
%patch101 -p1
|
|
||||||
%patch102 -p1
|
|
||||||
%patch103 -p1
|
|
||||||
%patch104 -p1
|
|
||||||
%build
|
%build
|
||||||
autoreconf -fisv
|
autoreconf -fisv
|
||||||
%configure \
|
%configure \
|
||||||
|
|
@ -57,12 +58,12 @@ autoreconf -fisv
|
||||||
--with-rpcuser="%rpcbind_user_group" \
|
--with-rpcuser="%rpcbind_user_group" \
|
||||||
--with-nss-modules="files altfiles" \
|
--with-nss-modules="files altfiles" \
|
||||||
--sbindir=%{_bindir} \
|
--sbindir=%{_bindir} \
|
||||||
|
--enable-rmtcalls \
|
||||||
--enable-debug
|
--enable-debug
|
||||||
|
|
||||||
make all
|
make all
|
||||||
|
|
||||||
%install
|
%install
|
||||||
rm -rf %{buildroot}
|
|
||||||
mkdir -p %{buildroot}{%{_sbindir},%{_bindir},/etc/sysconfig}
|
mkdir -p %{buildroot}{%{_sbindir},%{_bindir},/etc/sysconfig}
|
||||||
mkdir -p %{buildroot}%{_unitdir}
|
mkdir -p %{buildroot}%{_unitdir}
|
||||||
mkdir -p %{buildroot}%{_tmpfilesdir}
|
mkdir -p %{buildroot}%{_tmpfilesdir}
|
||||||
|
|
@ -72,26 +73,15 @@ make DESTDIR=$RPM_BUILD_ROOT install
|
||||||
|
|
||||||
install -m644 %{SOURCE1} %{buildroot}/etc/sysconfig/rpcbind
|
install -m644 %{SOURCE1} %{buildroot}/etc/sysconfig/rpcbind
|
||||||
|
|
||||||
|
%if "%{_sbindir}" != "%{_bindir}"
|
||||||
# The binaries now live in /usr/bin, moving from /usr/sbin
|
# The binaries now live in /usr/bin, moving from /usr/sbin
|
||||||
# For compatibility create a couple symlinks.
|
# For compatibility create a couple symlinks.
|
||||||
cd ${RPM_BUILD_ROOT}%{_sbindir}
|
cd ${RPM_BUILD_ROOT}%{_sbindir}
|
||||||
ln -sf ../bin/rpcbind
|
ln -sf ../bin/rpcbind
|
||||||
ln -sf ../bin/rpcinfo
|
ln -sf ../bin/rpcinfo
|
||||||
|
%endif
|
||||||
|
|
||||||
|
install -m0644 -D rpcbind.sysusers.conf %{buildroot}%{_sysusersdir}/rpcbind.conf
|
||||||
%pre
|
|
||||||
|
|
||||||
# Softly static allocate the rpc uid and gid.
|
|
||||||
getent group rpc >/dev/null || groupadd -f -g 32 -r rpc
|
|
||||||
if ! getent passwd rpc >/dev/null ; then
|
|
||||||
if ! getent passwd 32 >/dev/null ; then
|
|
||||||
useradd -l -c "Rpcbind Daemon" -d /var/lib/rpcbind \
|
|
||||||
-g rpc -M -s /sbin/nologin -o -u 32 rpc > /dev/null 2>&1
|
|
||||||
else
|
|
||||||
useradd -l -c "Rpcbind Daemon" -d /var/lib/rpcbind \
|
|
||||||
-g rpc -M -s /sbin/nologin rpc > /dev/null 2>&1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
%post
|
%post
|
||||||
%systemd_post rpcbind.service rpcbind.socket
|
%systemd_post rpcbind.service rpcbind.socket
|
||||||
|
|
@ -99,36 +89,144 @@ fi
|
||||||
%preun
|
%preun
|
||||||
%systemd_preun rpcbind.service rpcbind.socket
|
%systemd_preun rpcbind.service rpcbind.socket
|
||||||
|
|
||||||
|
# NOTE: We only restart rpcbind.socket in the %postun scriptlet in order to
|
||||||
|
# avoid the race described in:
|
||||||
|
#
|
||||||
|
# https://github.com/systemd/systemd/issues/13271
|
||||||
|
# https://github.com/systemd/systemd/issues/8102
|
||||||
|
#
|
||||||
|
# Restarting rpcbind.socket causes rpcbind.service to be restarted automatically
|
||||||
|
# due to "Requires=rpcbind.socket" in the rpcbind.service unit file.
|
||||||
%postun
|
%postun
|
||||||
%systemd_postun_with_restart rpcbind.service rpcbind.socket
|
%systemd_postun_with_restart rpcbind.socket
|
||||||
|
|
||||||
%triggerun -- rpcbind < 0.2.0-15
|
|
||||||
%{_bindir}/systemd-sysv-convert --save rpcbind >/dev/null 2>&1 ||:
|
|
||||||
/bin/systemctl --no-reload enable rpcbind.service >/dev/null 2>&1
|
|
||||||
/sbin/chkconfig --del rpcbind >/dev/null 2>&1 || :
|
|
||||||
/bin/systemctl try-restart rpcbind.service >/dev/null 2>&1 || :
|
|
||||||
|
|
||||||
%triggerin -- rpcbind > 0.2.2-2.0
|
|
||||||
if systemctl -q is-enabled rpcbind.socket
|
|
||||||
then
|
|
||||||
/bin/systemctl reenable rpcbind.socket >/dev/null 2>&1 || :
|
|
||||||
/bin/systemctl restart rpcbind.socket >/dev/null 2>&1 || :
|
|
||||||
fi
|
|
||||||
|
|
||||||
%files
|
%files
|
||||||
|
%license COPYING
|
||||||
%config(noreplace) /etc/sysconfig/rpcbind
|
%config(noreplace) /etc/sysconfig/rpcbind
|
||||||
%doc AUTHORS ChangeLog README
|
%doc AUTHORS ChangeLog README
|
||||||
%{_bindir}/rpcbind
|
%{_bindir}/rpcbind
|
||||||
%{_bindir}/rpcinfo
|
%{_bindir}/rpcinfo
|
||||||
|
%if "%{_sbindir}" != "%{_bindir}"
|
||||||
%{_sbindir}/rpcbind
|
%{_sbindir}/rpcbind
|
||||||
%{_sbindir}/rpcinfo
|
%{_sbindir}/rpcinfo
|
||||||
|
%endif
|
||||||
%{_mandir}/man8/*
|
%{_mandir}/man8/*
|
||||||
%{_unitdir}/%{name}.service
|
%{_unitdir}/%{name}.service
|
||||||
%{_unitdir}/%{name}.socket
|
%{_unitdir}/%{name}.socket
|
||||||
%{_tmpfilesdir}/%{name}.conf
|
%{_tmpfilesdir}/%{name}.conf
|
||||||
%attr(0700, %{rpcbind_user_group}, %{rpcbind_user_group}) %dir %{rpcbind_state_dir}
|
%attr(0700, %{rpcbind_user_group}, %{rpcbind_user_group}) %dir %{rpcbind_state_dir}
|
||||||
|
%{_sysusersdir}/rpcbind.conf
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Sat Jul 26 2025 Steve Dickson <steved@redhat.com> 1.2.8-0
|
||||||
|
- Updated to latest upstream release: rpcbind-1_2_8 (bz 2300081)
|
||||||
|
|
||||||
|
* Fri Jul 25 2025 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.7-2.rc1.1
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
|
||||||
|
|
||||||
|
* Wed May 7 2025 Scott Mayhew <smayhew@redhat.com> - 1.2.7-2.rc1
|
||||||
|
- Fix rpm scriptlets to remove excessive restarts during upgrade
|
||||||
|
|
||||||
|
* Wed Jan 29 2025 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.2.7-1.rc1.4
|
||||||
|
- Add sysusers.d config file to allow rpm to create users/groups automatically
|
||||||
|
|
||||||
|
* Sat Jan 18 2025 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.7-1.rc1.3
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
|
||||||
|
|
||||||
|
* Tue Jan 14 2025 Panu Matilainen <pmatilai@redhat.com> - 1.2.7-1.rc1.2
|
||||||
|
- Add provides for the manually created rpc user and group
|
||||||
|
|
||||||
|
* Sun Jan 12 2025 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.2.7-1.rc1.1
|
||||||
|
- Rebuilt for the bin-sbin merge (2nd attempt)
|
||||||
|
|
||||||
|
* Mon Sep 9 2024 Steve Dickson <steved@redhat.com> 1.2.8-rc1
|
||||||
|
- Updated to latest upstream RC release: rpcbind-1_2_8-rc1
|
||||||
|
|
||||||
|
* Tue Aug 13 2024 Steve Dickson <steved@redhat.com> 1.2.7-1
|
||||||
|
- Added Requirement for libtirpc (bz 2304327)
|
||||||
|
|
||||||
|
* Thu Jul 25 2024 Steve Dickson <steved@redhat.com> 1.2.7-0
|
||||||
|
- Updated to latest upstream release: rpcbind-1_2_7
|
||||||
|
|
||||||
|
* Fri Jul 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.6-5.rc3.1
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
|
||||||
|
|
||||||
|
* Thu Apr 11 2024 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.2.6-5.rc3
|
||||||
|
- Prepare for bin-sbin merge
|
||||||
|
(https://fedoraproject.org/wiki/Changes/Unify_bin_and_sbin)
|
||||||
|
|
||||||
|
* Mon Mar 18 2024 Steve Dickson <steved@redhat.com> 1.2.6-4.rc3
|
||||||
|
- Updated to latest upstream RC release: rpcbind-1_2_7-rc3
|
||||||
|
|
||||||
|
* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.6-4.rc2.4
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
||||||
|
|
||||||
|
* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.6-4.rc2.3
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
||||||
|
|
||||||
|
* Mon Oct 16 2023 Pavel Reichl <preichl@redhat.com> - 1.2.6-4.rc2.2
|
||||||
|
- Convert License tag to SPDX format
|
||||||
|
|
||||||
|
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.6-4.rc2.1
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
|
||||||
|
|
||||||
|
* Tue Feb 28 2023 Steve Dickson <steved@redhat.com> 1.2.6-4.rc2
|
||||||
|
- Updated to latest upstream RC release: rpcbind-1_2_7-rc2
|
||||||
|
|
||||||
|
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.6-4
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
|
||||||
|
|
||||||
|
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.6-3
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
|
||||||
|
|
||||||
|
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.6-2
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
||||||
|
|
||||||
|
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.6-1
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
||||||
|
|
||||||
|
* Mon May 17 2021 Steve Dickson <steved@redhat.com> 1.2.6-0
|
||||||
|
- Updated to latest upstream release: rpcbind-1_2_6 (bz 1959127)
|
||||||
|
|
||||||
|
* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.2.5-5.rc1.5
|
||||||
|
- Rebuilt for updated systemd-rpm-macros
|
||||||
|
See https://pagure.io/fesco/issue/2583.
|
||||||
|
|
||||||
|
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.5-5.rc1.4
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||||
|
|
||||||
|
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.5-5.rc1.3
|
||||||
|
- Second attempt - Rebuilt for
|
||||||
|
https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
||||||
|
|
||||||
|
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.5-5.rc1.2
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
||||||
|
|
||||||
|
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.5-5.rc1.1
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
||||||
|
|
||||||
|
* Mon Nov 11 2019 Steve Dickson <steved@redhat.com> - 1.2.5-5.rc1
|
||||||
|
- Updated to latest upstream RC release: rpcbind-1_2_5-rc1 (bz 1431574)
|
||||||
|
|
||||||
|
* Thu Sep 19 2019 Steve Dickson <steved@redhat.com> - 1.2.5-5
|
||||||
|
- Enable remote calls which are used by NIS and other packages (bz 1630672)
|
||||||
|
|
||||||
|
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.5-4
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
||||||
|
|
||||||
|
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.5-3
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
||||||
|
|
||||||
|
* Wed Oct 17 2018 Peter Robinson <pbrobinson@fedoraproject.org> 1.2.5-2
|
||||||
|
- Drop old sys-v migration bits
|
||||||
|
- Ship the license file, minor spec cleanups
|
||||||
|
|
||||||
|
* Tue Oct 9 2018 Steve Dickson <steved@redhat.com> - 1.2.5-1
|
||||||
|
- Fixed stack buffer overflow in rpcinfo (bz 1637562)
|
||||||
|
|
||||||
|
* Wed Aug 15 2018 Steve Dickson <steved@redhat.com> - 1.2.5-0
|
||||||
|
- Updated to latest upstream release: 1_2_5
|
||||||
|
|
||||||
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.4-10.rc3.1
|
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.4-10.rc3.1
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
||||||
|
|
||||||
|
|
|
||||||
2
sources
2
sources
|
|
@ -1 +1 @@
|
||||||
cf10cd41ed8228fc54c316191c1f07fe rpcbind-0.2.4.tar.bz2
|
SHA512 (rpcbind-1.2.8.tar.bz2) = 66f3955a67c4d0142ec635614ceafbc9bdbea985f2edaeec903f17efaf3c2e98f6483e8e6b7f1358cf8d2c1c877b281d153a3bf1b6748b6d259ae7ad1465ee71
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue