From 69000bb059a57560762b979e7957f96decb25f10 Mon Sep 17 00:00:00 2001 From: Mike Gilbert Date: Mon, 4 Nov 2024 14:02:51 -0500 Subject: Fix behavior of utimensat(..., AT_EMPTY_PATH) Bug: https://bugs.gentoo.org/935716 Signed-off-by: Mike Gilbert --- 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 -- cgit v1.2.3-65-gdbad