]> granicus.if.org Git - sudo/commitdiff
Only treat failure of expand_iolog_path() as fatal if ignore_iolog_errors
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 13 Jan 2017 22:45:59 +0000 (15:45 -0700)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 13 Jan 2017 22:45:59 +0000 (15:45 -0700)
is not set.

plugins/sudoers/sudoers.c

index 80c4b4595916428cf477e05726cda42095b7cde8..539177a17c6585e4135a5d25b0e1528bdad5e9a7 100644 (file)
@@ -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++;
+           }
        }
     }