Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\smack\smackfs.c Create Date:2022-07-28 19:26:27
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:smk_perm_from_str - parse smack accesses from a text string*@string: a text string that contains a Smack accesses code* Returns an integer with respective bits set for specified accesses.

Proto:static int smk_perm_from_str(const char *string)

Type:int

Parameter:

TypeParameterName
const char *string
262  perm = 0
265  cycle switch cp
267  Case cp == '-'
268  Break
269  Case cp == 'r'
270  Case cp == 'R'
271  perm |= MAY_READ
272  Break
273  Case cp == 'w'
274  Case cp == 'W'
275  perm |= MAY_WRITE
276  Break
277  Case cp == 'x'
278  Case cp == 'X'
279  perm |= MAY_EXEC
280  Break
281  Case cp == 'a'
282  Case cp == 'A'
283  perm |= MAY_APPEND
284  Break
285  Case cp == 't'
286  Case cp == 'T'
287  perm |= Controls directory labeling
288  Break
289  Case cp == 'l'
290  Case cp == 'L'
291  perm |= Locks should be writes, but ...
292  Break
293  Case cp == 'b'
294  Case cp == 'B'
295  perm |= Report use of this rule
296  Break
297  Default
298  Return perm
Caller
NameDescribe
smk_fill_rulesmk_fill_rule - Fill Smack rule from strings*@subject: subject label string*@object: object label string*@access1: access string*@access2: string with permissions to be removed*@rule: Smack rule*@import: if non-zero, import labels*@len: label length limit