mirror of
https://github.com/fluencelabs/musl
synced 2025-05-29 23:51:34 +00:00
in faccessat slow path, add close-on-exec to pipe fds
as usual, this is needed to avoid fd leaks. as a better solution, the use of fds could possibly be replaced with mmap and a futex.
This commit is contained in:
parent
516358561e
commit
d5bd7dd5d2
@ -34,7 +34,7 @@ int faccessat(int fd, const char *filename, int amode, int flag)
|
|||||||
sigset_t set;
|
sigset_t set;
|
||||||
int ret, p[2];
|
int ret, p[2];
|
||||||
|
|
||||||
if (pipe(p)) return __syscall_ret(-EBUSY);
|
if (pipe2(p, O_CLOEXEC)) return __syscall_ret(-EBUSY);
|
||||||
struct ctx c = { .fd = fd, .filename = filename, .amode = amode, .p = p[1] };
|
struct ctx c = { .fd = fd, .filename = filename, .amode = amode, .p = p[1] };
|
||||||
|
|
||||||
__block_all_sigs(&set);
|
__block_all_sigs(&set);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user