FreeBSD/sys/kern/subr_acl_posix1e.c
/*
 * Given inode information (uid, gid, mode), return an acl entry of the
 * appropriate type.
 */
Given inode information (uid, gid, mode), return an acl entry of the
appropriate type.
Given inode information ( uid gid mode ) return an acl entry of the appropriate type .
struct acl_entry
acl_posix1e_mode_to_entry(acl_tag_t tag, uid_t uid, gid_t gid, mode_t mode)
{
	struct acl_entry	acl_entry;
	acl_entry.ae_tag = tag;
	acl_entry.ae_perm = acl_posix1e_mode_to_perm(tag, mode);
	acl_entry.ae_entry_type = 0;
	acl_entry.ae_flags = 0;
	switch(tag) {
	case ACL_USER_OBJ:
		acl_entry.ae_id = uid;
		break;
	case ACL_GROUP_OBJ:
		acl_entry.ae_id = gid;
		break;
	case ACL_OTHER:
		acl_entry.ae_id = ACL_UNDEFINED_ID;
		break;
	default:
		acl_entry.ae_id = ACL_UNDEFINED_ID;
		printf("acl_posix1e_mode_to_entry: invalid tag (%d)\n", tag);
	}
	return (acl_entry);
}
struct acl_entry acl_posix1e_mode_to_entry ( acl_tag_t tag , uid_t uid , gid_t gid , mode_t mode ) { struct acl_entry acl_entry ; acl_entry . ae_tag = tag ; acl_entry . ae_perm = acl_posix1e_mode_to_perm ( tag , mode ) ; acl_entry . ae_entry_type = 0 ; acl_entry . ae_flags = 0 ; switch ( tag ) { case ACL_USER_OBJ : acl_entry . ae_id = uid ; break ; case ACL_GROUP_OBJ : acl_entry . ae_id = gid ; break ; case ACL_OTHER : acl_entry . ae_id = ACL_UNDEFINED_ID ; break ; default : acl_entry . ae_id = ACL_UNDEFINED_ID ; printf ( " \n " , tag ) ; } return ( acl_entry ) ; }
Given inode information (uid, gid, mode), return an acl entry of the
 appropriate type.
Given inode information ( uid gid mode ) return an acl entry of the appropriate type .