]> granicus.if.org Git - sudo/commitdiff
Ignore ts_write() return value when disabling an entry with a bogus
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 5 May 2016 22:30:11 +0000 (16:30 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 5 May 2016 22:30:11 +0000 (16:30 -0600)
timestamp.  We ignore the timestamp entry even it doesn't succeed.
Coverity CID 104062.

plugins/sudoers/timestamp.c

index 431c97e90c701a698386d9e8fde2c98f48e44828..a2669fc4b4f811ecffa1be8923e23d28a3fee42e 100644 (file)
@@ -756,7 +756,7 @@ timestamp_status(void *vcookie, struct passwd *pw)
                N_("ignoring time stamp from the future"));
            status = TS_OLD;
            SET(entry.flags, TS_DISABLED);
-           ts_write(cookie->fd, cookie->fname, &entry, cookie->pos);
+           (void)ts_write(cookie->fd, cookie->fname, &entry, cookie->pos);
        }
 #else
        /* Check for bogus (future) time in the stampfile. */
@@ -769,7 +769,7 @@ timestamp_status(void *vcookie, struct passwd *pw)
                4 + ctime(&tv_sec));
            status = TS_OLD;
            SET(entry.flags, TS_DISABLED);
-           ts_write(cookie->fd, cookie->fname, &entry, cookie->pos);
+           (void)ts_write(cookie->fd, cookie->fname, &entry, cookie->pos);
        }
 #endif /* CLOCK_MONOTONIC */
     } else {