From 237eddd95ebf97ff7918350e140afb5c044cdd4a Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Thu, 4 May 2017 10:30:59 -0600 Subject: [PATCH] Fix typo (fd2 vs. fd) caught by coverity, CID 168359. --- plugins/sudoers/iolog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.40.0