aboutsummaryrefslogtreecommitdiffstats
path: root/community/pdsh/without-rresvport.patch
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2017-10-23 22:48:25 +0200
committerJakub Jirutka <jakub@jirutka.cz>2017-10-23 22:48:43 +0200
commit33b89ed8287cea26787718bf7a4005d7edb14049 (patch)
tree060c9aa9a68f24fac380677f3be24814d19adf1d /community/pdsh/without-rresvport.patch
parent4435a760f3849e154c64981674798165689c4006 (diff)
downloadaports-33b89ed8287cea26787718bf7a4005d7edb14049.tar.bz2
aports-33b89ed8287cea26787718bf7a4005d7edb14049.tar.xz
community/pdsh: move from testing
Diffstat (limited to 'community/pdsh/without-rresvport.patch')
-rw-r--r--community/pdsh/without-rresvport.patch94
1 files changed, 94 insertions, 0 deletions
diff --git a/community/pdsh/without-rresvport.patch b/community/pdsh/without-rresvport.patch
new file mode 100644
index 0000000000..e5c3a0f5aa
--- /dev/null
+++ b/community/pdsh/without-rresvport.patch
@@ -0,0 +1,94 @@
+From 48c728dfefa3b9aff01f598ff9d3f909001b8e81 Mon Sep 17 00:00:00 2001
+From: Mark Grondona <grondo@eris.llnl.gov>
+Date: Thu, 10 Mar 2016 16:01:18 -0800
+Subject: [PATCH] privsep: do nothing if !HAVE_RRESVPORT
+
+If we don't have rresvport() do not enable privsep during
+privsep_init() (it probably isn't used anyway). Also be sure
+to undefine usage of rresvport and rresvport_af since these
+symbols won't be found at compile or runtime.
+
+Fixes #74
+
+Patch-Source: https://github.com/chaos/pdsh/commit/48c728dfefa3b9aff01f598ff9d3f909001b8e81
+
+diff --git a/src/pdsh/privsep.c b/src/pdsh/privsep.c
+index 7e4134f..2297b17 100644
+--- a/src/pdsh/privsep.c
++++ b/src/pdsh/privsep.c
+@@ -123,6 +123,10 @@ static int send_rresvport (int pipefd, int fd, int lport)
+
+ cmsg = (struct cmsghdr *) &buf;
+ #endif
++#if !HAVE_RRESVPORT
++ errno = ENOSYS;
++ return (-1);
++#endif
+
+ memset (&msg, 0, sizeof (msg));
+
+@@ -162,6 +166,7 @@ static int send_rresvport (int pipefd, int fd, int lport)
+ return (0);
+ }
+
++#if HAVE_RRESVPORT
+ static int recv_rresvport (int pipefd, int *lptr)
+ {
+ int fd = -1;
+@@ -203,19 +208,23 @@ static int recv_rresvport (int pipefd, int *lptr)
+
+ return (fd);
+ }
++#endif /* HAVE_RRESVPORT */
+
+
+ static int p_rresvport_af (int *port, int family)
+ {
+ #if HAVE_RRESVPORT_AF
+ return rresvport_af (port, family);
+-#else
++#elif HAVE_RRESVPORT
+ /* Family must be AF_INET
+ */
+ if (family != AF_INET)
+ err ("%p: rresvport called with family != AF_INET!\n");
+ /* ignore family != AF_INET */
+ return rresvport (port);
++#else
++ errno = ENOSYS;
++ return (-1);
+ #endif
+ }
+
+@@ -274,6 +283,9 @@ static int create_privileged_child (void)
+
+ int privsep_init (void)
+ {
++#if !HAVE_RRESVPORT
++ return (0);
++#endif
+ if (geteuid() == getuid())
+ return 0;
+
+@@ -285,6 +297,9 @@ int privsep_init (void)
+
+ int privsep_fini (void)
+ {
++#if !HAVE_RRESVPORT
++ return (0);
++#endif
+ int status;
+ if (client_fd < 0 || cpid < 0)
+ return (0);
+@@ -334,5 +349,11 @@ int privsep_rresvport_af (int *lport, int family)
+
+ int privsep_rresvport (int *lport)
+ {
++#if HAVE_RRESVPORT
+ return privsep_rresvport_af (lport, AF_INET);
++#else
++ errno = ENOSYS;
++ return -1;
++#endif /* HAVE_RRESVPORT */
++
+ }