From: Todd C. Miller Date: Fri, 30 Mar 2012 16:51:32 +0000 (-0400) Subject: If the "timestampowner" user cannot be resolved, use uid 0 instead X-Git-Tag: SUDO_1_7_9p1~21 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ff5d413b6fffe4ab2c501e0f7c109e3a10341ae2;p=sudo If the "timestampowner" user cannot be resolved, use uid 0 instead of exiting with a fatal error. --HG-- branch : 1.7 --- diff --git a/sudo.c b/sudo.c index 626c599f1..5e3691504 100644 --- a/sudo.c +++ b/sudo.c @@ -396,11 +396,14 @@ main(argc, argv, envp) pw = sudo_getpwuid(atoi(def_timestampowner + 1)); else pw = sudo_getpwnam(def_timestampowner); - if (!pw) - log_error(0, "timestamp owner (%s): No such user", + if (pw != NULL) { + timestamp_uid = pw->pw_uid; + pw_delref(pw); + } else { + log_error(NO_EXIT, "timestamp owner (%s): No such user", def_timestampowner); - timestamp_uid = pw->pw_uid; - pw_delref(pw); + timestamp_uid = 0; + } } /* If no command line args and "set_home" is not set, error out. */