]> granicus.if.org Git - sudo/commitdiff
If the "timestampowner" user cannot be resolved, use ROOT_UID instead
authorTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 26 Mar 2012 15:02:06 +0000 (11:02 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 26 Mar 2012 15:02:06 +0000 (11:02 -0400)
of exiting with a fatal error.

plugins/sudoers/sudoers.c

index 3f86ea19fcd678ef16b600e8e17817e566fdc3ba..af72c378f8ce0c6ce2ac7eb384258dcefabea4fd 100644 (file)
@@ -415,11 +415,14 @@ sudoers_policy_main(int argc, char * const argv[], int pwflag, char *env_add[],
            pw = sudo_getpwuid(atoi(def_timestampowner + 1));
        else
            pw = sudo_getpwnam(def_timestampowner);
-       if (!pw)
-           log_fatal(0, _("timestamp owner (%s): No such user"),
+       if (pw != NULL) {
+           timestamp_uid = pw->pw_uid;
+           pw_delref(pw);
+       } else {
+           log_error(0, _("timestamp owner (%s): No such user"),
                def_timestampowner);
-       timestamp_uid = pw->pw_uid;
-       pw_delref(pw);
+           timestamp_uid = ROOT_UID;
+       }
     }
 
     /* If no command line args and "shell_noargs" is not set, error out. */