Improved OPEN_NOFOLLOW.

This commit is contained in:
Nuno Cruces
2024-09-27 12:32:11 +01:00
parent 4e0b8aeaa8
commit 08f7764fe0
6 changed files with 26 additions and 26 deletions

View File

@@ -15,7 +15,7 @@ func OpenFile(name string, flag int, perm fs.FileMode) (*os.File, error) {
if name == "" {
return nil, &os.PathError{Op: "open", Path: name, Err: ENOENT}
}
r, e := syscallOpen(name, flag, uint32(perm.Perm()))
r, e := syscallOpen(name, flag|O_CLOEXEC, uint32(perm.Perm()))
if e != nil {
return nil, &os.PathError{Op: "open", Path: name, Err: e}
}