Loading...
--- Libc/Libc-391.5.21/sys/chmodx_np.c
+++ Libc/Libc-997.1.1/sys/chmodx_np.c
@@ -21,7 +21,6 @@
* @APPLE_LICENSE_HEADER_END@
*/
#include <sys/types.h>
-#include <sys/syscall.h>
#include <sys/acl.h>
#include <errno.h>
#include <fcntl.h>
@@ -35,12 +34,12 @@
#include <stdlib.h>
#endif
-static int chmodx_syscall(void *obj, uid_t fsowner, gid_t fsgrp, int mode, struct kauth_filesec *fsacl);
-static int fchmodx_syscall(void *obj, uid_t fsowner, gid_t fsgrp, int mode, struct kauth_filesec *fsacl);
+static int chmodx_syscall(void *obj, uid_t fsowner, gid_t fsgrp, int mode, kauth_filesec_t fsacl);
+static int fchmodx_syscall(void *obj, uid_t fsowner, gid_t fsgrp, int mode, kauth_filesec_t fsacl);
static int chmodx1(void *obj,
int (* chmod_syscall)(void *obj, uid_t fsowner, gid_t fsgrp, int mode,
- struct kauth_filesec *fsacl),
+ kauth_filesec_t fsacl),
filesec_t fsec);
/*
@@ -61,19 +60,22 @@
/*
* Chmod syscalls.
*/
+extern int __chmod_extended(char *, uid_t, gid_t, int, kauth_filesec_t);
+extern int __fchmod_extended(int, uid_t, gid_t, int, kauth_filesec_t);
+
static int
-chmodx_syscall(void *obj, uid_t fsowner, gid_t fsgrp, int mode, struct kauth_filesec *fsacl)
+chmodx_syscall(void *obj, uid_t fsowner, gid_t fsgrp, int mode, kauth_filesec_t fsacl)
{
char *path = *(char **)obj;
- return(syscall(SYS_chmod_extended, path, fsowner, fsgrp, mode, fsacl));
+ return(__chmod_extended(path, fsowner, fsgrp, mode, fsacl));
}
static int
-fchmodx_syscall(void *obj, uid_t fsowner, gid_t fsgrp, int mode, struct kauth_filesec *fsacl)
+fchmodx_syscall(void *obj, uid_t fsowner, gid_t fsgrp, int mode, kauth_filesec_t fsacl)
{
int fd = *(int *)obj;
- return(syscall(SYS_fchmod_extended, fd, fsowner, fsgrp, mode, fsacl));
+ return(__fchmod_extended(fd, fsowner, fsgrp, mode, fsacl));
}
/*
@@ -82,7 +84,7 @@
static int
chmodx1(void *obj,
- int (chmod_syscall)(void *obj, uid_t fsowner, gid_t fsgrp, int mode, struct kauth_filesec *fsacl),
+ int (chmod_syscall)(void *obj, uid_t fsowner, gid_t fsgrp, int mode, kauth_filesec_t fsacl),
filesec_t fsec)
{
uid_t fsowner = KAUTH_UID_NONE;
@@ -92,7 +94,7 @@
size_t size = 0;
int fsacl_used = 0;
int delete_acl = 0;
- struct kauth_filesec *fsacl = NULL;
+ kauth_filesec_t fsacl = KAUTH_FILESEC_NONE;
struct kauth_filesec static_filesec;
if (fsec == NULL) {
@@ -129,7 +131,7 @@
}
/* no ACL, use local filesec */
- if (fsacl == NULL) {
+ if (fsacl == KAUTH_FILESEC_NONE) {
bzero(&static_filesec, sizeof(static_filesec));
fsacl = &static_filesec;
fsacl->fsec_magic = KAUTH_FILESEC_MAGIC;
@@ -163,7 +165,7 @@
if (delete_acl) {
fsacl = _FILESEC_REMOVE_ACL;
} else {
- fsacl = NULL;
+ fsacl = KAUTH_FILESEC_NONE;
}
}