Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Check if an acl is valid. Returns 0 if it is, or -E... otherwise.

Proto:int posix_acl_valid(struct user_namespace *user_ns, const struct posix_acl *acl)

Type:int

Parameter:

TypeParameterName
struct user_namespace *user_ns
const struct posix_acl *acl
213  state = _tag entry in struct posix_acl_entry
214  needs_mask = 0
217  If e_perm & ~( permissions in the e_perm field | ACL_WRITE | ACL_EXECUTE) Then Return -EINVAL
220  Case e_tag == _tag entry in struct posix_acl_entry
222  state = ACL_USER
223  Break
225  Return -EINVAL
227  Case e_tag == ACL_USER
228  If state != ACL_USER Then Return -EINVAL
230  If Not kuid_has_mapping(user_ns, e_uid) Then Return -EINVAL
232  needs_mask = 1
233  Break
235  Case e_tag == ACL_GROUP_OBJ
236  If state == ACL_USER Then
237  state = ACL_GROUP
238  Break
240  Return -EINVAL
242  Case e_tag == ACL_GROUP
243  If state != ACL_GROUP Then Return -EINVAL
245  If Not kgid_has_mapping(user_ns, e_gid) Then Return -EINVAL
247  needs_mask = 1
248  Break
250  Case e_tag == ACL_MASK
251  If state != ACL_GROUP Then Return -EINVAL
253  state = ACL_OTHER
254  Break
256  Case e_tag == ACL_OTHER
257  If state == ACL_OTHER || state == ACL_GROUP && Not needs_mask Then
259  state = 0
260  Break
262  Return -EINVAL
264  Default
265  Return -EINVAL
268  If state == 0 Then Return 0
270  Return -EINVAL
Caller
NameDescribe
set_posix_acl