aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Chagin <dchagin@FreeBSD.org>2021-05-31 19:30:37 +0000
committerDmitry Chagin <dchagin@FreeBSD.org>2022-06-17 19:22:16 +0000
commit0f5f0e5e56aeee139be5654af646f330d7ecdfb0 (patch)
treeb369e270b4b3712c0b053ba3bcb7db836400ec10
parentf62db988942a337c6bbe04f52a1afb5a7be0fb8d (diff)
downloadsrc-0f5f0e5e56aeee139be5654af646f330d7ecdfb0.tar.gz
src-0f5f0e5e56aeee139be5654af646f330d7ecdfb0.zip
linux(4): Convert flags before use in utimensat.
Differential Revision: https://reviews.freebsd.org/D30487 MFC after: 2 weeks (cherry picked from commit 8505eb5dd8f743f29e9c93b6814a34f1890e6c41)
-rw-r--r--sys/compat/linux/linux_misc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c
index 98be575b7b6c..cb129179a44d 100644
--- a/sys/compat/linux/linux_misc.c
+++ b/sys/compat/linux/linux_misc.c
@@ -861,6 +861,9 @@ linux_utimensat(struct thread *td, struct linux_utimensat_args *args)
return (0);
}
+ if (args->flags & LINUX_AT_SYMLINK_NOFOLLOW)
+ flags |= AT_SYMLINK_NOFOLLOW;
+
if (!LUSECONVPATH(td)) {
if (args->pathname != NULL) {
return (kern_utimensat(td, dfd, args->pathname,
@@ -873,9 +876,6 @@ linux_utimensat(struct thread *td, struct linux_utimensat_args *args)
else if (args->flags != 0)
return (EINVAL);
- if (args->flags & LINUX_AT_SYMLINK_NOFOLLOW)
- flags |= AT_SYMLINK_NOFOLLOW;
-
if (path == NULL)
error = kern_futimens(td, dfd, timesp, UIO_SYSSPACE);
else {