From 793eee150dd81e6d8b47211acbc263c83aa57cac Mon Sep 17 00:00:00 2001 From: Juan RP Date: Wed, 15 Jan 2014 09:03:47 +0100 Subject: [PATCH] sudo: fix #254 (upstream patch). --- ...move-backchannel-event-if-we-get-eof.patch | 33 +++++++++++++++++++ srcpkgs/sudo/template | 2 +- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/sudo/patches/sudo-1.8.9p3-remove-backchannel-event-if-we-get-eof.patch diff --git a/srcpkgs/sudo/patches/sudo-1.8.9p3-remove-backchannel-event-if-we-get-eof.patch b/srcpkgs/sudo/patches/sudo-1.8.9p3-remove-backchannel-event-if-we-get-eof.patch new file mode 100644 index 00000000000..0a3c2a94d0c --- /dev/null +++ b/srcpkgs/sudo/patches/sudo-1.8.9p3-remove-backchannel-event-if-we-get-eof.patch @@ -0,0 +1,33 @@ +# HG changeset patch +# User Todd C. Miller +# Date 1389722096 25200 +# Node ID a204b69d91f786444899ce3fc95ed535b6e32d33 +# Parent 987087ce465828da121b9d67412f42feaea06d56 +If not logging I/O we may get EOF when the command is executed and +the other end of the backchannel is closed. Just remove the +backchannel event in this case or we will continue to receive +the event. Bug #631 + +--- src/exec.c Tue Jan 14 09:26:14 2014 -0700 ++++ src/exec.c Tue Jan 14 10:54:56 2014 -0700 +@@ -230,11 +230,14 @@ + /* Short read or EOF. */ + sudo_debug_printf(SUDO_DEBUG_ERROR, + "failed to read child status: %s", n ? "short read" : "EOF"); +- /* +- * If not logging I/O we may get EOF when the command is +- * executed and sv is closed. It is safe to ignore this. +- */ +- if (ec->log_io || n != 0) { ++ if (!ec->log_io && n == 0) { ++ /* ++ * If not logging I/O we may get EOF when the command is ++ * executed and the other end of the backchannel is closed. ++ * Just remove the event in this case. ++ */ ++ (void)sudo_ev_del(ec->evbase, backchannel_event); ++ } else { + /* XXX - need new CMD_ type for monitor errors. */ + errno = n ? EIO : ECONNRESET; + ec->cstat->type = CMD_ERRNO; + diff --git a/srcpkgs/sudo/template b/srcpkgs/sudo/template index d871a04b218..242439c7ae0 100644 --- a/srcpkgs/sudo/template +++ b/srcpkgs/sudo/template @@ -1,7 +1,7 @@ # Template build file for 'sudo'. pkgname=sudo version=1.8.9p3 -revision=1 +revision=2 build_style=gnu-configure configure_args="--with-ignore-dot -with-all-insults --with-env-editor --enable-shell-sets-home --enable-noargs-shell --without-sendmail