mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-28 21:07:55 +00:00
Fix logic goof when checking open() status.
This commit is contained in:
parent
13fd13e17c
commit
6b57ef4f6d
@ -487,7 +487,7 @@ write_info_log(char *pathbuf, size_t len, struct iolog_details *details,
|
||||
pathbuf[len] = '\0';
|
||||
strlcat(pathbuf, "/log", PATH_MAX);
|
||||
fd = open(pathbuf, O_CREAT|O_WRONLY, S_IRUSR|S_IWUSR);
|
||||
if (fd != -1 || (fp = fdopen(fd, "w")) == NULL)
|
||||
if (fd == -1 || (fp = fdopen(fd, "w")) == NULL)
|
||||
log_fatal(USE_ERRNO, N_("unable to create %s"), pathbuf);
|
||||
|
||||
fprintf(fp, "%lld:%s:%s:%s:%s:%d:%d\n%s\n%s", (long long)now->tv_sec,
|
||||
|
Loading…
x
Reference in New Issue
Block a user