From b4f9b6eef2bb30059cf1040383c88c94f4d093a5 Mon Sep 17 00:00:00 2001 From: Dmitry Chagin Date: Mon, 31 May 2021 22:37:06 +0300 Subject: [PATCH] linux(4): Handle AT_EMPTY_PATH in the utimensat syscall. Differential Revision: https://reviews.freebsd.org/D30518 MFC after: 2 weeks --- sys/compat/linux/linux_misc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 2be328a0d6d2..9676cad893c1 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -813,7 +813,7 @@ linux_utimensat(struct thread *td, struct linux_utimensat_args *args) dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd; - if (args->flags & ~LINUX_AT_SYMLINK_NOFOLLOW) + if (args->flags & ~(LINUX_AT_SYMLINK_NOFOLLOW | LINUX_AT_EMPTY_PATH)) return (EINVAL); if (args->times != NULL) { @@ -863,6 +863,8 @@ linux_utimensat(struct thread *td, struct linux_utimensat_args *args) if (args->flags & LINUX_AT_SYMLINK_NOFOLLOW) flags |= AT_SYMLINK_NOFOLLOW; + if (args->flags & LINUX_AT_EMPTY_PATH) + flags |= AT_EMPTY_PATH; if (!LUSECONVPATH(td)) { if (args->pathname != NULL) {