sys/kern/kern_acl.c
/*
 * Utility function to generate a file mode given appropriate ACL entries.
 */
Utility function to generate a file mode given appropriate ACL entries.
Utility function to generate a file mode given appropriate ACL entries .
mode_t
acl_posix1e_perms_to_mode(struct acl_entry *acl_user_obj_entry,
    struct acl_entry *acl_group_obj_entry, struct acl_entry *acl_other_entry)
{
	mode_t	mode;
	mode = 0;
	if (acl_user_obj_entry->ae_perm & ACL_EXECUTE)
		mode |= S_IXUSR;
	if (acl_user_obj_entry->ae_perm & ACL_READ)
		mode |= S_IRUSR;
	if (acl_user_obj_entry->ae_perm & ACL_WRITE)
		mode |= S_IWUSR;
	if (acl_group_obj_entry->ae_perm & ACL_EXECUTE)
		mode |= S_IXGRP;
	if (acl_group_obj_entry->ae_perm & ACL_READ)
		mode |= S_IRGRP;
	if (acl_group_obj_entry->ae_perm & ACL_WRITE)
		mode |= S_IWGRP;
	if (acl_other_entry->ae_perm & ACL_EXECUTE)
		mode |= S_IXOTH;
	if (acl_other_entry->ae_perm & ACL_READ)
		mode |= S_IROTH;
	if (acl_other_entry->ae_perm & ACL_WRITE)
		mode |= S_IWOTH;
	return (mode);
}
mode_t acl_posix1e_perms_to_mode ( struct acl_entry * acl_user_obj_entry , struct acl_entry * acl_group_obj_entry , struct acl_entry * acl_other_entry ) { mode_t mode ; mode = 0 ; if ( acl_user_obj_entry -> ae_perm & ACL_EXECUTE ) mode |= S_IXUSR ; if ( acl_user_obj_entry -> ae_perm & ACL_READ ) mode |= S_IRUSR ; if ( acl_user_obj_entry -> ae_perm & ACL_WRITE ) mode |= S_IWUSR ; if ( acl_group_obj_entry -> ae_perm & ACL_EXECUTE ) mode |= S_IXGRP ; if ( acl_group_obj_entry -> ae_perm & ACL_READ ) mode |= S_IRGRP ; if ( acl_group_obj_entry -> ae_perm & ACL_WRITE ) mode |= S_IWGRP ; if ( acl_other_entry -> ae_perm & ACL_EXECUTE ) mode |= S_IXOTH ; if ( acl_other_entry -> ae_perm & ACL_READ ) mode |= S_IROTH ; if ( acl_other_entry -> ae_perm & ACL_WRITE ) mode |= S_IWOTH ; return ( mode ) ; }
Utility function to generate a file mode given appropriate ACL entries.
Utility function to generate a file mode given appropriate ACL entries .