From: Todd C. Miller Date: Mon, 27 Dec 2010 16:24:47 +0000 (-0500) Subject: Add missing sigsetjmp() call in I/O plugin open function. X-Git-Tag: SUDO_1_8_0~125 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=524021a37757e8c17a4e12e1e5d7eda5d7d61f2b;p=sudo Add missing sigsetjmp() call in I/O plugin open function. Fixes a crash when the I/O plugin calls error(), errorx() or log_error(). --- diff --git a/plugins/sudoers/iolog.c b/plugins/sudoers/iolog.c index 98a642b05..554fef9fa 100644 --- a/plugins/sudoers/iolog.c +++ b/plugins/sudoers/iolog.c @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #ifdef HAVE_ZLIB_H @@ -52,6 +53,9 @@ #include "sudoers.h" +/* plugin_error.c */ +extern sigjmp_buf error_jmp; + union io_fd { FILE *f; #ifdef HAVE_ZLIB_H @@ -260,6 +264,11 @@ sudoers_io_open(unsigned int version, sudo_conv_t conversation, if (argc == 0) return TRUE; + if (sigsetjmp(error_jmp, 1)) { + /* called via error(), errorx() or log_error() */ + return -1; + } + /* * Pull iolog settings out of command_info, if any. */