aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Tomasz Napierala <trasz@FreeBSD.org>2021-05-04 12:09:31 +0000
committerEdward Tomasz Napierala <trasz@FreeBSD.org>2021-05-04 12:09:46 +0000
commitee384b229dc62b2b0c9180db8c71fa99f30144cf (patch)
treef73f04fc7d4e8eb23a3189aaeddbdc927a9d19d6
parent3657010266b235f6394aefbe755dc316bb2535b4 (diff)
downloadsrc-ee384b229dc62b2b0c9180db8c71fa99f30144cf.tar.gz
src-ee384b229dc62b2b0c9180db8c71fa99f30144cf.zip
linux(4): make linkat(2) handle AT_EMPTY_PATH
Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D29974
-rw-r--r--sys/compat/linux/linux_file.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c
index 1febb11b0131..0549d536ba51 100644
--- a/sys/compat/linux/linux_file.c
+++ b/sys/compat/linux/linux_file.c
@@ -1134,11 +1134,12 @@ linux_linkat(struct thread *td, struct linux_linkat_args *args)
char *path, *to;
int error, olddfd, newdfd, flag;
- if (args->flag & ~LINUX_AT_SYMLINK_FOLLOW)
+ if (args->flag & ~(LINUX_AT_SYMLINK_FOLLOW | LINUX_AT_EMPTY_PATH))
return (EINVAL);
flag = (args->flag & LINUX_AT_SYMLINK_FOLLOW) == 0 ? AT_SYMLINK_FOLLOW :
0;
+ flag |= (args->flag & LINUX_AT_EMPTY_PATH) == 0 ? AT_EMPTY_PATH : 0;
olddfd = (args->olddfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->olddfd;
newdfd = (args->newdfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->newdfd;