]> granicus.if.org Git - sudo/commitdiff
If the "timestampowner" user cannot be resolved, use uid 0 instead
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 30 Mar 2012 16:51:32 +0000 (12:51 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 30 Mar 2012 16:51:32 +0000 (12:51 -0400)
of exiting with a fatal error.

--HG--
branch : 1.7

sudo.c

diff --git a/sudo.c b/sudo.c
index 626c599f13bd2704a27e43deed1bbb4370cade1e..5e36915042a70db24384e5b8688f4f29bebeadfe 100644 (file)
--- 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. */