Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\posix_acl.c Create Date:2022-07-28 20:29:49
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Convert from extended attribute to in-memory representation.

Proto:struct posix_acl *posix_acl_from_xattr(struct user_namespace *user_ns, const void *value, size_t size)

Type:struct posix_acl

Parameter:

TypeParameterName
struct user_namespace *user_ns
const void *value
size_tsize
731  header = value
732  entry = header + 1
737  If Not value Then Return NULL
739  If size < sizeof(structposix_acl_xattr_header) Then Return ERR_PTR( - EINVAL)
741  If a_version != cpu_to_le32(Supported ACL a_version fields ) Then Return ERR_PTR( - EOPNOTSUPP)
744  count = posix_acl_xattr_count(size)
745  If count < 0 Then Return ERR_PTR( - EINVAL)
747  If count == 0 Then Return NULL
750  acl = Allocate a new ACL with the specified number of entries.
751  If Not acl Then Return ERR_PTR( - ENOMEM)
753  acl_e = a_entries
755  When entry != end cycle
756  e_tag = le16_to_cpu(e_tag)
757  e_perm = le16_to_cpu(e_perm)
760  Case e_tag == _tag entry in struct posix_acl_entry
761  Case e_tag == ACL_GROUP_OBJ
762  Case e_tag == ACL_MASK
763  Case e_tag == ACL_OTHER
764  Break
766  Case e_tag == ACL_USER
770  If Not uid_valid(e_uid) Then Go to fail
772  Break
773  Case e_tag == ACL_GROUP
777  If Not gid_valid(e_gid) Then Go to fail
779  Break
781  Default
782  Go to fail
785  Return acl
787  fail :
788  Free an ACL handle.
789  Return ERR_PTR( - EINVAL)
Caller
NameDescribe
posix_acl_xattr_set