docker-golang-alpine/1.19-nofaccessat2/disable_faccessat2.patch

24 lines
765 B
Diff

--- v1.2.3/src/unistd/faccessat.c 2022-04-07 20:12:40.000000000 +0300
+++ v1.2.1/src/unistd/faccessat.c 2020-08-04 07:21:09.000000000 +0300
@@ -25,17 +25,12 @@
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;