]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
lib/file: Close on exec bit tested incorrectly
authorOliver Kurth <okurth@vmware.com>
Mon, 30 Sep 2019 23:24:27 +0000 (16:24 -0700)
committerOliver Kurth <okurth@vmware.com>
Mon, 30 Sep 2019 23:24:27 +0000 (16:24 -0700)
The test should be on access, not flags.

open-vm-tools/lib/file/fileIOPosix.c

index 23108279247bc04b075078b766988dc356ab7195..b79560e62ba63f3e92b7327c209679968c6f9421 100644 (file)
@@ -948,7 +948,7 @@ FileIOCreateRetry(FileIODescriptor *file,   // OUT:
 #endif
 
 #if defined(__linux__) && defined(O_CLOEXEC)
-   if (flags & FILEIO_OPEN_CLOSE_ON_EXEC) {
+   if (access & FILEIO_OPEN_CLOSE_ON_EXEC) {
       flags |= O_CLOEXEC;
    }
 #endif