From: Todd C. Miller Date: Thu, 4 May 2017 16:30:59 +0000 (-0600) Subject: Fix typo (fd2 vs. fd) caught by coverity, CID 168359. X-Git-Tag: SUDO_1_8_20^2~13 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=237eddd95ebf97ff7918350e140afb5c044cdd4a;p=sudo Fix typo (fd2 vs. fd) caught by coverity, CID 168359. --- diff --git a/plugins/sudoers/iolog.c b/plugins/sudoers/iolog.c index 604bc4b90..cf4f68573 100644 --- a/plugins/sudoers/iolog.c +++ b/plugins/sudoers/iolog.c @@ -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);