mirror of
https://github.com/darlinghq/darling.git
synced 2024-11-23 12:19:43 +00:00
Handle KAUTH_{U,G}ID_NONE
and mode -1 in fchmod_extended
These are actually accepted and allowed by Darwin.
This commit is contained in:
parent
1c3749bf8a
commit
e360419d3b
@ -3,10 +3,18 @@
|
|||||||
#include "../errno.h"
|
#include "../errno.h"
|
||||||
#include <linux-syscalls/linux.h>
|
#include <linux-syscalls/linux.h>
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/kauth.h>
|
||||||
|
|
||||||
long sys_fchmod_extended(int fd, int uid, int gid, int mode, void* xsec)
|
long sys_fchmod_extended(int fd, int uid, int gid, int mode, void* xsec)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
// apparently, these are supposed to go through successfully
|
||||||
|
if (uid == KAUTH_UID_NONE || gid == KAUTH_GID_NONE || mode == -1) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
ret = LINUX_SYSCALL2(__NR_fchmod, fd, mode);
|
ret = LINUX_SYSCALL2(__NR_fchmod, fd, mode);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return errno_linux_to_bsd(ret);
|
return errno_linux_to_bsd(ret);
|
||||||
|
Loading…
Reference in New Issue
Block a user