From 6c7fb5f32ad0fb2558d50cdaa39ff7fb0e95c58b Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Sat, 31 Oct 2020 06:26:46 -0600 Subject: [PATCH] Revert "use new SYS_faccessat2 syscall to implement faccessat with flags" This reverts commit 55fb9a177316aa46c639d93dd0323d9a9a8c160c. Causes too many problems on Alpine right now due to seccomp. --- src/unistd/faccessat.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/unistd/faccessat.c b/src/unistd/faccessat.c index 557503eb..76bbd4c7 100644 --- a/src/unistd/faccessat.c +++ b/src/unistd/faccessat.c @@ -25,17 +25,12 @@ static int checker(void *p) int faccessat(int fd, const char *filename, int amode, int flag) { - if (flag) { - int ret = __syscall(SYS_faccessat2, fd, filename, amode, flag); - if (ret != -ENOSYS) return __syscall_ret(ret); - } + if (!flag || (flag==AT_EACCESS && getuid()==geteuid() && getgid()==getegid())) + return syscall(SYS_faccessat, fd, filename, amode, flag); - if (flag & ~AT_EACCESS) + if (flag != AT_EACCESS) return __syscall_ret(-EINVAL); - if (!flag || (getuid()==geteuid() && getgid()==getegid())) - return syscall(SYS_faccessat, fd, filename, amode); - char stack[1024]; sigset_t set; pid_t pid; -- 2.29.2