Lines Matching defs:fsec
1881 kauth_filesec_t fsec;
1889 fsec = NULL;
1918 if (((fsec = kauth_filesec_alloc(fsec_size)) == NULL) ||
1920 uio_addiov(fsec_uio, CAST_USER_ADDR_T(fsec), xsize)) {
1955 if (fsec->fsec_magic != host_fsec_magic) {
1961 host_acl_entrycount = ntohl(fsec->fsec_acl.acl_entrycount);
1973 kauth_filesec_acl_setendian(KAUTH_ENDIAN_HOST, fsec, NULL);
1975 *fsecp = fsec;
1976 fsec = NULL;
1979 if (fsec != NULL)
1980 kauth_filesec_free(fsec);
1992 * may or may not point to the `fsec->fsec_acl`, depending on whether the
1996 * fsec The filesec being set.
1997 * acl The acl to be associated with 'fsec'.
2004 * Notes: Both the fsec and the acl are always valid.
2006 * The kauth_filesec_t in 'fsec', if any, is in host byte order,
2020 vnode_set_filesec(vnode_t vp, kauth_filesec_t fsec, kauth_acl_t acl, vfs_context_t ctx)
2039 kauth_filesec_acl_setendian(KAUTH_ENDIAN_DISK, fsec, acl);
2041 uio_addiov(fsec_uio, CAST_USER_ADDR_T(fsec), sizeof(struct kauth_filesec) - sizeof(struct kauth_acl));
2050 kauth_filesec_acl_setendian(KAUTH_ENDIAN_HOST, fsec, acl);
2071 kauth_filesec_t fsec;
2108 fsec = NULL;
2112 if ((error = vnode_get_filesec(vp, &fsec, ctx)) != 0)
2116 if (fsec == NULL) {
2123 VATTR_RETURN(vap, va_uuuid, fsec->fsec_owner);
2124 VATTR_RETURN(vap, va_guuid, fsec->fsec_group);
2128 if (fsec->fsec_acl.acl_entrycount == KAUTH_FILESEC_NOACL) {
2131 facl = kauth_acl_alloc(fsec->fsec_acl.acl_entrycount);
2133 kauth_filesec_free(fsec);
2137 bcopy(&fsec->fsec_acl, facl, KAUTH_ACL_COPYSIZE(&fsec->fsec_acl));
2141 kauth_filesec_free(fsec);
2384 * as are the fsec and lfsec, if they are used.
2396 kauth_filesec_t fsec;
2429 fsec = NULL;
2433 if ((error = vnode_get_filesec(vp, &fsec, ctx)) != 0) {
2439 if (fsec == NULL) {
2441 fsec = &lfsec;
2446 facl = &fsec->fsec_acl;
2449 if (fsec == &lfsec) {
2450 fsec->fsec_magic = KAUTH_FILESEC_MAGIC;
2451 fsec->fsec_owner = kauth_null_guid;
2452 fsec->fsec_group = kauth_null_guid;
2462 fsec->fsec_owner = vap->va_uuuid;
2467 fsec->fsec_group = vap->va_guuid;
2486 kauth_guid_equal(&fsec->fsec_owner, &kauth_null_guid) &&
2487 kauth_guid_equal(&fsec->fsec_group, &kauth_null_guid)) {
2495 error = vnode_set_filesec(vp, fsec, facl, ctx);
2500 if (fsec != &lfsec)
2501 kauth_filesec_free(fsec);