]> granicus.if.org Git - sudo/commitdiff
Fix typo in last commit (ifndef vs ifdef)
authorTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 24 Apr 2010 23:22:52 +0000 (19:22 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 24 Apr 2010 23:22:52 +0000 (19:22 -0400)
Make sure we pass ctime() a pointer to time_t as tv_sec in struct
timeval may be long.

plugins/sudoers/check.c

index 172b011c756f63c2bd337d3b66c56e135953d2f4..90902de97499431a3b871c8c67d667e161c26ec2 100644 (file)
@@ -104,7 +104,7 @@ check_user(int validated, int mode)
        tty_info.dev = sb.st_dev;
        tty_info.ino = sb.st_ino;
        tty_info.rdev = sb.st_rdev;
-#ifndef notyet
+#ifdef notyet
        ctim_get(&sb, &tty_info.ctime);
        if (stat("/", &sb) == 0) {
            /*
@@ -608,9 +608,10 @@ timestamp_status(char *timestampdir, char *timestampfile, char *user, int flags)
                 * have been set back or someone could be trying to spoof us.
                 */
                if (mtime.tv_sec > now + 60 * def_timestamp_timeout * 2) {
+                   time_t tv_sec = (time_t)mtime.tv_sec;
                    log_error(NO_EXIT,
                        "timestamp too far in the future: %20.20s",
-                       4 + ctime(&mtime.tv_sec));
+                       4 + ctime(&tv_sec));
                    if (timestampfile)
                        (void) unlink(timestampfile);
                    else