]> granicus.if.org Git - sudo/commitdiff
Cast sizeof(entry) to off_t before making it a negative offset for
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 24 Sep 2015 16:52:44 +0000 (10:52 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 24 Sep 2015 16:52:44 +0000 (10:52 -0600)
lseek().  Fixes "sudo -k" on Solaris and probably others.

plugins/sudoers/timestamp.c

index c4cbb77dc93f5dae06790694bda2c880e7b41e29..77f5f236ced21c79cb6c450c6542701234961717 100644 (file)
@@ -873,7 +873,7 @@ timestamp_remove(bool unlink_it)
        /* Back up and disable the entry. */
        if (!ISSET(entry.flags, TS_DISABLED)) {
            SET(entry.flags, TS_DISABLED);
-           lseek(fd, 0 - sizeof(entry), SEEK_CUR);
+           lseek(fd, 0 - (off_t)sizeof(entry), SEEK_CUR);
            if (ts_write(fd, fname, &entry, -1) == -1)
                rval = false;
        }