From: Todd C. Miller Date: Fri, 13 Jan 2017 22:45:59 +0000 (-0700) Subject: Only treat failure of expand_iolog_path() as fatal if ignore_iolog_errors X-Git-Tag: SUDO_1_8_19p2^2~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=269b8602d8950a01f93f825ed0e7168a08ec1047;p=sudo Only treat failure of expand_iolog_path() as fatal if ignore_iolog_errors is not set. --- diff --git a/plugins/sudoers/sudoers.c b/plugins/sudoers/sudoers.c index 80c4b4595..539177a17 100644 --- a/plugins/sudoers/sudoers.c +++ b/plugins/sudoers/sudoers.c @@ -493,9 +493,15 @@ sudoers_policy_main(int argc, char * const argv[], int pwflag, char *env_add[], const char prefix[] = "iolog_path="; iolog_path = expand_iolog_path(prefix, def_iolog_dir, def_iolog_file, &sudo_user.iolog_file); - if (iolog_path == NULL) - goto done; - sudo_user.iolog_file++; + if (iolog_path == NULL) { + if (!def_ignore_iolog_errors) + goto done; + /* Unable to expand I/O log path, disable I/O logging. */ + def_log_input = false; + def_log_output = false; + } else { + sudo_user.iolog_file++; + } } }