diff options
author | Rich Felker <dalias@aerifal.cx> | 2023-02-28 12:21:23 -0500 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2023-02-28 12:21:23 -0500 |
commit | c99b7daafdbf1e2415bf408e67ca7813e7ddeedf (patch) | |
tree | 054b6fe6e7e42c2b087e40574bcf080b956eac0f /src/unistd/unlink.c | |
parent | fb7fb5e4bd7ccb8efa691364404efc7804fad90c (diff) | |
download | musl-c99b7daafdbf1e2415bf408e67ca7813e7ddeedf.tar.gz musl-c99b7daafdbf1e2415bf408e67ca7813e7ddeedf.tar.xz musl-c99b7daafdbf1e2415bf408e67ca7813e7ddeedf.zip |
fix dup3 ignoring all flags but O_CLOEXEC on archs with SYS_dup2 syscall
our dup3 code wrongly skipped directly to making the SYS_dup2 syscall whenever the O_CLOEXEC bit of flags was not set. this is incorrect if any new flags are ever added, as it would silently ignore them rather than failing with an error. archs which lack SYS_dup2 were unaffected. adjust the logic so that SYS_dup3 is attempted whenever flags is nonzero, and explicitly fail with EINVAL if SYS_dup3 is unavailable and there are any unknown flags.
Diffstat (limited to 'src/unistd/unlink.c')
0 files changed, 0 insertions, 0 deletions