sys/fs/udf/udf_vnops.c
/* Convert file entry permission (5 bits per owner/group/user) to a mode_t */
Convert file entry permission (5 bits per owner/group/user) to a mode_t
Convert file entry permission ( 5 bits per owner / group / user ) to a mode_t
static mode_t
udf_permtomode(struct udf_node *node)
{
	uint32_t perm;
	uint16_t flags;
	mode_t mode;
	perm = le32toh(node->fentry->perm);
	flags = le16toh(node->fentry->icbtag.flags);
	mode = perm & UDF_FENTRY_PERM_USER_MASK;
	mode |= ((perm & UDF_FENTRY_PERM_GRP_MASK) >> 2);
	mode |= ((perm & UDF_FENTRY_PERM_OWNER_MASK) >> 4);
	mode |= ((flags & UDF_ICB_TAG_FLAGS_STICKY) << 4);
	mode |= ((flags & UDF_ICB_TAG_FLAGS_SETGID) << 6);
	mode |= ((flags & UDF_ICB_TAG_FLAGS_SETUID) << 8);
	return (mode);
}
static mode_t udf_permtomode ( struct udf_node * node ) { uint32_t perm ; uint16_t flags ; mode_t mode ; perm = le32toh ( node -> fentry -> perm ) ; flags = le16toh ( node -> fentry -> icbtag . flags ) ; mode = perm & UDF_FENTRY_PERM_USER_MASK ; mode |= ( ( perm & UDF_FENTRY_PERM_GRP_MASK ) >> 2 ) ; mode |= ( ( perm & UDF_FENTRY_PERM_OWNER_MASK ) >> 4 ) ; mode |= ( ( flags & UDF_ICB_TAG_FLAGS_STICKY ) << 4 ) ; mode |= ( ( flags & UDF_ICB_TAG_FLAGS_SETGID ) << 6 ) ; mode |= ( ( flags & UDF_ICB_TAG_FLAGS_SETUID ) << 8 ) ; return ( mode ) ; }
Convert file entry permission (5 bits per owner/group/user) to a mode_t
Convert file entry permission ( 5 bits per owner / group / user ) to a mode_t