diff options
author | Mike Gilbert <floppym@gentoo.org> | 2024-11-04 14:02:51 -0500 |
---|---|---|
committer | Mike Gilbert <floppym@gentoo.org> | 2024-11-04 14:02:51 -0500 |
commit | 69000bb059a57560762b979e7957f96decb25f10 (patch) | |
tree | a5bbd090058a376991c52715dc7254a870ab3313 | |
parent | libsandbox: fix violations where ENOENT is expected (diff) | |
download | sandbox-69000bb059a57560762b979e7957f96decb25f10.tar.gz sandbox-69000bb059a57560762b979e7957f96decb25f10.tar.bz2 sandbox-69000bb059a57560762b979e7957f96decb25f10.zip |
Fix behavior of utimensat(..., AT_EMPTY_PATH)
Bug: https://bugs.gentoo.org/935716
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
-rw-r--r-- | libsandbox/libsandbox.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libsandbox/libsandbox.c b/libsandbox/libsandbox.c index acd8585..3d6f1a9 100644 --- a/libsandbox/libsandbox.c +++ b/libsandbox/libsandbox.c @@ -1064,7 +1064,7 @@ bool before_syscall(int dirfd, int sb_nr, const char *func, const char *file, in * the rest should get rejected as "file/directory does not exist". */ if (file == NULL || file[0] == '\0') { - if (file == NULL && dirfd != AT_FDCWD && + if ((file == NULL || (flags & AT_EMPTY_PATH)) && (sb_nr == SB_NR_UTIMENSAT || sb_nr == SB_NR_FUTIMESAT)) { /* let it slide -- the func is magic and changes behavior |