commit: 69000bb059a57560762b979e7957f96decb25f10 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org> AuthorDate: Mon Nov 4 19:02:51 2024 +0000 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org> CommitDate: Mon Nov 4 19:02:51 2024 +0000 URL: https://gitweb.gentoo.org/proj/sandbox.git/commit/?id=69000bb0
Fix behavior of utimensat(..., AT_EMPTY_PATH) Bug: https://bugs.gentoo.org/935716 Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org> libsandbox/libsandbox.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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
