linux: make fstatat(2) handle AT_EMPTY_PATH
Without it, Qt5 apps from Focal fail to start, being unable to load their plugins. It's also necessary for glibc 2.33, as found in recent Arch snapshots. PR: 254112 Reviewed By: kib Sponsored by: The FreeBSD Foundation, EPSRC Differential Revision: https://reviews.freebsd.org/D28192
This commit is contained in:
parent
9bacbf1ae2
commit
4b45c2bb83
@ -632,10 +632,14 @@ linux_fstatat64(struct thread *td, struct linux_fstatat64_args *args)
|
|||||||
int error, dfd, flag;
|
int error, dfd, flag;
|
||||||
struct stat buf;
|
struct stat buf;
|
||||||
|
|
||||||
if (args->flag & ~LINUX_AT_SYMLINK_NOFOLLOW)
|
if (args->flag & ~(LINUX_AT_SYMLINK_NOFOLLOW | LINUX_AT_EMPTY_PATH)) {
|
||||||
|
linux_msg(td, "fstatat64 unsupported flag 0x%x", args->flag);
|
||||||
return (EINVAL);
|
return (EINVAL);
|
||||||
|
}
|
||||||
flag = (args->flag & LINUX_AT_SYMLINK_NOFOLLOW) ?
|
flag = (args->flag & LINUX_AT_SYMLINK_NOFOLLOW) ?
|
||||||
AT_SYMLINK_NOFOLLOW : 0;
|
AT_SYMLINK_NOFOLLOW : 0;
|
||||||
|
flag |= (args->flag & LINUX_AT_EMPTY_PATH) ?
|
||||||
|
AT_EMPTY_PATH : 0;
|
||||||
|
|
||||||
dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd;
|
dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd;
|
||||||
if (!LUSECONVPATH(td)) {
|
if (!LUSECONVPATH(td)) {
|
||||||
@ -661,10 +665,15 @@ linux_newfstatat(struct thread *td, struct linux_newfstatat_args *args)
|
|||||||
int error, dfd, flag;
|
int error, dfd, flag;
|
||||||
struct stat buf;
|
struct stat buf;
|
||||||
|
|
||||||
if (args->flag & ~LINUX_AT_SYMLINK_NOFOLLOW)
|
if (args->flag & ~(LINUX_AT_SYMLINK_NOFOLLOW | LINUX_AT_EMPTY_PATH)) {
|
||||||
|
linux_msg(td, "fstatat unsupported flag 0x%x", args->flag);
|
||||||
return (EINVAL);
|
return (EINVAL);
|
||||||
|
}
|
||||||
|
|
||||||
flag = (args->flag & LINUX_AT_SYMLINK_NOFOLLOW) ?
|
flag = (args->flag & LINUX_AT_SYMLINK_NOFOLLOW) ?
|
||||||
AT_SYMLINK_NOFOLLOW : 0;
|
AT_SYMLINK_NOFOLLOW : 0;
|
||||||
|
flag |= (args->flag & LINUX_AT_EMPTY_PATH) ?
|
||||||
|
AT_EMPTY_PATH : 0;
|
||||||
|
|
||||||
dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd;
|
dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd;
|
||||||
if (!LUSECONVPATH(td)) {
|
if (!LUSECONVPATH(td)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user