]> granicus.if.org Git - sudo/commitdiff
Fix swapped args of lseek() when rewinding. This didn't cause a
authorTodd C. Miller <Todd.Miller@sudo.ws>
Fri, 11 May 2018 13:45:22 +0000 (07:45 -0600)
committerTodd C. Miller <Todd.Miller@sudo.ws>
Fri, 11 May 2018 13:45:22 +0000 (07:45 -0600)
problem because the value of SEEK_SET is 0.

plugins/sudoers/match.c

index 54e7280f4c97393c40e0b27e381aa059263dafbe..5b853f725ed6acf31252004f8909eddfc56d8d70 100644 (file)
@@ -782,7 +782,7 @@ digest_matches(int fd, const char *file, const struct sudo_digest *sd)
     debug_decl(digest_matches, SUDOERS_DEBUG_MATCH)
 
     file_digest = sudo_filedigest(fd, file, sd->digest_type, &digest_len);
-    lseek(fd, SEEK_SET, (off_t)0);
+    (void) lseek(fd, (off_t)0, SEEK_SET);
     if (file_digest == NULL) {
        /* Warning (if any) printed by sudo_filedigest() */
        goto done;