[arch-commits] Commit in sudo/trunk (PKGBUILD fix-usage-of-signal-pipe.patch)

Evangelos Foutras foutrelis at archlinux.org
Wed Sep 6 19:32:24 UTC 2017


    Date: Wednesday, September 6, 2017 @ 19:32:23
  Author: foutrelis
Revision: 304760

upgpkg: sudo 1.8.21.p1-3

Fix usage of signal pipe which caused sudo to hang occasionally.

Added:
  sudo/trunk/fix-usage-of-signal-pipe.patch
Modified:
  sudo/trunk/PKGBUILD

--------------------------------+
 PKGBUILD                       |    7 ++++-
 fix-usage-of-signal-pipe.patch |   51 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 57 insertions(+), 1 deletion(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2017-09-06 19:29:08 UTC (rev 304759)
+++ PKGBUILD	2017-09-06 19:32:23 UTC (rev 304760)
@@ -6,7 +6,7 @@
 pkgname=sudo
 _sudover=1.8.21p1
 pkgver=${_sudover/p/.p}
-pkgrel=2
+pkgrel=3
 pkgdesc="Give certain users the ability to run some commands as root"
 arch=('i686' 'x86_64')
 url="https://www.sudo.ws/sudo/"
@@ -17,10 +17,12 @@
 install=$pkgname.install
 source=(https://www.sudo.ws/sudo/dist/$pkgname-$_sudover.tar.gz{,.sig}
         fix-pam-prompt.patch
+        fix-usage-of-signal-pipe.patch
         sudo.pam)
 sha256sums=('ee50d3a249a96b1c5c8d3d21380eb96c63c6e61a888b13e3c2b941b23ab7c808'
             'SKIP'
             'fc9a37c533664ecfdc7715812e9a93f39891e6fc3d72c23858bee33ac27fcebe'
+            '10af762129cf88b3036a30e6c1d19ec69b70911161d4f419fd5b86f160a1a4f1'
             'd1738818070684a5d2c9b26224906aad69a4fea77aabd960fc2675aee2df1fa2')
 validpgpkeys=('CCB24BE9E9481B15D34159535A89DFA27EE470C4')
 
@@ -29,6 +31,9 @@
 
   # https://bugzilla.sudo.ws/show_bug.cgi?id=799
   patch -Np1 -i ../fix-pam-prompt.patch
+
+  # https://bugzilla.sudo.ws/show_bug.cgi?id=800
+  patch -Np1 -i ../fix-usage-of-signal-pipe.patch
 }
 
 build() {

Added: fix-usage-of-signal-pipe.patch
===================================================================
--- fix-usage-of-signal-pipe.patch	                        (rev 0)
+++ fix-usage-of-signal-pipe.patch	2017-09-06 19:32:23 UTC (rev 304760)
@@ -0,0 +1,51 @@
+
+# HG changeset patch
+# User Todd C. Miller <Todd.Miller at courtesan.com>
+# Date 1504722576 21600
+# Node ID 7668f93e6544c762e6753590426ca882c0a373a5
+# Parent  6ee5cc13af69f4248dfa1d89215e7c95fa90d051
+The read and write sides of signal_pipe[] were swapped, resulting
+in EBADF reading from and writing to the signal pipe on Linux and
+probably others.  On systems with bidirectional pipes this was not
+an issue.
+
+diff -r 6ee5cc13af69 -r 7668f93e6544 lib/util/event.c
+--- a/lib/util/event.c	Tue Sep 05 09:30:19 2017 -0600
++++ b/lib/util/event.c	Wed Sep 06 12:29:36 2017 -0600
+@@ -153,7 +153,7 @@
+     }
+     if (nread == -1 && errno != EAGAIN) {
+ 	sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO|SUDO_DEBUG_ERRNO,
+-	    "%s: error reading from signal pipe", __func__);
++	    "%s: error reading from signal pipe fd %d", __func__, fd);
+     }
+ 
+     /* Activate signal events. */
+@@ -182,7 +182,7 @@
+ 	    "%s: unable to create signal pipe", __func__);
+ 	goto bad;
+     }
+-    sudo_ev_init(&base->signal_event, base->signal_pipe[1],
++    sudo_ev_init(&base->signal_event, base->signal_pipe[0],
+ 	SUDO_EV_READ|SUDO_EV_PERSIST, signal_pipe_cb, base);
+ 
+     debug_return_int(0);
+@@ -341,7 +341,7 @@
+ 	signal_base->signal_caught = 1;
+ 
+ 	/* Wake up the other end of the pipe. */
+-	ignore_result(write(signal_base->signal_pipe[0], &ch, 1));
++	ignore_result(write(signal_base->signal_pipe[1], &ch, 1));
+     }
+ }
+ 
+@@ -622,7 +622,7 @@
+ 	    if (errno == EINTR) {
+ 		/* Interrupted by signal, check for sigevents. */
+ 		if (base->signal_caught) {
+-		    signal_pipe_cb(base->signal_pipe[1], SUDO_EV_READ, base);
++		    signal_pipe_cb(base->signal_pipe[0], SUDO_EV_READ, base);
+ 		    break;
+ 		}
+ 		continue;
+



More information about the arch-commits mailing list