this repo has no description
1
fork

Configure Feed

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

Use vchroot in chmod_extended

+13 -2
+13 -2
src/kernel/emulation/linux/unistd/chmod_extended.c
··· 2 2 #include "../base.h" 3 3 #include "../errno.h" 4 4 #include <linux-syscalls/linux.h> 5 + #include "../bsdthread/per_thread_wd.h" 6 + #include "../vchroot_expand.h" 5 7 6 8 long sys_chmod_extended(const char* path, int uid, int gid, int mode, void* xsec) 7 9 { 8 10 int ret; 9 11 10 - ret = LINUX_SYSCALL(__NR_chmod, path, mode); 12 + struct vchroot_expand_args vc; 13 + vc.flags = VCHROOT_FOLLOW; 14 + vc.dfd = get_perthread_wd(); 15 + 16 + strcpy(vc.path, path); 17 + ret = vchroot_expand(&vc); 18 + if (ret < 0) 19 + return errno_linux_to_bsd(ret); 20 + 21 + ret = LINUX_SYSCALL(__NR_chmod, vc.path, mode); 11 22 if (ret < 0) 12 23 return errno_linux_to_bsd(ret); 13 24 14 - ret = LINUX_SYSCALL(__NR_chown, path, uid, gid); 25 + ret = LINUX_SYSCALL(__NR_chown, vc.path, uid, gid); 15 26 if (ret < 0) 16 27 return errno_linux_to_bsd(ret); 17 28