]> git.saurik.com Git - apple/libc.git/blobdiff - sys/chmodx_np.c
Libc-825.24.tar.gz
[apple/libc.git] / sys / chmodx_np.c
index 6896298fc410160f074dd643077aea9c0e251aae..f03e3a1ca12de4ab2279683981ab44dd31c1d851 100644 (file)
 #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);
 
 /*
@@ -60,11 +60,11 @@ fchmodx_np(int fd, filesec_t fsec)
 /*
  * Chmod syscalls.
  */
-extern int __chmod_extended(char *, uid_t, gid_t, int, struct kauth_filesec *);
-extern int __fchmod_extended(int, uid_t, gid_t, int, struct kauth_filesec *);
+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;
 
@@ -72,7 +72,7 @@ chmodx_syscall(void *obj, uid_t fsowner, gid_t fsgrp, int mode, struct kauth_fil
 }
 
 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(__fchmod_extended(fd, fsowner, fsgrp, mode, fsacl));
@@ -84,7 +84,7 @@ fchmodx_syscall(void *obj, uid_t fsowner, gid_t fsgrp, int mode, struct kauth_fi
        
 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;
@@ -94,7 +94,7 @@ chmodx1(void *obj,
        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) {
@@ -131,7 +131,7 @@ chmodx1(void *obj,
        }
        
        /* 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;
@@ -165,7 +165,7 @@ chmodx1(void *obj,
                if (delete_acl) {
                        fsacl = _FILESEC_REMOVE_ACL;
                } else {
-                       fsacl = NULL;
+                       fsacl = KAUTH_FILESEC_NONE;
                }
        }