2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-30 22:05:46 +00:00

Cast sizeof(entry) to off_t before making it a negative offset for

lseek().  Fixes "sudo -k" on Solaris and probably others.
This commit is contained in:
Todd C. Miller
2015-09-24 10:52:44 -06:00
parent 824021b51b
commit 118680eabf

View 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;
}