From f88fd230fc6b0dad737778178f7d21ded91a02b4 Mon Sep 17 00:00:00 2001 From: Steve Dickson Date: Mon, 1 Aug 2016 12:27:01 -0400 Subject: [PATCH 01/16] Removing the braces from the ${RPCBIND_ARGS} in rpcbind.service (bz 1362201) Signed-off-by: Steve Dickson --- rpcbind.service | 2 +- rpcbind.spec | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/rpcbind.service b/rpcbind.service index 265c677..12c1401 100644 --- a/rpcbind.service +++ b/rpcbind.service @@ -5,7 +5,7 @@ Requires=rpcbind.socket [Service] Type=forking EnvironmentFile=/etc/sysconfig/rpcbind -ExecStart=/sbin/rpcbind -w ${RPCBIND_ARGS} +ExecStart=/sbin/rpcbind -w $RPCBIND_ARGS [Install] Also=rpcbind.socket diff --git a/rpcbind.spec b/rpcbind.spec index 9f66586..80ad4c3 100644 --- a/rpcbind.spec +++ b/rpcbind.spec @@ -1,6 +1,6 @@ Name: rpcbind Version: 0.2.3 -Release: 10.rc1%{?dist} +Release: 11.rc1%{?dist} Summary: Universal Addresses to RPC Program Number Mapper Group: System Environment/Daemons License: BSD @@ -119,6 +119,9 @@ fi %{_unitdir}/rpcbind.socket %changelog +* Mon Aug 1 2016 Steve Dickson - 0.2.3-11.rc1 +- Removing the braces from the ${RPCBIND_ARGS} in rpcbind.service (bz 1362201) + * Mon Apr 4 2016 Steve Dickson - 0.2.3-10.rc1 - Restart rpcbind.socket on restarts (bz 1306824) - Soft static allocate rpc uid/gid (bz 1301288) From f2ad40f13668ecb6043f4c9f9603244c79055bcd Mon Sep 17 00:00:00 2001 From: Steve Dickson Date: Mon, 1 Aug 2016 12:51:33 -0400 Subject: [PATCH 02/16] Stop enable rpcbind.socket with every update (bz 1324666) Signed-off-by: Steve Dickson --- rpcbind.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rpcbind.spec b/rpcbind.spec index 80ad4c3..25ab435 100644 --- a/rpcbind.spec +++ b/rpcbind.spec @@ -90,7 +90,7 @@ if ! getent passwd rpc >/dev/null ; then fi %post -/bin/systemctl enable rpcbind.socket >/dev/null 2>&1 || : +%systemd_post rpcbind.service rpcbind.socket %preun %systemd_preun rpcbind.service rpcbind.socket @@ -121,6 +121,7 @@ fi %changelog * Mon Aug 1 2016 Steve Dickson - 0.2.3-11.rc1 - Removing the braces from the ${RPCBIND_ARGS} in rpcbind.service (bz 1362201) +- Stop enable rpcbind.socket with every update (bz 1324666) * Mon Apr 4 2016 Steve Dickson - 0.2.3-10.rc1 - Restart rpcbind.socket on restarts (bz 1306824) From 4641820d1e382b358b7baad746565f99a5cbb75d Mon Sep 17 00:00:00 2001 From: Steve Dickson Date: Mon, 7 Nov 2016 14:52:32 -0500 Subject: [PATCH 03/16] Updated to the latest RC release rpcbind-0_2_4-rc1 Signed-off-by: Steve Dickson --- rpcbind-0.2.3-systemd-envfile.patch | 12 + rpcbind-0.2.4-rc2.patch | 474 ++++++++++++++++++++++++++++ rpcbind.spec | 18 +- 3 files changed, 496 insertions(+), 8 deletions(-) create mode 100644 rpcbind-0.2.3-systemd-envfile.patch create mode 100644 rpcbind-0.2.4-rc2.patch diff --git a/rpcbind-0.2.3-systemd-envfile.patch b/rpcbind-0.2.3-systemd-envfile.patch new file mode 100644 index 0000000..e8254bd --- /dev/null +++ b/rpcbind-0.2.3-systemd-envfile.patch @@ -0,0 +1,12 @@ +diff -up rpcbind-0.2.3/systemd/rpcbind.service.in.orig rpcbind-0.2.3/systemd/rpcbind.service.in +--- rpcbind-0.2.3/systemd/rpcbind.service.in.orig 2016-11-07 14:45:17.440658739 -0500 ++++ rpcbind-0.2.3/systemd/rpcbind.service.in 2016-11-07 14:46:50.968844715 -0500 +@@ -10,7 +10,7 @@ After=rpcbind.socket + + [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] diff --git a/rpcbind-0.2.4-rc2.patch b/rpcbind-0.2.4-rc2.patch new file mode 100644 index 0000000..c29d949 --- /dev/null +++ b/rpcbind-0.2.4-rc2.patch @@ -0,0 +1,474 @@ +diff --git a/.gitignore b/.gitignore +index 321dff6..a8f1fed 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -27,3 +27,4 @@ rpcbind + rpcinfo + # cscope database files + cscope.* ++systemd/rpcbind.service +diff --git a/Makefile.am b/Makefile.am +index 5ec8cd6..43c2710 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -50,6 +50,10 @@ if SYSTEMD + AM_CPPFLAGS += $(SYSTEMD_CFLAGS) -DSYSTEMD + + rpcbind_LDADD += $(SYSTEMD_LIBS) ++ ++systemdsystemunit_DATA = \ ++ systemd/rpcbind.service \ ++ systemd/rpcbind.socket + endif + + rpcinfo_SOURCES = src/rpcinfo.c +diff --git a/configure.ac b/configure.ac +index af4b74b..f84921e 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -61,4 +61,9 @@ AC_SEARCH_LIBS([pthread_create], [pthread]) + + AC_CHECK_HEADERS([nss.h rpcsvc/mount.h]) + +-AC_OUTPUT([Makefile]) ++# make sbindir available for substitution in config file ++# 2 "evals" needed to expand variable names ++AC_SUBST([_sbindir]) ++AC_CONFIG_COMMANDS_PRE([eval eval _sbindir=$sbindir]) ++ ++AC_OUTPUT([Makefile systemd/rpcbind.service]) +diff --git a/src/check_bound.c b/src/check_bound.c +index c70b845..92bfd36 100644 +--- a/src/check_bound.c ++++ b/src/check_bound.c +@@ -70,7 +70,7 @@ static struct fdlist *fdhead; /* Link list of the check fd's */ + static struct fdlist *fdtail; + static char *nullstring = ""; + +-static bool_t check_bound __P((struct fdlist *, char *uaddr)); ++static bool_t check_bound(struct fdlist *, char *uaddr); + + /* + * Returns 1 if the given address is bound for the given addr & transport +diff --git a/src/pmap_svc.c b/src/pmap_svc.c +index ad28b93..4c744fe 100644 +--- a/src/pmap_svc.c ++++ b/src/pmap_svc.c +@@ -60,11 +60,11 @@ static char sccsid[] = "@(#)pmap_svc.c 1.23 89/04/05 Copyr 1984 Sun Micro"; + #include "rpcbind.h" + #include "xlog.h" + #include /* svc_getcaller routine definition */ +-static struct pmaplist *find_service_pmap __P((rpcprog_t, rpcvers_t, +- rpcprot_t)); +-static bool_t pmapproc_change __P((struct svc_req *, SVCXPRT *, u_long)); +-static bool_t pmapproc_getport __P((struct svc_req *, SVCXPRT *)); +-static bool_t pmapproc_dump __P((struct svc_req *, SVCXPRT *)); ++static struct pmaplist *find_service_pmap(rpcprog_t, rpcvers_t, ++ rpcprot_t); ++static bool_t pmapproc_change(struct svc_req *, SVCXPRT *, u_long); ++static bool_t pmapproc_getport(struct svc_req *, SVCXPRT *); ++static bool_t pmapproc_dump(struct svc_req *, SVCXPRT *); + + /* + * Called for all the version 2 inquiries. +diff --git a/src/rpcb_svc.c b/src/rpcb_svc.c +index bd92201..709e3fb 100644 +--- a/src/rpcb_svc.c ++++ b/src/rpcb_svc.c +@@ -53,10 +53,10 @@ + #include "rpcbind.h" + #include "xlog.h" + +-static void *rpcbproc_getaddr_3_local __P((void *, struct svc_req *, SVCXPRT *, +- rpcvers_t)); +-static void *rpcbproc_dump_3_local __P((void *, struct svc_req *, SVCXPRT *, +- rpcvers_t)); ++static void *rpcbproc_getaddr_3_local(void *, struct svc_req *, SVCXPRT *, ++ rpcvers_t); ++static void *rpcbproc_dump_3_local(void *, struct svc_req *, SVCXPRT *, ++ rpcvers_t); + + /* + * Called by svc_getreqset. There is a separate server handle for +@@ -75,7 +75,7 @@ rpcb_service_3(struct svc_req *rqstp, SVCXPRT *transp) + } argument; + char *result; + xdrproc_t xdr_argument, xdr_result; +- void *(*local) __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t)); ++ void *(*local)(void *, struct svc_req *, SVCXPRT *, rpcvers_t); + rpcprog_t setprog = 0; + + rpcbs_procinfo(RPCBVERS_3_STAT, rqstp->rq_proc); +diff --git a/src/rpcb_svc_4.c b/src/rpcb_svc_4.c +index b673452..5094879 100644 +--- a/src/rpcb_svc_4.c ++++ b/src/rpcb_svc_4.c +@@ -54,13 +54,11 @@ + #include "rpcbind.h" + #include "xlog.h" + +-static void *rpcbproc_getaddr_4_local __P((void *, struct svc_req *, SVCXPRT *, +- rpcvers_t)); +-static void *rpcbproc_getversaddr_4_local __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t)); +-static void *rpcbproc_getaddrlist_4_local +- __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t)); +-static void free_rpcb_entry_list __P((rpcb_entry_list_ptr *)); +-static void *rpcbproc_dump_4_local __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t)); ++static void *rpcbproc_getaddr_4_local(void *, struct svc_req *, SVCXPRT *, rpcvers_t); ++static void *rpcbproc_getversaddr_4_local(void *, struct svc_req *, SVCXPRT *, rpcvers_t); ++static void *rpcbproc_getaddrlist_4_local(void *, struct svc_req *, SVCXPRT *, rpcvers_t); ++static void free_rpcb_entry_list(rpcb_entry_list_ptr *); ++static void *rpcbproc_dump_4_local(void *, struct svc_req *, SVCXPRT *, rpcvers_t); + + /* + * Called by svc_getreqset. There is a separate server handle for +@@ -78,7 +76,7 @@ rpcb_service_4(struct svc_req *rqstp, SVCXPRT *transp) + } argument; + char *result; + xdrproc_t xdr_argument, xdr_result; +- void *(*local) __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t)); ++ void *(*local)(void *, struct svc_req *, SVCXPRT *, rpcvers_t); + rpcprog_t setprog = 0; + + rpcbs_procinfo(RPCBVERS_4_STAT, rqstp->rq_proc); +diff --git a/src/rpcb_svc_com.c b/src/rpcb_svc_com.c +index ff9ce6b..5862c26 100644 +--- a/src/rpcb_svc_com.c ++++ b/src/rpcb_svc_com.c +@@ -100,29 +100,29 @@ struct finfo { + static struct finfo FINFO[NFORWARD]; + + +-static bool_t xdr_encap_parms __P((XDR *, struct encap_parms *)); +-static bool_t xdr_rmtcall_args __P((XDR *, struct r_rmtcall_args *)); +-static bool_t xdr_rmtcall_result __P((XDR *, struct r_rmtcall_args *)); +-static bool_t xdr_opaque_parms __P((XDR *, struct r_rmtcall_args *)); +-static int find_rmtcallfd_by_netid __P((char *)); +-static SVCXPRT *find_rmtcallxprt_by_fd __P((int)); +-static int forward_register __P((u_int32_t, struct netbuf *, int, char *, +- rpcproc_t, rpcvers_t, u_int32_t *)); +-static struct finfo *forward_find __P((u_int32_t)); +-static int free_slot_by_xid __P((u_int32_t)); +-static int free_slot_by_index __P((int)); +-static int netbufcmp __P((struct netbuf *, struct netbuf *)); +-static struct netbuf *netbufdup __P((struct netbuf *)); +-static void netbuffree __P((struct netbuf *)); +-static int check_rmtcalls __P((struct pollfd *, int)); +-static void xprt_set_caller __P((SVCXPRT *, struct finfo *)); +-static void send_svcsyserr __P((SVCXPRT *, struct finfo *)); +-static void handle_reply __P((int, SVCXPRT *)); +-static void find_versions __P((rpcprog_t, char *, rpcvers_t *, rpcvers_t *)); +-static rpcblist_ptr find_service __P((rpcprog_t, rpcvers_t, char *)); +-static char *getowner __P((SVCXPRT *, char *, size_t)); +-static int add_pmaplist __P((RPCB *)); +-static int del_pmaplist __P((RPCB *)); ++static bool_t xdr_encap_parms(XDR *, struct encap_parms *); ++static bool_t xdr_rmtcall_args(XDR *, struct r_rmtcall_args *); ++static bool_t xdr_rmtcall_result(XDR *, struct r_rmtcall_args *); ++static bool_t xdr_opaque_parms(XDR *, struct r_rmtcall_args *); ++static int find_rmtcallfd_by_netid(char *); ++static SVCXPRT *find_rmtcallxprt_by_fd(int); ++static int forward_register(u_int32_t, struct netbuf *, int, char *, ++ rpcproc_t, rpcvers_t, u_int32_t *); ++static struct finfo *forward_find(u_int32_t); ++static int free_slot_by_xid(u_int32_t); ++static int free_slot_by_index(int); ++static int netbufcmp(struct netbuf *, struct netbuf *); ++static struct netbuf *netbufdup(struct netbuf *); ++static void netbuffree(struct netbuf *); ++static int check_rmtcalls(struct pollfd *, int); ++static void xprt_set_caller(SVCXPRT *, struct finfo *); ++static void send_svcsyserr(SVCXPRT *, struct finfo *); ++static void handle_reply(int, SVCXPRT *); ++static void find_versions(rpcprog_t, char *, rpcvers_t *, rpcvers_t *); ++static rpcblist_ptr find_service(rpcprog_t, rpcvers_t, char *); ++static char *getowner(SVCXPRT *, char *, size_t); ++static int add_pmaplist(RPCB *); ++static int del_pmaplist(RPCB *); + + /* + * Set a mapping of program, version, netid +@@ -536,10 +536,6 @@ create_rmtcall_fd(struct netconfig *nconf) + rmttail->next = rmt; + rmttail = rmt; + } +- /* XXX not threadsafe */ +- if (fd > svc_maxfd) +- svc_maxfd = fd; +- FD_SET(fd, &svc_fdset); + return (fd); + } + +@@ -1056,9 +1052,6 @@ free_slot_by_index(int index) + fi = &FINFO[index]; + if (fi->flag & FINFO_ACTIVE) { + netbuffree(fi->caller_addr); +- /* XXX may be too big, but can't access xprt array here */ +- if (fi->forward_fd >= svc_maxfd) +- svc_maxfd--; + free(fi->uaddr); + fi->flag &= ~FINFO_ACTIVE; + rpcb_rmtcalls--; +@@ -1097,35 +1090,28 @@ netbuffree(struct netbuf *ap) + } + + +-#define MASKVAL (POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND) +-extern bool_t __svc_clean_idle(fd_set *, int, bool_t); +- + void + my_svc_run() + { +- size_t nfds; +- struct pollfd pollfds[FD_SETSIZE]; + int poll_ret, check_ret; + int n; +-#ifdef SVC_RUN_DEBUG +- int i; +-#endif +- register struct pollfd *p; +- fd_set cleanfds; + + for (;;) { +- p = pollfds; +- for (n = 0; n <= svc_maxfd; n++) { +- if (FD_ISSET(n, &svc_fdset)) { +- p->fd = n; +- p->events = MASKVAL; +- p++; +- } +- } +- nfds = p - pollfds; +- poll_ret = 0; ++ struct pollfd my_pollfd[svc_max_pollfd]; ++ int i; ++ ++ if (svc_max_pollfd == 0 && svc_pollfd == NULL) ++ return; + +- switch (poll_ret = poll(pollfds, nfds, 30 * 1000)) { ++ ++ for (i = 0; i < svc_max_pollfd; ++i) ++ { ++ my_pollfd[i].fd = svc_pollfd[i].fd; ++ my_pollfd[i].events = svc_pollfd[i].events; ++ my_pollfd[i].revents = 0; ++ } ++ ++ switch (poll_ret = poll(my_pollfd, svc_max_pollfd, 30 * 1000)) { + case -1: + /* + * We ignore all errors, continuing with the assumption +@@ -1133,8 +1119,6 @@ my_svc_run() + * other outside event) and not caused by poll(). + */ + case 0: +- cleanfds = svc_fdset; +- __svc_clean_idle(&cleanfds, 30, FALSE); + continue; + default: + /* +@@ -1144,10 +1128,10 @@ my_svc_run() + * don't call svc_getreq_poll. Otherwise, there + * must be another so we must call svc_getreq_poll. + */ +- if ((check_ret = check_rmtcalls(pollfds, nfds)) == ++ if ((check_ret = check_rmtcalls(my_pollfd, svc_max_pollfd)) == + poll_ret) + continue; +- svc_getreq_poll(pollfds, poll_ret-check_ret); ++ svc_getreq_poll(my_pollfd, poll_ret-check_ret); + } + } + } +@@ -1183,12 +1167,33 @@ check_rmtcalls(struct pollfd *pfds, int nfds) + return (ncallbacks_found); + } + ++/* ++ * This is really a helper function defined in libtirpc, ++ * but unfortunately, it hasn't been exported yet. ++ */ ++static struct netbuf * ++__rpc_set_netbuf(struct netbuf *nb, const void *ptr, size_t len) ++{ ++ if (nb->len != len) { ++ if (nb->len) ++ mem_free(nb->buf, nb->len); ++ nb->buf = mem_alloc(len); ++ if (nb->buf == NULL) ++ return NULL; ++ ++ nb->maxlen = nb->len = len; ++ } ++ memcpy(nb->buf, ptr, len); ++ return nb; ++} ++ + static void + xprt_set_caller(SVCXPRT *xprt, struct finfo *fi) + { ++ const struct netbuf *caller = fi->caller_addr; + u_int32_t *xidp; + +- *(svc_getrpccaller(xprt)) = *(fi->caller_addr); ++ __rpc_set_netbuf(svc_getrpccaller(xprt), caller->buf, caller->len); + xidp = __rpcb_get_dg_xidp(xprt); + *xidp = fi->caller_xid; + } +@@ -1274,10 +1279,17 @@ handle_reply(int fd, SVCXPRT *xprt) + a.rmt_localvers = fi->versnum; + + xprt_set_caller(xprt, fi); ++#if defined(SVC_XP_AUTH) ++ SVC_XP_AUTH(xprt) = svc_auth_none; ++#else + xprt->xp_auth = &svc_auth_none; ++#endif + svc_sendreply(xprt, (xdrproc_t) xdr_rmtcall_result, (char *) &a); ++#if !defined(SVC_XP_AUTH) + SVCAUTH_DESTROY(xprt->xp_auth); + xprt->xp_auth = NULL; ++#endif ++ + done: + if (buffer) + free(buffer); +diff --git a/src/rpcbind.c b/src/rpcbind.c +index 045daa1..87ccdc2 100644 +--- a/src/rpcbind.c ++++ b/src/rpcbind.c +@@ -87,6 +87,7 @@ static inline void __nss_configure_lookup(const char *db, const char *s) {} + 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? */ + + rpcblist_ptr list_rbl; /* A list of version 3/4 rpcbind services */ + +@@ -135,13 +136,13 @@ char *tcp_uaddr; /* Universal TCP address */ + static char servname[] = "rpcbind"; + static char superuser[] = "superuser"; + +-int main __P((int, char *[])); ++int main(int, char *[]); + +-static int init_transport __P((struct netconfig *)); +-static void rbllist_add __P((rpcprog_t, rpcvers_t, struct netconfig *, +- struct netbuf *)); +-static void terminate __P((int)); +-static void parseargs __P((int, char *[])); ++static int init_transport(struct netconfig *); ++static void rbllist_add(rpcprog_t, rpcvers_t, struct netconfig *, ++ struct netbuf *); ++static void terminate(int); ++static void parseargs(int, char *[]); + + int + main(int argc, char *argv[]) +@@ -445,6 +446,7 @@ init_transport(struct netconfig *nconf) + memset(&sun, 0, sizeof sun); + sun.sun_family = AF_LOCAL; + unlink(_PATH_RPCBINDSOCK); ++ createdsocket = 1; /* We are now in the process of creating the unix socket */ + strcpy(sun.sun_path, _PATH_RPCBINDSOCK); + addrlen = SUN_LEN(&sun); + sa = (struct sockaddr *)&sun; +@@ -846,7 +848,8 @@ static void + terminate(int dummy /*__unused*/) + { + close(rpcbindlockfd); +- unlink(_PATH_RPCBINDSOCK); ++ if(createdsocket) ++ unlink(_PATH_RPCBINDSOCK); + unlink(RPCBINDDLOCK); + #ifdef WARMSTART + write_warmstart(); /* Dump yourself */ +diff --git a/src/security.c b/src/security.c +index 0c9453f..c54ce26 100644 +--- a/src/security.c ++++ b/src/security.c +@@ -17,6 +17,8 @@ + #include + #include + ++#include "xlog.h" ++ + /* + * XXX for special case checks in check_callit. + */ +diff --git a/src/util.c b/src/util.c +index a6c835b..74b0284 100644 +--- a/src/util.c ++++ b/src/util.c +@@ -70,7 +70,7 @@ static struct sockaddr_in *local_in4; + static struct sockaddr_in6 *local_in6; + #endif + +-static int bitmaskcmp __P((void *, void *, void *, int)); ++static int bitmaskcmp(void *, void *, void *, int); + + /* + * For all bits set in "mask", compare the corresponding bits in +diff --git a/src/warmstart.c b/src/warmstart.c +index b6eb73e..122a058 100644 +--- a/src/warmstart.c ++++ b/src/warmstart.c +@@ -58,8 +58,8 @@ + #define PMAPFILE RPCBIND_STATEDIR "/portmap.xdr" + #endif + +-static bool_t write_struct __P((char *, xdrproc_t, void *)); +-static bool_t read_struct __P((char *, xdrproc_t, void *)); ++static bool_t write_struct(char *, xdrproc_t, void *); ++static bool_t read_struct(char *, xdrproc_t, void *); + + static bool_t + write_struct(char *filename, xdrproc_t structproc, void *list) +diff --git a/systemd/rpcbind.service.in b/systemd/rpcbind.service.in +new file mode 100644 +index 0000000..c173b83 +--- /dev/null ++++ b/systemd/rpcbind.service.in +@@ -0,0 +1,17 @@ ++[Unit] ++Description=RPC Bind ++Documentation=man:rpcbind(8) ++DefaultDependencies=no ++ ++# Make sure we use the IP addresses listed for ++# rpcbind.socket, no matter how this unit is started. ++Wants=rpcbind.socket ++After=rpcbind.socket ++ ++[Service] ++Type=notify ++# distro can provide a drop-in adding EnvironmentFile=-/??? if needed. ++ExecStart=@_sbindir@/rpcbind $RPCBIND_OPTIONS -w -f ++ ++[Install] ++WantedBy=multi-user.target +diff --git a/systemd/rpcbind.socket b/systemd/rpcbind.socket +new file mode 100644 +index 0000000..3b1a936 +--- /dev/null ++++ b/systemd/rpcbind.socket +@@ -0,0 +1,18 @@ ++[Unit] ++Description=RPCbind Server Activation Socket ++DefaultDependencies=no ++Wants=rpcbind.target ++Before=rpcbind.target ++ ++[Socket] ++ListenStream=/run/rpcbind.sock ++ ++# RPC netconfig can't handle ipv6/ipv4 dual sockets ++BindIPv6Only=ipv6-only ++ListenStream=0.0.0.0:111 ++ListenDatagram=0.0.0.0:111 ++ListenStream=[::]:111 ++ListenDatagram=[::]:111 ++ ++[Install] ++WantedBy=sockets.target diff --git a/rpcbind.spec b/rpcbind.spec index 25ab435..7574472 100644 --- a/rpcbind.spec +++ b/rpcbind.spec @@ -1,6 +1,6 @@ Name: rpcbind Version: 0.2.3 -Release: 11.rc1%{?dist} +Release: 11.rc2%{?dist} Summary: Universal Addresses to RPC Program Number Mapper Group: System Environment/Daemons License: BSD @@ -8,9 +8,7 @@ URL: http://nfsv4.bullopensource.org BuildRoot: %{_tmppath}/%{name}-%{version}-root-%(%{__id_u} -n) Source0: http://downloads.sourceforge.net/rpcbind/%{name}-%{version}.tar.bz2 -Source1: rpcbind.service -Source2: rpcbind.socket -Source3: rpcbind.sysconfig +Source1: rpcbind.sysconfig Requires: glibc-common setup Conflicts: man-pages < 2.43-12 @@ -21,7 +19,9 @@ Requires(post): chkconfig systemd Requires(preun): systemd Requires(postun): systemd coreutils -Patch001: rpcbind-0.2.4-rc1.patch +Patch001: rpcbind-0.2.4-rc2.patch + +Patch100: rpcbind-0.2.3-systemd-envfile.patch Provides: portmap = %{version}-%{release} Obsoletes: portmap <= 4.0-65.3 @@ -36,6 +36,7 @@ RPC calls on a server on that machine. %patch001 -p1 +%patch100 -p1 %build %ifarch s390 s390x PIE="-fPIE" @@ -68,9 +69,7 @@ make DESTDIR=$RPM_BUILD_ROOT install mv -f ${RPM_BUILD_ROOT}%{_bindir}/rpcbind ${RPM_BUILD_ROOT}/sbin mv -f ${RPM_BUILD_ROOT}%{_bindir}/rpcinfo ${RPM_BUILD_ROOT}%{_sbindir} -install -m644 %{SOURCE1} %{buildroot}%{_unitdir} -install -m644 %{SOURCE2} %{buildroot}%{_unitdir} -install -m644 %{SOURCE3} %{buildroot}/etc/sysconfig/rpcbind +install -m644 %{SOURCE1} %{buildroot}/etc/sysconfig/rpcbind %clean rm -rf %{buildroot} @@ -119,6 +118,9 @@ fi %{_unitdir}/rpcbind.socket %changelog +* Mon Nov 7 2016 Steve Dickson - 0.2.3-11.rc2 +- Updated to the latest RC release rpcbind-0_2_4-rc1 + * Mon Aug 1 2016 Steve Dickson - 0.2.3-11.rc1 - Removing the braces from the ${RPCBIND_ARGS} in rpcbind.service (bz 1362201) - Stop enable rpcbind.socket with every update (bz 1324666) From 518296afa5e819b1f4997d1a4d2f035a208dd363 Mon Sep 17 00:00:00 2001 From: Steve Dickson Date: Sat, 12 Nov 2016 12:35:35 -0500 Subject: [PATCH 04/16] Stop enable rpcbind.socket with every update (bz 1393721) Signed-off-by: Steve Dickson --- rpcbind.spec | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/rpcbind.spec b/rpcbind.spec index 7574472..67376e8 100644 --- a/rpcbind.spec +++ b/rpcbind.spec @@ -1,6 +1,6 @@ Name: rpcbind Version: 0.2.3 -Release: 11.rc2%{?dist} +Release: 12.rc2%{?dist} Summary: Universal Addresses to RPC Program Number Mapper Group: System Environment/Daemons License: BSD @@ -104,8 +104,11 @@ fi /bin/systemctl try-restart rpcbind.service >/dev/null 2>&1 || : %triggerin -- rpcbind > 0.2.2-2.0 -/bin/systemctl enable rpcbind.socket >/dev/null 2>&1 || : -/bin/systemctl restart rpcbind.socket >/dev/null 2>&1 || : +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 %defattr(-,root,root) @@ -118,6 +121,9 @@ fi %{_unitdir}/rpcbind.socket %changelog +* Sat Nov 12 2016 Steve Dickson - 0.2.3-12.rc2 +- Stop enable rpcbind.socket with every update (bz 1393721) + * Mon Nov 7 2016 Steve Dickson - 0.2.3-11.rc2 - Updated to the latest RC release rpcbind-0_2_4-rc1 From f39388a91244939ea35604e3103444321b5077c8 Mon Sep 17 00:00:00 2001 From: Steve Dickson Date: Mon, 28 Nov 2016 11:36:02 -0500 Subject: [PATCH 05/16] Create the statedir under /run/rpcbind by systemd-tmpfiles. Signed-off-by: Steve Dickson --- rpcbind-0.2.3-create-statdir.patch | 138 +++++++++++++++++++++++++++ rpcbind-0.2.3-systemd-tmpfiles.patch | 57 +++++++++++ rpcbind.spec | 20 +++- 3 files changed, 210 insertions(+), 5 deletions(-) create mode 100644 rpcbind-0.2.3-create-statdir.patch create mode 100644 rpcbind-0.2.3-systemd-tmpfiles.patch diff --git a/rpcbind-0.2.3-create-statdir.patch b/rpcbind-0.2.3-create-statdir.patch new file mode 100644 index 0000000..ec6a8e9 --- /dev/null +++ b/rpcbind-0.2.3-create-statdir.patch @@ -0,0 +1,138 @@ +commit 1805cdb116bd076dc5746beeb6dc79067a79d094 +Author: NeilBrown +Date: Wed Nov 16 10:53:07 2016 -0500 + + Move default state-dir to a subdirectory of /var/run + + rpcbind can save state in a file to allow restart without forgetting + about running services. + + The default location is currently "/tmp" which is + not ideal for system files. It is particularly unpleasant + to put simple files there rather than creating a directory + to contain them. + + On a modern Linux system it is preferable to use /run, and there it is + even more consistent with practice to use a subdirectory. + + This directory needs to be create one each boot, and while there are + tools (e.g. systemd-tmpfiles) which can do that it is cleaner to keep + rpcbind self-contained and have it create the directory. + + So change the default location to /var/run/rpcbind, and create that + directory. If a different user-id is used, we need to create + and chown the directory before dropping privileges. We do this + with care so avoid chowning the wrong thing by mistake. + + Signed-off-by: NeilBrown + Signed-off-by: Steve Dickson + +diff --git a/configure.ac b/configure.ac +index f84921e..acc6914 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -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=/tmp@:>@]) +- ,, [with_statedir=/tmp]) ++ AS_HELP_STRING([--with-statedir=ARG], [use ARG as state dir @<:@default=/var/run/rpcbind@:>@]) ++ ,, [with_statedir=/var/run/rpcbind]) + AC_SUBST([statedir], [$with_statedir]) + + AC_ARG_WITH([rpcuser], +diff --git a/src/rpcbind.c b/src/rpcbind.c +index 87ccdc2..8db8dfc 100644 +--- a/src/rpcbind.c ++++ b/src/rpcbind.c +@@ -263,6 +263,11 @@ main(int argc, char *argv[]) + syslog(LOG_ERR, "cannot get uid of '%s': %m", id); + exit(1); + } ++#ifdef WARMSTART ++ if (warmstart) { ++ mkdir_warmstart(p->pw_uid); ++ } ++#endif + if (setgid(p->pw_gid) == -1) { + syslog(LOG_ERR, "setgid to '%s' (%d) failed: %m", id, p->pw_gid); + exit(1); +diff --git a/src/rpcbind.h b/src/rpcbind.h +index 74f9591..5b1a9bb 100644 +--- a/src/rpcbind.h ++++ b/src/rpcbind.h +@@ -129,6 +129,7 @@ int is_localroot(struct netbuf *); + extern void pmap_service(struct svc_req *, SVCXPRT *); + #endif + ++void mkdir_warmstart(int uid); + void write_warmstart(void); + void read_warmstart(void); + +diff --git a/src/warmstart.c b/src/warmstart.c +index 122a058..aafcb61 100644 +--- a/src/warmstart.c ++++ b/src/warmstart.c +@@ -45,19 +45,23 @@ + #include + #include + #include ++#include + + #include "rpcbind.h" + +-#ifndef RPCBIND_STATEDIR +-#define RPCBIND_STATEDIR "/tmp" +-#endif +- + /* These files keep the pmap_list and rpcb_list in XDR format */ + #define RPCBFILE RPCBIND_STATEDIR "/rpcbind.xdr" + #ifdef PORTMAP + #define PMAPFILE RPCBIND_STATEDIR "/portmap.xdr" + #endif + ++#ifndef O_DIRECTORY ++#define O_DIRECTORY 0 ++#endif ++#ifndef O_NOFOLLOW ++#define O_NOFOLLOW 0 ++#endif ++ + static bool_t write_struct(char *, xdrproc_t, void *); + static bool_t read_struct(char *, xdrproc_t, void *); + +@@ -139,8 +143,33 @@ error: + } + + void ++mkdir_warmstart(int uid) ++{ ++ /* Already exists? */ ++ if (access(RPCBIND_STATEDIR, X_OK) == 0) ++ return; ++ ++ if (mkdir(RPCBIND_STATEDIR, 0770) == 0) { ++ int fd = open(RPCBIND_STATEDIR, O_RDONLY | O_DIRECTORY | O_NOFOLLOW); ++ if (fd >= 0) { ++ if (fchown(fd, uid, -1) < 0) { ++ syslog(LOG_ERR, ++ "mkdir_warmstart: open failed '%s', errno %d (%s)", ++ RPCBIND_STATEDIR, errno, strerror(errno)); ++ } ++ close(fd); ++ } else ++ syslog(LOG_ERR, "mkdir_warmstart: open failed '%s', errno %d (%s)", ++ RPCBIND_STATEDIR, errno, strerror(errno)); ++ } else ++ syslog(LOG_ERR, "mkdir_warmstart: mkdir failed '%s', errno %d (%s)", ++ RPCBIND_STATEDIR, errno, strerror(errno)); ++} ++ ++void + write_warmstart() + { ++ (void) mkdir(RPCBIND_STATEDIR, 0770); + (void) write_struct(RPCBFILE, (xdrproc_t)xdr_rpcblist_ptr, &list_rbl); + #ifdef PORTMAP + (void) write_struct(PMAPFILE, (xdrproc_t)xdr_pmaplist_ptr, &list_pml); diff --git a/rpcbind-0.2.3-systemd-tmpfiles.patch b/rpcbind-0.2.3-systemd-tmpfiles.patch new file mode 100644 index 0000000..e916680 --- /dev/null +++ b/rpcbind-0.2.3-systemd-tmpfiles.patch @@ -0,0 +1,57 @@ +commit b47e0f12cfa005bb120e018257410663efbd7254 +Author: Steve Dickson +Date: Tue Nov 15 13:32:40 2016 -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 + +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], + fi + AM_CONDITIONAL(SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ]) + ++AC_ARG_WITH([systemdtmpfilesdir], ++ AS_HELP_STRING([--with-systemdtmpfilesdir=DIR], [Directory for systemd tmp files]), ++ [], [with_systemdtmpfilesdir=$($PKG_CONFIG --variable=tmpfilesdir systemd)]) ++ if test "x$with_systemdtmpfilesdir" != xno; then ++ AC_SUBST([systemdtmpfilesdir], [$with_systemdtmpfilesdir]) ++ PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [], ++ [PKG_CHECK_MODULES([SYSTEMD], [libsystemd-daemon], [], ++ AC_MSG_ERROR([libsystemd support requested but found]))]) ++ fi ++AM_CONDITIONAL(SYSTEMD, [test -n "$with_systemdtmpfilesdir" -a "x$with_systemdtmpfilesdir" != xno ]) ++ + AS_IF([test x$enable_libwrap = xyes], [ + AC_CHECK_LIB([wrap], [hosts_access], , + AC_MSG_ERROR([libwrap support requested but unable to find libwrap])) +diff --git a/systemd/rpcbind.conf b/systemd/rpcbind.conf +new file mode 100644 +index 0000000..2f8af45 +--- /dev/null ++++ b/systemd/rpcbind.conf +@@ -0,0 +1,2 @@ ++#Type Path Mode UID GID Age Argument ++D /run/rpcbind 0700 rpc rpc - - diff --git a/rpcbind.spec b/rpcbind.spec index 67376e8..2a620a3 100644 --- a/rpcbind.spec +++ b/rpcbind.spec @@ -1,6 +1,6 @@ Name: rpcbind Version: 0.2.3 -Release: 12.rc2%{?dist} +Release: 13.rc2%{?dist} Summary: Universal Addresses to RPC Program Number Mapper Group: System Environment/Daemons License: BSD @@ -8,7 +8,7 @@ URL: http://nfsv4.bullopensource.org BuildRoot: %{_tmppath}/%{name}-%{version}-root-%(%{__id_u} -n) Source0: http://downloads.sourceforge.net/rpcbind/%{name}-%{version}.tar.bz2 -Source1: rpcbind.sysconfig +Source1: %{name}.sysconfig Requires: glibc-common setup Conflicts: man-pages < 2.43-12 @@ -20,8 +20,10 @@ Requires(preun): systemd Requires(postun): systemd coreutils Patch001: rpcbind-0.2.4-rc2.patch +Patch002: rpcbind-0.2.3-create-statdir.patch Patch100: rpcbind-0.2.3-systemd-envfile.patch +Patch101: rpcbind-0.2.3-systemd-tmpfiles.patch Provides: portmap = %{version}-%{release} Obsoletes: portmap <= 4.0-65.3 @@ -35,8 +37,10 @@ RPC calls on a server on that machine. %setup -q %patch001 -p1 +%patch002 -p1 %patch100 -p1 +%patch101 -p1 %build %ifarch s390 s390x PIE="-fPIE" @@ -46,7 +50,7 @@ PIE="-fpie" export PIE RPCBUSR=rpc -RPCBDIR=/tmp +RPCBDIR=/run/rpcbind CFLAGS="`echo $RPM_OPT_FLAGS $ARCH_OPT_FLAGS $PIE`" autoreconf -fisv @@ -64,6 +68,7 @@ make all rm -rf %{buildroot} mkdir -p %{buildroot}{/sbin,/usr/sbin,/etc/sysconfig} mkdir -p %{buildroot}%{_unitdir} +mkdir -p %{buildroot}%{_tmpfilesdir} mkdir -p %{buildroot}%{_mandir}/man8 make DESTDIR=$RPM_BUILD_ROOT install @@ -71,6 +76,7 @@ mv -f ${RPM_BUILD_ROOT}%{_bindir}/rpcbind ${RPM_BUILD_ROOT}/sbin mv -f ${RPM_BUILD_ROOT}%{_bindir}/rpcinfo ${RPM_BUILD_ROOT}%{_sbindir} install -m644 %{SOURCE1} %{buildroot}/etc/sysconfig/rpcbind + %clean rm -rf %{buildroot} @@ -117,10 +123,14 @@ fi /sbin/rpcbind %{_sbindir}/rpcinfo %{_mandir}/man8/* -%{_unitdir}/rpcbind.service -%{_unitdir}/rpcbind.socket +%{_unitdir}/%{name}.service +%{_unitdir}/%{name}.socket +%{_tmpfilesdir}/%{name}.conf %changelog +* Sat Nov 19 2016 Steve Dickson - 0.2.3-13.rc2 +- Create the statedir under /run/rpcbind by systemd-tmpfiles. + * Sat Nov 12 2016 Steve Dickson - 0.2.3-12.rc2 - Stop enable rpcbind.socket with every update (bz 1393721) From feb680b399ba4e41085eef7acf58802dd9e7ef65 Mon Sep 17 00:00:00 2001 From: Steve Dickson Date: Wed, 30 Nov 2016 11:07:23 -0500 Subject: [PATCH 06/16] Update to the latest upstream release: 0.2.4 Signed-off-by: Steve Dickson --- .gitignore | 11 ++--------- rpcbind-0.2.3-systemd-envfile.patch | 2 +- rpcbind.spec | 27 +++++++++++++++------------ sources | 2 +- 4 files changed, 19 insertions(+), 23 deletions(-) diff --git a/.gitignore b/.gitignore index 5ec4602..7f5597c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,2 @@ -rpcbind-0.2.0.tar.bz2 -*.rpm -/rpcbind-0.2.1.tar.bz2 -rpcbind-0.2.0 -rpcbind-0.2.1 -/rpcbind-0.2.2.tar.bz2 -rpcbind-0.2.2 -/rpcbind-0.2.3.tar.bz2 -rpcbind-0.2.3 +rpcbind-0.2.4 +/rpcbind-0.2.4.tar.bz2 diff --git a/rpcbind-0.2.3-systemd-envfile.patch b/rpcbind-0.2.3-systemd-envfile.patch index e8254bd..18382c4 100644 --- a/rpcbind-0.2.3-systemd-envfile.patch +++ b/rpcbind-0.2.3-systemd-envfile.patch @@ -7,6 +7,6 @@ diff -up rpcbind-0.2.3/systemd/rpcbind.service.in.orig rpcbind-0.2.3/systemd/rpc Type=notify -# distro can provide a drop-in adding EnvironmentFile=-/??? if needed. +EnvironmentFile=/etc/sysconfig/rpcbind - ExecStart=@_sbindir@/rpcbind $RPCBIND_OPTIONS -w -f + ExecStart=@_bindir@/rpcbind $RPCBIND_OPTIONS -w -f [Install] diff --git a/rpcbind.spec b/rpcbind.spec index 2a620a3..32b5e27 100644 --- a/rpcbind.spec +++ b/rpcbind.spec @@ -1,6 +1,6 @@ Name: rpcbind -Version: 0.2.3 -Release: 13.rc2%{?dist} +Version: 0.2.4 +Release: 0%{?dist} Summary: Universal Addresses to RPC Program Number Mapper Group: System Environment/Daemons License: BSD @@ -19,9 +19,6 @@ Requires(post): chkconfig systemd Requires(preun): systemd Requires(postun): systemd coreutils -Patch001: rpcbind-0.2.4-rc2.patch -Patch002: rpcbind-0.2.3-create-statdir.patch - Patch100: rpcbind-0.2.3-systemd-envfile.patch Patch101: rpcbind-0.2.3-systemd-tmpfiles.patch @@ -36,9 +33,6 @@ RPC calls on a server on that machine. %prep %setup -q -%patch001 -p1 -%patch002 -p1 - %patch100 -p1 %patch101 -p1 %build @@ -66,16 +60,20 @@ make all %install rm -rf %{buildroot} -mkdir -p %{buildroot}{/sbin,/usr/sbin,/etc/sysconfig} +mkdir -p %{buildroot}{%{_sbindir},%{_bindir},/etc/sysconfig} mkdir -p %{buildroot}%{_unitdir} mkdir -p %{buildroot}%{_tmpfilesdir} mkdir -p %{buildroot}%{_mandir}/man8 make DESTDIR=$RPM_BUILD_ROOT install -mv -f ${RPM_BUILD_ROOT}%{_bindir}/rpcbind ${RPM_BUILD_ROOT}/sbin -mv -f ${RPM_BUILD_ROOT}%{_bindir}/rpcinfo ${RPM_BUILD_ROOT}%{_sbindir} install -m644 %{SOURCE1} %{buildroot}/etc/sysconfig/rpcbind +# The binaries now live in /usr/bin, moving from /usr/sbin +# For compatibility create a couple symlinks. +cd ${RPM_BUILD_ROOT}%{_sbindir} +ln -sf ../bin/rpcbind +ln -sf ../bin/rpcinfo + %clean rm -rf %{buildroot} @@ -120,7 +118,9 @@ fi %defattr(-,root,root) %config(noreplace) /etc/sysconfig/rpcbind %doc AUTHORS ChangeLog README -/sbin/rpcbind +%{_bindir}/rpcbind +%{_bindir}/rpcinfo +%{_sbindir}/rpcbind %{_sbindir}/rpcinfo %{_mandir}/man8/* %{_unitdir}/%{name}.service @@ -128,6 +128,9 @@ fi %{_tmpfilesdir}/%{name}.conf %changelog +* Wed Nov 30 2016 Steve Dickson - 0.2.4-0 +- Update to the latest upstream release: 0.2.4 + * Sat Nov 19 2016 Steve Dickson - 0.2.3-13.rc2 - Create the statedir under /run/rpcbind by systemd-tmpfiles. diff --git a/sources b/sources index e77f0b2..9caa437 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -c8875246b2688a1adfbd6ad43480278d rpcbind-0.2.3.tar.bz2 +cf10cd41ed8228fc54c316191c1f07fe rpcbind-0.2.4.tar.bz2 From 3c0595715bbe3e94d892f694da4db05c3e044e04 Mon Sep 17 00:00:00 2001 From: Steve Dickson Date: Tue, 3 Jan 2017 13:56:22 -0500 Subject: [PATCH 07/16] Fix boot dependency in systemd service file (bz 1401561) Signed-off-by: Steve Dickson --- .gitignore | 2 ++ rpcbind-0.2.4-systemd-statdir.patch | 27 +++++++++++++++++++++++++++ rpcbind.spec | 10 +++++++++- 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 rpcbind-0.2.4-systemd-statdir.patch diff --git a/.gitignore b/.gitignore index 7f5597c..d7a7da0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ rpcbind-0.2.4 /rpcbind-0.2.4.tar.bz2 +x86_64 +Makefile diff --git a/rpcbind-0.2.4-systemd-statdir.patch b/rpcbind-0.2.4-systemd-statdir.patch new file mode 100644 index 0000000..f00b30d --- /dev/null +++ b/rpcbind-0.2.4-systemd-statdir.patch @@ -0,0 +1,27 @@ +commit ee569be4d6189a68b38d2af162af00ff475b48e2 +Author: Yann Leprince +Date: Wed Dec 21 14:32:54 2016 -0500 + + Fix boot dependency in systemd service file + + From: Yann Leprince + + This fix ensures that a separate /var partition will be mounted before + rpcbind tries to write its status to /var/run. + + Acked-by: NeilBrown + Signed-off-by: Yann Leprince + Signed-off-by: Steve Dickson + +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. diff --git a/rpcbind.spec b/rpcbind.spec index 32b5e27..884c542 100644 --- a/rpcbind.spec +++ b/rpcbind.spec @@ -1,6 +1,6 @@ Name: rpcbind Version: 0.2.4 -Release: 0%{?dist} +Release: 1%{?dist} Summary: Universal Addresses to RPC Program Number Mapper Group: System Environment/Daemons License: BSD @@ -19,6 +19,8 @@ Requires(post): chkconfig systemd Requires(preun): systemd Requires(postun): systemd coreutils +Patch001: rpcbind-0.2.4-systemd-statdir.patch + Patch100: rpcbind-0.2.3-systemd-envfile.patch Patch101: rpcbind-0.2.3-systemd-tmpfiles.patch @@ -33,6 +35,9 @@ RPC calls on a server on that machine. %prep %setup -q +# 1401561 - rpcbind-0.2.3-12.rc2.fc24 fails to start at boot +%patch001 -p1 + %patch100 -p1 %patch101 -p1 %build @@ -128,6 +133,9 @@ fi %{_tmpfilesdir}/%{name}.conf %changelog +* Tue Jan 3 2017 Steve Dickson - 0.2.4-1 +- Fix boot dependency in systemd service file (bz 1401561) + * Wed Nov 30 2016 Steve Dickson - 0.2.4-0 - Update to the latest upstream release: 0.2.4 From f458dbe14bfef2b3dd9095fef519229f5eba5a91 Mon Sep 17 00:00:00 2001 From: Steve Dickson Date: Mon, 16 Jan 2017 11:28:52 -0500 Subject: [PATCH 08/16] Document /run/rpcbind is the state directory (bz 1401561) Signed-off-by: Steve Dickson --- rpcbind-0.2.4-runstatdir.patch | 61 ++++++++++++++++++++++++++++++++++ rpcbind.spec | 7 +++- 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 rpcbind-0.2.4-runstatdir.patch diff --git a/rpcbind-0.2.4-runstatdir.patch b/rpcbind-0.2.4-runstatdir.patch new file mode 100644 index 0000000..53abb23 --- /dev/null +++ b/rpcbind-0.2.4-runstatdir.patch @@ -0,0 +1,61 @@ +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 2017-01-16 11:19:12.888958858 -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 2017-01-03 13:51:50.222749413 -0500 ++++ rpcbind-0.2.4/configure 2017-01-16 11:20:29.650978018 -0500 +@@ -1389,7 +1389,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] + +@@ -3887,7 +3887,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-01-16 11:19:12.888958858 -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-01-16 11:20:16.499974736 -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; diff --git a/rpcbind.spec b/rpcbind.spec index 884c542..13fcb09 100644 --- a/rpcbind.spec +++ b/rpcbind.spec @@ -1,6 +1,6 @@ Name: rpcbind Version: 0.2.4 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Universal Addresses to RPC Program Number Mapper Group: System Environment/Daemons License: BSD @@ -23,6 +23,7 @@ Patch001: rpcbind-0.2.4-systemd-statdir.patch Patch100: rpcbind-0.2.3-systemd-envfile.patch Patch101: rpcbind-0.2.3-systemd-tmpfiles.patch +Patch102: rpcbind-0.2.4-runstatdir.patch Provides: portmap = %{version}-%{release} Obsoletes: portmap <= 4.0-65.3 @@ -40,6 +41,7 @@ RPC calls on a server on that machine. %patch100 -p1 %patch101 -p1 +%patch102 -p1 %build %ifarch s390 s390x PIE="-fPIE" @@ -133,6 +135,9 @@ fi %{_tmpfilesdir}/%{name}.conf %changelog +* Mon Jan 16 2017 Steve Dickson - 0.2.4-2 +- Document /run/rpcbind is the state directory (bz 1401561) + * Tue Jan 3 2017 Steve Dickson - 0.2.4-1 - Fix boot dependency in systemd service file (bz 1401561) From 38c5c9fae62130ff8b03715b907ef0efaae9d6a7 Mon Sep 17 00:00:00 2001 From: Steve Dickson Date: Mon, 23 Jan 2017 13:40:39 -0500 Subject: [PATCH 09/16] Create a systemd dependency for tmpfiles-setup.service (bz 1401561) Signed-off-by: Steve Dickson --- rpcbind.service | 2 ++ rpcbind.spec | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/rpcbind.service b/rpcbind.service index 12c1401..9bdf489 100644 --- a/rpcbind.service +++ b/rpcbind.service @@ -1,6 +1,8 @@ [Unit] Description=RPC bind service Requires=rpcbind.socket +Wants=systemd-tmpfiles-setup.service +After=systemd-tmpfiles-setup.service [Service] Type=forking diff --git a/rpcbind.spec b/rpcbind.spec index 13fcb09..ba471aa 100644 --- a/rpcbind.spec +++ b/rpcbind.spec @@ -1,6 +1,6 @@ Name: rpcbind Version: 0.2.4 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Universal Addresses to RPC Program Number Mapper Group: System Environment/Daemons License: BSD @@ -135,6 +135,9 @@ fi %{_tmpfilesdir}/%{name}.conf %changelog +* Mon Jan 23 2017 Steve Dickson - 0.2.4-3 +- Create a systemd dependency for tmpfiles-setup.service (bz 1401561) + * Mon Jan 16 2017 Steve Dickson - 0.2.4-2 - Document /run/rpcbind is the state directory (bz 1401561) From 0df1187eb1cde0df1a2cd1ffb09ab7782a9b5471 Mon Sep 17 00:00:00 2001 From: Steve Dickson Date: Sat, 28 Jan 2017 15:46:33 -0500 Subject: [PATCH 10/16] Corrected boot dependency in systemd files (bz 1401561) Signed-off-by: Steve Dickson --- rpcbind-0.2.4-systemd-service.patch | 14 ++++++++++++++ rpcbind.service | 13 ------------- rpcbind.socket | 8 -------- rpcbind.spec | 7 ++++++- 4 files changed, 20 insertions(+), 22 deletions(-) create mode 100644 rpcbind-0.2.4-systemd-service.patch delete mode 100644 rpcbind.service delete mode 100644 rpcbind.socket diff --git a/rpcbind-0.2.4-systemd-service.patch b/rpcbind-0.2.4-systemd-service.patch new file mode 100644 index 0000000..4e5c20f --- /dev/null +++ b/rpcbind-0.2.4-systemd-service.patch @@ -0,0 +1,14 @@ +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 2017-01-28 13:13:43.763324301 -0500 +@@ -6,8 +6,8 @@ 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 ++Wants=rpcbind.socket systemd-tmpfiles-setup.service ++After=rpcbind.socket systemd-tmpfiles-setup.service + + [Service] + Type=notify diff --git a/rpcbind.service b/rpcbind.service deleted file mode 100644 index 9bdf489..0000000 --- a/rpcbind.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=RPC bind service -Requires=rpcbind.socket -Wants=systemd-tmpfiles-setup.service -After=systemd-tmpfiles-setup.service - -[Service] -Type=forking -EnvironmentFile=/etc/sysconfig/rpcbind -ExecStart=/sbin/rpcbind -w $RPCBIND_ARGS - -[Install] -Also=rpcbind.socket diff --git a/rpcbind.socket b/rpcbind.socket deleted file mode 100644 index d63c1d9..0000000 --- a/rpcbind.socket +++ /dev/null @@ -1,8 +0,0 @@ -[Unit] -Description=RPCbind Server Activation Socket - -[Socket] -ListenStream=/var/run/rpcbind.sock - -[Install] -WantedBy=sockets.target diff --git a/rpcbind.spec b/rpcbind.spec index ba471aa..750674a 100644 --- a/rpcbind.spec +++ b/rpcbind.spec @@ -1,6 +1,6 @@ Name: rpcbind Version: 0.2.4 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Universal Addresses to RPC Program Number Mapper Group: System Environment/Daemons License: BSD @@ -24,6 +24,7 @@ Patch001: rpcbind-0.2.4-systemd-statdir.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 Provides: portmap = %{version}-%{release} Obsoletes: portmap <= 4.0-65.3 @@ -42,6 +43,7 @@ RPC calls on a server on that machine. %patch100 -p1 %patch101 -p1 %patch102 -p1 +%patch103 -p1 %build %ifarch s390 s390x PIE="-fPIE" @@ -135,6 +137,9 @@ fi %{_tmpfilesdir}/%{name}.conf %changelog +* Sat Jan 28 2017 Steve Dickson - 0.2.4-4 +- Corrected boot dependency in systemd files (bz 1401561) + * Mon Jan 23 2017 Steve Dickson - 0.2.4-3 - Create a systemd dependency for tmpfiles-setup.service (bz 1401561) From d871d5c868c28067c35f38536c20f711731c61a6 Mon Sep 17 00:00:00 2001 From: Steve Dickson Date: Tue, 21 Mar 2017 10:55:19 -0400 Subject: [PATCH 11/16] Try creating statdir once when opening lock file fails (bz 1401561) Signed-off-by: Steve Dickson --- rpcbind-0.2.4-systemd-rundir.patch | 35 ++++++++++++++++++++++++++++++ rpcbind.spec | 7 +++++- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 rpcbind-0.2.4-systemd-rundir.patch diff --git a/rpcbind-0.2.4-systemd-rundir.patch b/rpcbind-0.2.4-systemd-rundir.patch new file mode 100644 index 0000000..da08d7a --- /dev/null +++ b/rpcbind-0.2.4-systemd-rundir.patch @@ -0,0 +1,35 @@ +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 + static void terminate(int); + static void parseargs(int, char *[]); + ++char *systemdtmp = "/usr/bin/systemd-tmpfiles --create rpcbind.conf"; ++ + int + main(int argc, char *argv[]) + { +@@ -151,13 +153,21 @@ main(int argc, char *argv[]) + void *nc_handle; /* Net config handle */ + struct rlimit rl; + int maxrec = RPC_MAXDATASIZE; ++ int once = 1; + + parseargs(argc, argv); + ++tryagain: + /* Check that another rpcbind isn't already running. */ + if ((rpcbindlockfd = (open(RPCBINDDLOCK, +- O_RDONLY|O_CREAT, 0444))) == -1) ++ O_RDONLY|O_CREAT, 0444))) == -1) { ++ if (once) { ++ once = system(systemdtmp); /* set once to avoid a warning */ ++ once = 0; ++ goto tryagain; ++ } + err(1, "%s", RPCBINDDLOCK); ++ } + + if(flock(rpcbindlockfd, LOCK_EX|LOCK_NB) == -1 && errno == EWOULDBLOCK) + errx(1, "another rpcbind is already running. Aborting"); diff --git a/rpcbind.spec b/rpcbind.spec index 750674a..7a538ab 100644 --- a/rpcbind.spec +++ b/rpcbind.spec @@ -1,6 +1,6 @@ Name: rpcbind Version: 0.2.4 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Universal Addresses to RPC Program Number Mapper Group: System Environment/Daemons License: BSD @@ -25,6 +25,7 @@ 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} Obsoletes: portmap <= 4.0-65.3 @@ -44,6 +45,7 @@ RPC calls on a server on that machine. %patch101 -p1 %patch102 -p1 %patch103 -p1 +%patch104 -p1 %build %ifarch s390 s390x PIE="-fPIE" @@ -137,6 +139,9 @@ fi %{_tmpfilesdir}/%{name}.conf %changelog +* Tue Mar 21 2017 Steve Dickson - 0.2.4-5 +* Try creating statdir once when opening lock file fails (bz 1401561) + * Sat Jan 28 2017 Steve Dickson - 0.2.4-4 - Corrected boot dependency in systemd files (bz 1401561) From d9b5fa47f8117f9ec8f86d85bb0261b8ff7a68c5 Mon Sep 17 00:00:00 2001 From: Steve Dickson Date: Thu, 11 May 2017 12:05:09 -0400 Subject: [PATCH 12/16] Fixed memory leaks (bz 1448128) Signed-off-by: Steve Dickson --- rpcbind-0.2.4-rc1.patch | 193 ----------- rpcbind-0.2.4-rc2.patch | 474 ---------------------------- rpcbind-0.2.4-systemd-statdir.patch | 27 -- rpcbind-0.2.5-rc1.patch | 185 +++++++++++ rpcbind.spec | 9 +- 5 files changed, 191 insertions(+), 697 deletions(-) delete mode 100644 rpcbind-0.2.4-rc1.patch delete mode 100644 rpcbind-0.2.4-rc2.patch delete mode 100644 rpcbind-0.2.4-systemd-statdir.patch create mode 100644 rpcbind-0.2.5-rc1.patch diff --git a/rpcbind-0.2.4-rc1.patch b/rpcbind-0.2.4-rc1.patch deleted file mode 100644 index be4b115..0000000 --- a/rpcbind-0.2.4-rc1.patch +++ /dev/null @@ -1,193 +0,0 @@ -diff --git a/src/rpcb_svc_com.c b/src/rpcb_svc_com.c -index ff9ce6b..148fe42 100644 ---- a/src/rpcb_svc_com.c -+++ b/src/rpcb_svc_com.c -@@ -536,10 +536,6 @@ create_rmtcall_fd(struct netconfig *nconf) - rmttail->next = rmt; - rmttail = rmt; - } -- /* XXX not threadsafe */ -- if (fd > svc_maxfd) -- svc_maxfd = fd; -- FD_SET(fd, &svc_fdset); - return (fd); - } - -@@ -1056,9 +1052,6 @@ free_slot_by_index(int index) - fi = &FINFO[index]; - if (fi->flag & FINFO_ACTIVE) { - netbuffree(fi->caller_addr); -- /* XXX may be too big, but can't access xprt array here */ -- if (fi->forward_fd >= svc_maxfd) -- svc_maxfd--; - free(fi->uaddr); - fi->flag &= ~FINFO_ACTIVE; - rpcb_rmtcalls--; -@@ -1097,35 +1090,28 @@ netbuffree(struct netbuf *ap) - } - - --#define MASKVAL (POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND) --extern bool_t __svc_clean_idle(fd_set *, int, bool_t); -- - void - my_svc_run() - { -- size_t nfds; -- struct pollfd pollfds[FD_SETSIZE]; - int poll_ret, check_ret; - int n; --#ifdef SVC_RUN_DEBUG -- int i; --#endif -- register struct pollfd *p; -- fd_set cleanfds; - - for (;;) { -- p = pollfds; -- for (n = 0; n <= svc_maxfd; n++) { -- if (FD_ISSET(n, &svc_fdset)) { -- p->fd = n; -- p->events = MASKVAL; -- p++; -- } -- } -- nfds = p - pollfds; -- poll_ret = 0; -+ struct pollfd my_pollfd[svc_max_pollfd]; -+ int i; -+ -+ if (svc_max_pollfd == 0 && svc_pollfd == NULL) -+ return; - -- switch (poll_ret = poll(pollfds, nfds, 30 * 1000)) { -+ -+ for (i = 0; i < svc_max_pollfd; ++i) -+ { -+ my_pollfd[i].fd = svc_pollfd[i].fd; -+ my_pollfd[i].events = svc_pollfd[i].events; -+ my_pollfd[i].revents = 0; -+ } -+ -+ switch (poll_ret = poll(my_pollfd, svc_max_pollfd, 30 * 1000)) { - case -1: - /* - * We ignore all errors, continuing with the assumption -@@ -1133,8 +1119,6 @@ my_svc_run() - * other outside event) and not caused by poll(). - */ - case 0: -- cleanfds = svc_fdset; -- __svc_clean_idle(&cleanfds, 30, FALSE); - continue; - default: - /* -@@ -1144,10 +1128,10 @@ my_svc_run() - * don't call svc_getreq_poll. Otherwise, there - * must be another so we must call svc_getreq_poll. - */ -- if ((check_ret = check_rmtcalls(pollfds, nfds)) == -+ if ((check_ret = check_rmtcalls(my_pollfd, svc_max_pollfd)) == - poll_ret) - continue; -- svc_getreq_poll(pollfds, poll_ret-check_ret); -+ svc_getreq_poll(my_pollfd, poll_ret-check_ret); - } - } - } -@@ -1183,12 +1167,33 @@ check_rmtcalls(struct pollfd *pfds, int nfds) - return (ncallbacks_found); - } - -+/* -+ * This is really a helper function defined in libtirpc, -+ * but unfortunately, it hasn't been exported yet. -+ */ -+static struct netbuf * -+__rpc_set_netbuf(struct netbuf *nb, const void *ptr, size_t len) -+{ -+ if (nb->len != len) { -+ if (nb->len) -+ mem_free(nb->buf, nb->len); -+ nb->buf = mem_alloc(len); -+ if (nb->buf == NULL) -+ return NULL; -+ -+ nb->maxlen = nb->len = len; -+ } -+ memcpy(nb->buf, ptr, len); -+ return nb; -+} -+ - static void - xprt_set_caller(SVCXPRT *xprt, struct finfo *fi) - { -+ const struct netbuf *caller = fi->caller_addr; - u_int32_t *xidp; - -- *(svc_getrpccaller(xprt)) = *(fi->caller_addr); -+ __rpc_set_netbuf(svc_getrpccaller(xprt), caller->buf, caller->len); - xidp = __rpcb_get_dg_xidp(xprt); - *xidp = fi->caller_xid; - } -@@ -1274,10 +1279,17 @@ handle_reply(int fd, SVCXPRT *xprt) - a.rmt_localvers = fi->versnum; - - xprt_set_caller(xprt, fi); -+#if defined(SVC_XP_AUTH) -+ SVC_XP_AUTH(xprt) = svc_auth_none; -+#else - xprt->xp_auth = &svc_auth_none; -+#endif - svc_sendreply(xprt, (xdrproc_t) xdr_rmtcall_result, (char *) &a); -+#if !defined(SVC_XP_AUTH) - SVCAUTH_DESTROY(xprt->xp_auth); - xprt->xp_auth = NULL; -+#endif -+ - done: - if (buffer) - free(buffer); -diff --git a/src/rpcbind.c b/src/rpcbind.c -index 045daa1..c4265cd 100644 ---- a/src/rpcbind.c -+++ b/src/rpcbind.c -@@ -87,6 +87,7 @@ static inline void __nss_configure_lookup(const char *db, const char *s) {} - 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? */ - - rpcblist_ptr list_rbl; /* A list of version 3/4 rpcbind services */ - -@@ -445,6 +446,7 @@ init_transport(struct netconfig *nconf) - memset(&sun, 0, sizeof sun); - sun.sun_family = AF_LOCAL; - unlink(_PATH_RPCBINDSOCK); -+ createdsocket = 1; /* We are now in the process of creating the unix socket */ - strcpy(sun.sun_path, _PATH_RPCBINDSOCK); - addrlen = SUN_LEN(&sun); - sa = (struct sockaddr *)&sun; -@@ -846,7 +848,8 @@ static void - terminate(int dummy /*__unused*/) - { - close(rpcbindlockfd); -- unlink(_PATH_RPCBINDSOCK); -+ if(createdsocket) -+ unlink(_PATH_RPCBINDSOCK); - unlink(RPCBINDDLOCK); - #ifdef WARMSTART - write_warmstart(); /* Dump yourself */ -diff --git a/src/security.c b/src/security.c -index 0c9453f..c54ce26 100644 ---- a/src/security.c -+++ b/src/security.c -@@ -17,6 +17,8 @@ - #include - #include - -+#include "xlog.h" -+ - /* - * XXX for special case checks in check_callit. - */ diff --git a/rpcbind-0.2.4-rc2.patch b/rpcbind-0.2.4-rc2.patch deleted file mode 100644 index c29d949..0000000 --- a/rpcbind-0.2.4-rc2.patch +++ /dev/null @@ -1,474 +0,0 @@ -diff --git a/.gitignore b/.gitignore -index 321dff6..a8f1fed 100644 ---- a/.gitignore -+++ b/.gitignore -@@ -27,3 +27,4 @@ rpcbind - rpcinfo - # cscope database files - cscope.* -+systemd/rpcbind.service -diff --git a/Makefile.am b/Makefile.am -index 5ec8cd6..43c2710 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -50,6 +50,10 @@ if SYSTEMD - AM_CPPFLAGS += $(SYSTEMD_CFLAGS) -DSYSTEMD - - rpcbind_LDADD += $(SYSTEMD_LIBS) -+ -+systemdsystemunit_DATA = \ -+ systemd/rpcbind.service \ -+ systemd/rpcbind.socket - endif - - rpcinfo_SOURCES = src/rpcinfo.c -diff --git a/configure.ac b/configure.ac -index af4b74b..f84921e 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -61,4 +61,9 @@ AC_SEARCH_LIBS([pthread_create], [pthread]) - - AC_CHECK_HEADERS([nss.h rpcsvc/mount.h]) - --AC_OUTPUT([Makefile]) -+# make sbindir available for substitution in config file -+# 2 "evals" needed to expand variable names -+AC_SUBST([_sbindir]) -+AC_CONFIG_COMMANDS_PRE([eval eval _sbindir=$sbindir]) -+ -+AC_OUTPUT([Makefile systemd/rpcbind.service]) -diff --git a/src/check_bound.c b/src/check_bound.c -index c70b845..92bfd36 100644 ---- a/src/check_bound.c -+++ b/src/check_bound.c -@@ -70,7 +70,7 @@ static struct fdlist *fdhead; /* Link list of the check fd's */ - static struct fdlist *fdtail; - static char *nullstring = ""; - --static bool_t check_bound __P((struct fdlist *, char *uaddr)); -+static bool_t check_bound(struct fdlist *, char *uaddr); - - /* - * Returns 1 if the given address is bound for the given addr & transport -diff --git a/src/pmap_svc.c b/src/pmap_svc.c -index ad28b93..4c744fe 100644 ---- a/src/pmap_svc.c -+++ b/src/pmap_svc.c -@@ -60,11 +60,11 @@ static char sccsid[] = "@(#)pmap_svc.c 1.23 89/04/05 Copyr 1984 Sun Micro"; - #include "rpcbind.h" - #include "xlog.h" - #include /* svc_getcaller routine definition */ --static struct pmaplist *find_service_pmap __P((rpcprog_t, rpcvers_t, -- rpcprot_t)); --static bool_t pmapproc_change __P((struct svc_req *, SVCXPRT *, u_long)); --static bool_t pmapproc_getport __P((struct svc_req *, SVCXPRT *)); --static bool_t pmapproc_dump __P((struct svc_req *, SVCXPRT *)); -+static struct pmaplist *find_service_pmap(rpcprog_t, rpcvers_t, -+ rpcprot_t); -+static bool_t pmapproc_change(struct svc_req *, SVCXPRT *, u_long); -+static bool_t pmapproc_getport(struct svc_req *, SVCXPRT *); -+static bool_t pmapproc_dump(struct svc_req *, SVCXPRT *); - - /* - * Called for all the version 2 inquiries. -diff --git a/src/rpcb_svc.c b/src/rpcb_svc.c -index bd92201..709e3fb 100644 ---- a/src/rpcb_svc.c -+++ b/src/rpcb_svc.c -@@ -53,10 +53,10 @@ - #include "rpcbind.h" - #include "xlog.h" - --static void *rpcbproc_getaddr_3_local __P((void *, struct svc_req *, SVCXPRT *, -- rpcvers_t)); --static void *rpcbproc_dump_3_local __P((void *, struct svc_req *, SVCXPRT *, -- rpcvers_t)); -+static void *rpcbproc_getaddr_3_local(void *, struct svc_req *, SVCXPRT *, -+ rpcvers_t); -+static void *rpcbproc_dump_3_local(void *, struct svc_req *, SVCXPRT *, -+ rpcvers_t); - - /* - * Called by svc_getreqset. There is a separate server handle for -@@ -75,7 +75,7 @@ rpcb_service_3(struct svc_req *rqstp, SVCXPRT *transp) - } argument; - char *result; - xdrproc_t xdr_argument, xdr_result; -- void *(*local) __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t)); -+ void *(*local)(void *, struct svc_req *, SVCXPRT *, rpcvers_t); - rpcprog_t setprog = 0; - - rpcbs_procinfo(RPCBVERS_3_STAT, rqstp->rq_proc); -diff --git a/src/rpcb_svc_4.c b/src/rpcb_svc_4.c -index b673452..5094879 100644 ---- a/src/rpcb_svc_4.c -+++ b/src/rpcb_svc_4.c -@@ -54,13 +54,11 @@ - #include "rpcbind.h" - #include "xlog.h" - --static void *rpcbproc_getaddr_4_local __P((void *, struct svc_req *, SVCXPRT *, -- rpcvers_t)); --static void *rpcbproc_getversaddr_4_local __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t)); --static void *rpcbproc_getaddrlist_4_local -- __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t)); --static void free_rpcb_entry_list __P((rpcb_entry_list_ptr *)); --static void *rpcbproc_dump_4_local __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t)); -+static void *rpcbproc_getaddr_4_local(void *, struct svc_req *, SVCXPRT *, rpcvers_t); -+static void *rpcbproc_getversaddr_4_local(void *, struct svc_req *, SVCXPRT *, rpcvers_t); -+static void *rpcbproc_getaddrlist_4_local(void *, struct svc_req *, SVCXPRT *, rpcvers_t); -+static void free_rpcb_entry_list(rpcb_entry_list_ptr *); -+static void *rpcbproc_dump_4_local(void *, struct svc_req *, SVCXPRT *, rpcvers_t); - - /* - * Called by svc_getreqset. There is a separate server handle for -@@ -78,7 +76,7 @@ rpcb_service_4(struct svc_req *rqstp, SVCXPRT *transp) - } argument; - char *result; - xdrproc_t xdr_argument, xdr_result; -- void *(*local) __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t)); -+ void *(*local)(void *, struct svc_req *, SVCXPRT *, rpcvers_t); - rpcprog_t setprog = 0; - - rpcbs_procinfo(RPCBVERS_4_STAT, rqstp->rq_proc); -diff --git a/src/rpcb_svc_com.c b/src/rpcb_svc_com.c -index ff9ce6b..5862c26 100644 ---- a/src/rpcb_svc_com.c -+++ b/src/rpcb_svc_com.c -@@ -100,29 +100,29 @@ struct finfo { - static struct finfo FINFO[NFORWARD]; - - --static bool_t xdr_encap_parms __P((XDR *, struct encap_parms *)); --static bool_t xdr_rmtcall_args __P((XDR *, struct r_rmtcall_args *)); --static bool_t xdr_rmtcall_result __P((XDR *, struct r_rmtcall_args *)); --static bool_t xdr_opaque_parms __P((XDR *, struct r_rmtcall_args *)); --static int find_rmtcallfd_by_netid __P((char *)); --static SVCXPRT *find_rmtcallxprt_by_fd __P((int)); --static int forward_register __P((u_int32_t, struct netbuf *, int, char *, -- rpcproc_t, rpcvers_t, u_int32_t *)); --static struct finfo *forward_find __P((u_int32_t)); --static int free_slot_by_xid __P((u_int32_t)); --static int free_slot_by_index __P((int)); --static int netbufcmp __P((struct netbuf *, struct netbuf *)); --static struct netbuf *netbufdup __P((struct netbuf *)); --static void netbuffree __P((struct netbuf *)); --static int check_rmtcalls __P((struct pollfd *, int)); --static void xprt_set_caller __P((SVCXPRT *, struct finfo *)); --static void send_svcsyserr __P((SVCXPRT *, struct finfo *)); --static void handle_reply __P((int, SVCXPRT *)); --static void find_versions __P((rpcprog_t, char *, rpcvers_t *, rpcvers_t *)); --static rpcblist_ptr find_service __P((rpcprog_t, rpcvers_t, char *)); --static char *getowner __P((SVCXPRT *, char *, size_t)); --static int add_pmaplist __P((RPCB *)); --static int del_pmaplist __P((RPCB *)); -+static bool_t xdr_encap_parms(XDR *, struct encap_parms *); -+static bool_t xdr_rmtcall_args(XDR *, struct r_rmtcall_args *); -+static bool_t xdr_rmtcall_result(XDR *, struct r_rmtcall_args *); -+static bool_t xdr_opaque_parms(XDR *, struct r_rmtcall_args *); -+static int find_rmtcallfd_by_netid(char *); -+static SVCXPRT *find_rmtcallxprt_by_fd(int); -+static int forward_register(u_int32_t, struct netbuf *, int, char *, -+ rpcproc_t, rpcvers_t, u_int32_t *); -+static struct finfo *forward_find(u_int32_t); -+static int free_slot_by_xid(u_int32_t); -+static int free_slot_by_index(int); -+static int netbufcmp(struct netbuf *, struct netbuf *); -+static struct netbuf *netbufdup(struct netbuf *); -+static void netbuffree(struct netbuf *); -+static int check_rmtcalls(struct pollfd *, int); -+static void xprt_set_caller(SVCXPRT *, struct finfo *); -+static void send_svcsyserr(SVCXPRT *, struct finfo *); -+static void handle_reply(int, SVCXPRT *); -+static void find_versions(rpcprog_t, char *, rpcvers_t *, rpcvers_t *); -+static rpcblist_ptr find_service(rpcprog_t, rpcvers_t, char *); -+static char *getowner(SVCXPRT *, char *, size_t); -+static int add_pmaplist(RPCB *); -+static int del_pmaplist(RPCB *); - - /* - * Set a mapping of program, version, netid -@@ -536,10 +536,6 @@ create_rmtcall_fd(struct netconfig *nconf) - rmttail->next = rmt; - rmttail = rmt; - } -- /* XXX not threadsafe */ -- if (fd > svc_maxfd) -- svc_maxfd = fd; -- FD_SET(fd, &svc_fdset); - return (fd); - } - -@@ -1056,9 +1052,6 @@ free_slot_by_index(int index) - fi = &FINFO[index]; - if (fi->flag & FINFO_ACTIVE) { - netbuffree(fi->caller_addr); -- /* XXX may be too big, but can't access xprt array here */ -- if (fi->forward_fd >= svc_maxfd) -- svc_maxfd--; - free(fi->uaddr); - fi->flag &= ~FINFO_ACTIVE; - rpcb_rmtcalls--; -@@ -1097,35 +1090,28 @@ netbuffree(struct netbuf *ap) - } - - --#define MASKVAL (POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND) --extern bool_t __svc_clean_idle(fd_set *, int, bool_t); -- - void - my_svc_run() - { -- size_t nfds; -- struct pollfd pollfds[FD_SETSIZE]; - int poll_ret, check_ret; - int n; --#ifdef SVC_RUN_DEBUG -- int i; --#endif -- register struct pollfd *p; -- fd_set cleanfds; - - for (;;) { -- p = pollfds; -- for (n = 0; n <= svc_maxfd; n++) { -- if (FD_ISSET(n, &svc_fdset)) { -- p->fd = n; -- p->events = MASKVAL; -- p++; -- } -- } -- nfds = p - pollfds; -- poll_ret = 0; -+ struct pollfd my_pollfd[svc_max_pollfd]; -+ int i; -+ -+ if (svc_max_pollfd == 0 && svc_pollfd == NULL) -+ return; - -- switch (poll_ret = poll(pollfds, nfds, 30 * 1000)) { -+ -+ for (i = 0; i < svc_max_pollfd; ++i) -+ { -+ my_pollfd[i].fd = svc_pollfd[i].fd; -+ my_pollfd[i].events = svc_pollfd[i].events; -+ my_pollfd[i].revents = 0; -+ } -+ -+ switch (poll_ret = poll(my_pollfd, svc_max_pollfd, 30 * 1000)) { - case -1: - /* - * We ignore all errors, continuing with the assumption -@@ -1133,8 +1119,6 @@ my_svc_run() - * other outside event) and not caused by poll(). - */ - case 0: -- cleanfds = svc_fdset; -- __svc_clean_idle(&cleanfds, 30, FALSE); - continue; - default: - /* -@@ -1144,10 +1128,10 @@ my_svc_run() - * don't call svc_getreq_poll. Otherwise, there - * must be another so we must call svc_getreq_poll. - */ -- if ((check_ret = check_rmtcalls(pollfds, nfds)) == -+ if ((check_ret = check_rmtcalls(my_pollfd, svc_max_pollfd)) == - poll_ret) - continue; -- svc_getreq_poll(pollfds, poll_ret-check_ret); -+ svc_getreq_poll(my_pollfd, poll_ret-check_ret); - } - } - } -@@ -1183,12 +1167,33 @@ check_rmtcalls(struct pollfd *pfds, int nfds) - return (ncallbacks_found); - } - -+/* -+ * This is really a helper function defined in libtirpc, -+ * but unfortunately, it hasn't been exported yet. -+ */ -+static struct netbuf * -+__rpc_set_netbuf(struct netbuf *nb, const void *ptr, size_t len) -+{ -+ if (nb->len != len) { -+ if (nb->len) -+ mem_free(nb->buf, nb->len); -+ nb->buf = mem_alloc(len); -+ if (nb->buf == NULL) -+ return NULL; -+ -+ nb->maxlen = nb->len = len; -+ } -+ memcpy(nb->buf, ptr, len); -+ return nb; -+} -+ - static void - xprt_set_caller(SVCXPRT *xprt, struct finfo *fi) - { -+ const struct netbuf *caller = fi->caller_addr; - u_int32_t *xidp; - -- *(svc_getrpccaller(xprt)) = *(fi->caller_addr); -+ __rpc_set_netbuf(svc_getrpccaller(xprt), caller->buf, caller->len); - xidp = __rpcb_get_dg_xidp(xprt); - *xidp = fi->caller_xid; - } -@@ -1274,10 +1279,17 @@ handle_reply(int fd, SVCXPRT *xprt) - a.rmt_localvers = fi->versnum; - - xprt_set_caller(xprt, fi); -+#if defined(SVC_XP_AUTH) -+ SVC_XP_AUTH(xprt) = svc_auth_none; -+#else - xprt->xp_auth = &svc_auth_none; -+#endif - svc_sendreply(xprt, (xdrproc_t) xdr_rmtcall_result, (char *) &a); -+#if !defined(SVC_XP_AUTH) - SVCAUTH_DESTROY(xprt->xp_auth); - xprt->xp_auth = NULL; -+#endif -+ - done: - if (buffer) - free(buffer); -diff --git a/src/rpcbind.c b/src/rpcbind.c -index 045daa1..87ccdc2 100644 ---- a/src/rpcbind.c -+++ b/src/rpcbind.c -@@ -87,6 +87,7 @@ static inline void __nss_configure_lookup(const char *db, const char *s) {} - 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? */ - - rpcblist_ptr list_rbl; /* A list of version 3/4 rpcbind services */ - -@@ -135,13 +136,13 @@ char *tcp_uaddr; /* Universal TCP address */ - static char servname[] = "rpcbind"; - static char superuser[] = "superuser"; - --int main __P((int, char *[])); -+int main(int, char *[]); - --static int init_transport __P((struct netconfig *)); --static void rbllist_add __P((rpcprog_t, rpcvers_t, struct netconfig *, -- struct netbuf *)); --static void terminate __P((int)); --static void parseargs __P((int, char *[])); -+static int init_transport(struct netconfig *); -+static void rbllist_add(rpcprog_t, rpcvers_t, struct netconfig *, -+ struct netbuf *); -+static void terminate(int); -+static void parseargs(int, char *[]); - - int - main(int argc, char *argv[]) -@@ -445,6 +446,7 @@ init_transport(struct netconfig *nconf) - memset(&sun, 0, sizeof sun); - sun.sun_family = AF_LOCAL; - unlink(_PATH_RPCBINDSOCK); -+ createdsocket = 1; /* We are now in the process of creating the unix socket */ - strcpy(sun.sun_path, _PATH_RPCBINDSOCK); - addrlen = SUN_LEN(&sun); - sa = (struct sockaddr *)&sun; -@@ -846,7 +848,8 @@ static void - terminate(int dummy /*__unused*/) - { - close(rpcbindlockfd); -- unlink(_PATH_RPCBINDSOCK); -+ if(createdsocket) -+ unlink(_PATH_RPCBINDSOCK); - unlink(RPCBINDDLOCK); - #ifdef WARMSTART - write_warmstart(); /* Dump yourself */ -diff --git a/src/security.c b/src/security.c -index 0c9453f..c54ce26 100644 ---- a/src/security.c -+++ b/src/security.c -@@ -17,6 +17,8 @@ - #include - #include - -+#include "xlog.h" -+ - /* - * XXX for special case checks in check_callit. - */ -diff --git a/src/util.c b/src/util.c -index a6c835b..74b0284 100644 ---- a/src/util.c -+++ b/src/util.c -@@ -70,7 +70,7 @@ static struct sockaddr_in *local_in4; - static struct sockaddr_in6 *local_in6; - #endif - --static int bitmaskcmp __P((void *, void *, void *, int)); -+static int bitmaskcmp(void *, void *, void *, int); - - /* - * For all bits set in "mask", compare the corresponding bits in -diff --git a/src/warmstart.c b/src/warmstart.c -index b6eb73e..122a058 100644 ---- a/src/warmstart.c -+++ b/src/warmstart.c -@@ -58,8 +58,8 @@ - #define PMAPFILE RPCBIND_STATEDIR "/portmap.xdr" - #endif - --static bool_t write_struct __P((char *, xdrproc_t, void *)); --static bool_t read_struct __P((char *, xdrproc_t, void *)); -+static bool_t write_struct(char *, xdrproc_t, void *); -+static bool_t read_struct(char *, xdrproc_t, void *); - - static bool_t - write_struct(char *filename, xdrproc_t structproc, void *list) -diff --git a/systemd/rpcbind.service.in b/systemd/rpcbind.service.in -new file mode 100644 -index 0000000..c173b83 ---- /dev/null -+++ b/systemd/rpcbind.service.in -@@ -0,0 +1,17 @@ -+[Unit] -+Description=RPC Bind -+Documentation=man:rpcbind(8) -+DefaultDependencies=no -+ -+# Make sure we use the IP addresses listed for -+# rpcbind.socket, no matter how this unit is started. -+Wants=rpcbind.socket -+After=rpcbind.socket -+ -+[Service] -+Type=notify -+# distro can provide a drop-in adding EnvironmentFile=-/??? if needed. -+ExecStart=@_sbindir@/rpcbind $RPCBIND_OPTIONS -w -f -+ -+[Install] -+WantedBy=multi-user.target -diff --git a/systemd/rpcbind.socket b/systemd/rpcbind.socket -new file mode 100644 -index 0000000..3b1a936 ---- /dev/null -+++ b/systemd/rpcbind.socket -@@ -0,0 +1,18 @@ -+[Unit] -+Description=RPCbind Server Activation Socket -+DefaultDependencies=no -+Wants=rpcbind.target -+Before=rpcbind.target -+ -+[Socket] -+ListenStream=/run/rpcbind.sock -+ -+# RPC netconfig can't handle ipv6/ipv4 dual sockets -+BindIPv6Only=ipv6-only -+ListenStream=0.0.0.0:111 -+ListenDatagram=0.0.0.0:111 -+ListenStream=[::]:111 -+ListenDatagram=[::]:111 -+ -+[Install] -+WantedBy=sockets.target diff --git a/rpcbind-0.2.4-systemd-statdir.patch b/rpcbind-0.2.4-systemd-statdir.patch deleted file mode 100644 index f00b30d..0000000 --- a/rpcbind-0.2.4-systemd-statdir.patch +++ /dev/null @@ -1,27 +0,0 @@ -commit ee569be4d6189a68b38d2af162af00ff475b48e2 -Author: Yann Leprince -Date: Wed Dec 21 14:32:54 2016 -0500 - - Fix boot dependency in systemd service file - - From: Yann Leprince - - This fix ensures that a separate /var partition will be mounted before - rpcbind tries to write its status to /var/run. - - Acked-by: NeilBrown - Signed-off-by: Yann Leprince - Signed-off-by: Steve Dickson - -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. diff --git a/rpcbind-0.2.5-rc1.patch b/rpcbind-0.2.5-rc1.patch new file mode 100644 index 0000000..93ef61d --- /dev/null +++ b/rpcbind-0.2.5-rc1.patch @@ -0,0 +1,185 @@ +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) ?: "", + 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_pmap, (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. diff --git a/rpcbind.spec b/rpcbind.spec index 7a538ab..ae95086 100644 --- a/rpcbind.spec +++ b/rpcbind.spec @@ -1,6 +1,6 @@ Name: rpcbind Version: 0.2.4 -Release: 5%{?dist} +Release: 5.rc1%{?dist} Summary: Universal Addresses to RPC Program Number Mapper Group: System Environment/Daemons License: BSD @@ -19,7 +19,7 @@ Requires(post): chkconfig systemd Requires(preun): systemd Requires(postun): systemd coreutils -Patch001: rpcbind-0.2.4-systemd-statdir.patch +Patch001: rpcbind-0.2.5-rc1.patch Patch100: rpcbind-0.2.3-systemd-envfile.patch Patch101: rpcbind-0.2.3-systemd-tmpfiles.patch @@ -139,8 +139,11 @@ fi %{_tmpfilesdir}/%{name}.conf %changelog +* Thu May 11 2017 Steve Dickson - 0.2.4-5.rc1 +- Fixed memory leaks (bz 1448128) + * Tue Mar 21 2017 Steve Dickson - 0.2.4-5 -* Try creating statdir once when opening lock file fails (bz 1401561) +- Try creating statdir once when opening lock file fails (bz 1401561) * Sat Jan 28 2017 Steve Dickson - 0.2.4-4 - Corrected boot dependency in systemd files (bz 1401561) From dec446a1133aaa34cab535dd892a38723952f3a5 Mon Sep 17 00:00:00 2001 From: Steve Dickson Date: Mon, 15 May 2017 13:24:21 -0400 Subject: [PATCH 13/16] Fixed typo in memory leaks patch (bz 1448128) Signed-off-by: Steve Dickson --- rpcbind-0.2.5-rc1.patch | 2 +- rpcbind.spec | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/rpcbind-0.2.5-rc1.patch b/rpcbind-0.2.5-rc1.patch index 93ef61d..6dbfff3 100644 --- a/rpcbind-0.2.5-rc1.patch +++ b/rpcbind-0.2.5-rc1.patch @@ -114,7 +114,7 @@ index 4c744fe..e926cdc 100644 - return (TRUE); + +done: -+ if (!svc_freeargs(xprt, (xdrproc_t) xdr_pmap, (char *)NULL)) { ++ if (!svc_freeargs(xprt, (xdrproc_t) xdr_void, (char *)NULL)) { + if (debugging) { + (void) xlog(LOG_DEBUG, "unable to free arguments\n"); + if (doabort) { diff --git a/rpcbind.spec b/rpcbind.spec index ae95086..5f954e6 100644 --- a/rpcbind.spec +++ b/rpcbind.spec @@ -1,6 +1,6 @@ Name: rpcbind Version: 0.2.4 -Release: 5.rc1%{?dist} +Release: 6.rc1%{?dist} Summary: Universal Addresses to RPC Program Number Mapper Group: System Environment/Daemons License: BSD @@ -139,6 +139,9 @@ fi %{_tmpfilesdir}/%{name}.conf %changelog +Mon May 15 2017 Steve Dickson - 0.2.4-6.rc1 +- Fixed typo in memory leaks patch (bz 1448128) + * Thu May 11 2017 Steve Dickson - 0.2.4-5.rc1 - Fixed memory leaks (bz 1448128) From 34ccc27d72e517fb68cada903cd7316837ddcc3c Mon Sep 17 00:00:00 2001 From: Steve Dickson Date: Mon, 15 May 2017 13:26:03 -0400 Subject: [PATCH 14/16] Fixed typo in spec file Signed-off-by: Steve Dickson --- rpcbind.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpcbind.spec b/rpcbind.spec index 5f954e6..64ba7db 100644 --- a/rpcbind.spec +++ b/rpcbind.spec @@ -139,7 +139,7 @@ fi %{_tmpfilesdir}/%{name}.conf %changelog -Mon May 15 2017 Steve Dickson - 0.2.4-6.rc1 +* Mon May 15 2017 Steve Dickson - 0.2.4-6.rc1 - Fixed typo in memory leaks patch (bz 1448128) * Thu May 11 2017 Steve Dickson - 0.2.4-5.rc1 From a5bff644dcc739aaaa0cedbb8f53085afb273fff Mon Sep 17 00:00:00 2001 From: Steve Dickson Date: Tue, 30 May 2017 12:06:58 -0400 Subject: [PATCH 15/16] Updated to latest upstream RC release: rpcbind-0_2_5-rc2 (bz 1450765) Signed-off-by: Steve Dickson --- rpcbind-0.2.5-rc2.patch | 310 ++++++++++++++++++++++++++++++++++++++++ rpcbind.spec | 8 +- 2 files changed, 315 insertions(+), 3 deletions(-) create mode 100644 rpcbind-0.2.5-rc2.patch diff --git a/rpcbind-0.2.5-rc2.patch b/rpcbind-0.2.5-rc2.patch new file mode 100644 index 0000000..bf89442 --- /dev/null +++ b/rpcbind-0.2.5-rc2.patch @@ -0,0 +1,310 @@ +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) ?: "", + 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. diff --git a/rpcbind.spec b/rpcbind.spec index 64ba7db..6c017be 100644 --- a/rpcbind.spec +++ b/rpcbind.spec @@ -1,6 +1,6 @@ Name: rpcbind Version: 0.2.4 -Release: 6.rc1%{?dist} +Release: 6.rc2%{?dist} Summary: Universal Addresses to RPC Program Number Mapper Group: System Environment/Daemons License: BSD @@ -19,7 +19,7 @@ Requires(post): chkconfig systemd Requires(preun): systemd Requires(postun): systemd coreutils -Patch001: rpcbind-0.2.5-rc1.patch +Patch001: rpcbind-0.2.5-rc2.patch Patch100: rpcbind-0.2.3-systemd-envfile.patch Patch101: rpcbind-0.2.3-systemd-tmpfiles.patch @@ -139,7 +139,9 @@ fi %{_tmpfilesdir}/%{name}.conf %changelog -* Mon May 15 2017 Steve Dickson - 0.2.4-6.rc1 +* Mon May 15 2017 Steve Dickson - 0.2.4-6.rc2 +- Updated to latest upstream RC release: rpcbind-0_2_5-rc2 (bz 1450765) + - Fixed typo in memory leaks patch (bz 1448128) * Thu May 11 2017 Steve Dickson - 0.2.4-5.rc1 From 6f737218734892c120b0fc96dfccbf93d57d97da Mon Sep 17 00:00:00 2001 From: Nils Philippsen Date: Wed, 6 Sep 2017 11:14:03 -0400 Subject: [PATCH 16/16] rpcbind: Create and formally own the state directory So the directory is available from the time of first installation until reboot Signed-off-by: Steve Dickson --- rpcbind.spec | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/rpcbind.spec b/rpcbind.spec index 6c017be..1a29d14 100644 --- a/rpcbind.spec +++ b/rpcbind.spec @@ -1,6 +1,10 @@ +# These are macros to be usable outside of the build section +%global rpcbind_user_group rpc +%global rpcbind_state_dir %{_rundir}/rpcbind + Name: rpcbind Version: 0.2.4 -Release: 6.rc2%{?dist} +Release: 7.rc2%{?dist} Summary: Universal Addresses to RPC Program Number Mapper Group: System Environment/Daemons License: BSD @@ -54,15 +58,13 @@ PIE="-fpie" %endif export PIE -RPCBUSR=rpc -RPCBDIR=/run/rpcbind CFLAGS="`echo $RPM_OPT_FLAGS $ARCH_OPT_FLAGS $PIE`" autoreconf -fisv %configure CFLAGS="$CFLAGS" LDFLAGS="-pie" \ --enable-warmstarts \ - --with-statedir="$RPCBDIR" \ - --with-rpcuser="$RPCBUSR" \ + --with-statedir="%rpcbind_state_dir" \ + --with-rpcuser="%rpcbind_user_group" \ --with-nss-modules="files altfiles" \ --enable-libwrap \ --enable-debug @@ -75,6 +77,7 @@ mkdir -p %{buildroot}{%{_sbindir},%{_bindir},/etc/sysconfig} mkdir -p %{buildroot}%{_unitdir} mkdir -p %{buildroot}%{_tmpfilesdir} mkdir -p %{buildroot}%{_mandir}/man8 +mkdir -p %{buildroot}%{rpcbind_state_dir} make DESTDIR=$RPM_BUILD_ROOT install install -m644 %{SOURCE1} %{buildroot}/etc/sysconfig/rpcbind @@ -137,8 +140,13 @@ fi %{_unitdir}/%{name}.service %{_unitdir}/%{name}.socket %{_tmpfilesdir}/%{name}.conf +%attr(0700, %{rpcbind_user_group}, %{rpcbind_user_group}) %dir %{rpcbind_state_dir} %changelog +* Wed Sep 06 2017 Nils Philippsen - 0.2.4-7.rc2 +- create and formally own the state directory so it is available from the time + of first installation until reboot + * Mon May 15 2017 Steve Dickson - 0.2.4-6.rc2 - Updated to latest upstream RC release: rpcbind-0_2_5-rc2 (bz 1450765)