this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix some syscalls not following symlinks when they should

See https://github.com/ClickHouse/ClickHouse/issues/15609

+10 -13
+1 -2
src/kernel/emulation/linux/bsdthread/pthread_chdir.c
··· 6 6 #include "../../../../external/lkm/api.h" 7 7 #include "../fcntl/open.h" 8 8 #include "../unistd/close.h" 9 - #include "../vchroot_expand.h" 10 9 #include "per_thread_wd.h" 11 10 12 11 long sys_pthread_chdir(const char* path) 13 12 { 14 13 int rv, newfd; 15 - 14 + 16 15 newfd = sys_open(path, BSD_O_RDONLY | BSD_O_DIRECTORY | BSD_O_CLOEXEC, 0); 17 16 if (newfd < 0) 18 17 return newfd;
+4 -6
src/kernel/emulation/linux/stat/fstatat.c
··· 11 11 12 12 extern char* strcpy(char* dst, const char* src); 13 13 14 - #define AT_SYMLINK_NOFOLLOW 0x20 15 - 16 14 long sys_fstatat(int fd, const char* path, struct stat* stat, int flag) 17 15 { 18 16 int ret; ··· 23 21 return -EFAULT; 24 22 25 23 struct vchroot_expand_args vc; 26 - vc.flags = (flag & AT_SYMLINK_NOFOLLOW) ? 0 : VCHROOT_FOLLOW; 24 + vc.flags = (flag & BSD_AT_SYMLINK_NOFOLLOW) ? 0 : VCHROOT_FOLLOW; 27 25 vc.dfd = atfd(fd); 28 - 26 + 29 27 strcpy(vc.path, path); 30 28 ret = vchroot_expand(&vc); 31 29 if (ret < 0) ··· 57 55 return -EFAULT; 58 56 59 57 struct vchroot_expand_args vc; 60 - vc.flags = (flag & AT_SYMLINK_NOFOLLOW) ? 0 : VCHROOT_FOLLOW; 58 + vc.flags = (flag & BSD_AT_SYMLINK_NOFOLLOW) ? 0 : VCHROOT_FOLLOW; 61 59 vc.dfd = atfd(fd); 62 - 60 + 63 61 strcpy(vc.path, path); 64 62 ret = vchroot_expand(&vc); 65 63 if (ret < 0)
+1 -1
src/kernel/emulation/linux/unistd/faccessat.c
··· 15 15 16 16 struct vchroot_expand_args vc; 17 17 18 - vc.flags = 0; 18 + vc.flags = (flag & BSD_AT_SYMLINK_NOFOLLOW) ? 0 : VCHROOT_FOLLOW; 19 19 vc.dfd = atfd(fd); 20 20 21 21 strcpy(vc.path, filename);
+2 -2
src/kernel/emulation/linux/unistd/fchmodat.c
··· 60 60 int ret; 61 61 struct vchroot_expand_args vc; 62 62 63 - vc.flags = 0; 63 + vc.flags = (flag & BSD_AT_SYMLINK_NOFOLLOW) ? 0 : VCHROOT_FOLLOW;; 64 64 vc.dfd = atfd(fd); 65 - 65 + 66 66 strcpy(vc.path, path); 67 67 68 68 ret = vchroot_expand(&vc);
+2 -2
src/kernel/emulation/linux/unistd/linkat.c
··· 15 15 int ret; 16 16 struct vchroot_expand_args vc, vc2; 17 17 18 - vc.flags = 0; 18 + vc.flags = (flag & BSD_AT_SYMLINK_FOLLOW) ? VCHROOT_FOLLOW : 0; 19 19 vc.dfd = atfd(fd); 20 - 20 + 21 21 strcpy(vc.path, path); 22 22 23 23 vc2.flags = 0;