projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
14a0117
)
fix fd leak race (missing O_CLOEXEC) in fchmodat
author
Rich Felker
<dalias@aerifal.cx>
Thu, 5 Feb 2015 03:50:40 +0000
(22:50 -0500)
committer
Rich Felker
<dalias@aerifal.cx>
Thu, 5 Feb 2015 03:50:40 +0000
(22:50 -0500)
src/stat/fchmodat.c
patch
|
blob
|
history
diff --git
a/src/stat/fchmodat.c
b/src/stat/fchmodat.c
index afa6d44b5401da8caec81c3cb78dea9b344b4748..a894cb696bbad9852260a805a0a6a79d298cd18f 100644
(file)
--- a/
src/stat/fchmodat.c
+++ b/
src/stat/fchmodat.c
@@
-21,7
+21,7
@@
int fchmodat(int fd, const char *path, mode_t mode, int flag)
if (S_ISLNK(st.st_mode))
return __syscall_ret(-EOPNOTSUPP);
- if ((fd2 = __syscall(SYS_openat, fd, path, O_RDONLY|O_PATH|O_NOFOLLOW|O_NOCTTY)) < 0) {
+ if ((fd2 = __syscall(SYS_openat, fd, path, O_RDONLY|O_PATH|O_NOFOLLOW|O_NOCTTY
|O_CLOEXEC
)) < 0) {
if (fd2 == -ELOOP)
return __syscall_ret(-EOPNOTSUPP);
return __syscall_ret(fd2);