]> granicus.if.org Git - sudo/commitdiff
Fix typo (fd2 vs. fd) caught by coverity, CID 168359.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 4 May 2017 16:30:59 +0000 (10:30 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 4 May 2017 16:30:59 +0000 (10:30 -0600)
plugins/sudoers/iolog.c

index 604bc4b90605a9374e3a6f6e9a4c3ad6b31e75e0..cf4f685733a0a3ad67cfaa87a8f92a4de2cfdd15 100644 (file)
@@ -400,7 +400,7 @@ io_nextid(char *iolog_dir, char *iolog_dir_fallback, char sessid[7])
        if (len > 0 && (size_t)len < sizeof(fallback)) {
            int fd2;
            fd2 = open(fallback, O_RDWR|O_CREAT, iolog_filemode);
-           if (fd == -1 && errno == EACCES) {
+           if (fd2 == -1 && errno == EACCES) {
                /* Try again as the I/O log owner (for NFS). */
                set_perms(PERM_IOLOG);
                fd2 = open(fallback, O_RDWR|O_CREAT, iolog_filemode);