723 return (aclentry2vsecattr(ip->i_ufs_acl, vsap));
724
725 /*
726 * If no ACLs are present, fabricate one from the mode bits.
727 * This code is almost identical to fs_fab_acl(), but we
728 * already have the mode bits handy, so we'll avoid going
729 * through VOP_GETATTR() again.
730 */
731
732 vsap->vsa_aclcnt = 0;
733 vsap->vsa_aclentp = NULL;
734 vsap->vsa_dfaclcnt = 0; /* Default ACLs are not fabricated */
735 vsap->vsa_dfaclentp = NULL;
736
737 if (vsap->vsa_mask & (VSA_ACLCNT | VSA_ACL))
738 vsap->vsa_aclcnt = 4; /* USER, GROUP, OTHER, and CLASS */
739
740 if (vsap->vsa_mask & VSA_ACL) {
741 vsap->vsa_aclentp = kmem_zalloc(4 * sizeof (aclent_t),
742 KM_SLEEP);
743 if (vsap->vsa_aclentp == NULL)
744 return (ENOMEM);
745 aclentp = vsap->vsa_aclentp;
746
747 /* Owner */
748 aclentp->a_type = USER_OBJ;
749 aclentp->a_perm = ((ushort_t)(ip->i_mode & 0700)) >> 6;
750 aclentp->a_id = ip->i_uid; /* Really undefined */
751 aclentp++;
752
753 /* Group */
754 aclentp->a_type = GROUP_OBJ;
755 aclentp->a_perm = ((ushort_t)(ip->i_mode & 0070)) >> 3;
756 aclentp->a_id = ip->i_gid; /* Really undefined */
757 aclentp++;
758
759 /* Other */
760 aclentp->a_type = OTHER_OBJ;
761 aclentp->a_perm = ip->i_mode & 0007;
762 aclentp->a_id = 0; /* Really undefined */
763 aclentp++;
764
|
723 return (aclentry2vsecattr(ip->i_ufs_acl, vsap));
724
725 /*
726 * If no ACLs are present, fabricate one from the mode bits.
727 * This code is almost identical to fs_fab_acl(), but we
728 * already have the mode bits handy, so we'll avoid going
729 * through VOP_GETATTR() again.
730 */
731
732 vsap->vsa_aclcnt = 0;
733 vsap->vsa_aclentp = NULL;
734 vsap->vsa_dfaclcnt = 0; /* Default ACLs are not fabricated */
735 vsap->vsa_dfaclentp = NULL;
736
737 if (vsap->vsa_mask & (VSA_ACLCNT | VSA_ACL))
738 vsap->vsa_aclcnt = 4; /* USER, GROUP, OTHER, and CLASS */
739
740 if (vsap->vsa_mask & VSA_ACL) {
741 vsap->vsa_aclentp = kmem_zalloc(4 * sizeof (aclent_t),
742 KM_SLEEP);
743
744 aclentp = vsap->vsa_aclentp;
745
746 /* Owner */
747 aclentp->a_type = USER_OBJ;
748 aclentp->a_perm = ((ushort_t)(ip->i_mode & 0700)) >> 6;
749 aclentp->a_id = ip->i_uid; /* Really undefined */
750 aclentp++;
751
752 /* Group */
753 aclentp->a_type = GROUP_OBJ;
754 aclentp->a_perm = ((ushort_t)(ip->i_mode & 0070)) >> 3;
755 aclentp->a_id = ip->i_gid; /* Really undefined */
756 aclentp++;
757
758 /* Other */
759 aclentp->a_type = OTHER_OBJ;
760 aclentp->a_perm = ip->i_mode & 0007;
761 aclentp->a_id = 0; /* Really undefined */
762 aclentp++;
763
|