git: e47823b8312b - main - linux: support AT_EMPTY_PATH flag in fchownat(2)
Edward Tomasz Napierala
trasz at FreeBSD.org
Fri Apr 16 15:28:36 UTC 2021
The branch main has been updated by trasz:
URL: https://cgit.FreeBSD.org/src/commit/?id=e47823b8312b7cb61c5c8cb8e1eb981994e3a0b4
commit e47823b8312b7cb61c5c8cb8e1eb981994e3a0b4
Author: Edward Tomasz Napierala <trasz at FreeBSD.org>
AuthorDate: 2021-04-16 15:26:43 +0000
Commit: Edward Tomasz Napierala <trasz at FreeBSD.org>
CommitDate: 2021-04-16 15:27:20 +0000
linux: support AT_EMPTY_PATH flag in fchownat(2)
This fixes rsyslog package installation scripts in Bionic.
Reviewed By: kib
Sponsored By: EPSRC
Differential Revision: https://reviews.freebsd.org/D29108
---
sys/compat/linux/linux_file.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c
index 438b100d4e21..6b02c2efb88e 100644
--- a/sys/compat/linux/linux_file.c
+++ b/sys/compat/linux/linux_file.c
@@ -1740,12 +1740,17 @@ linux_fchownat(struct thread *td, struct linux_fchownat_args *args)
char *path;
int error, dfd, flag;
- if (args->flag & ~LINUX_AT_SYMLINK_NOFOLLOW)
+ if (args->flag & ~(LINUX_AT_SYMLINK_NOFOLLOW | LINUX_AT_EMPTY_PATH)) {
+ linux_msg(td, "fchownat unsupported flag 0x%x", args->flag);
return (EINVAL);
+ }
- dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd;
flag = (args->flag & LINUX_AT_SYMLINK_NOFOLLOW) == 0 ? 0 :
AT_SYMLINK_NOFOLLOW;
+ flag |= (args->flag & LINUX_AT_EMPTY_PATH) == 0 ? 0 :
+ AT_EMPTY_PATH;
+
+ dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd;
if (!LUSECONVPATH(td)) {
return (kern_fchownat(td, dfd, args->filename, UIO_USERSPACE,
args->uid, args->gid, flag));
More information about the dev-commits-src-main
mailing list