Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:smk_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

Proto:static int smk_fill_rule(const char *subject, const char *object, const char *access1, const char *access2, struct smack_parsed_rule *rule, int import, int len)

Type:int

Parameter:

TypeParameterName
const char *subject
const char *object
const char *access1
const char *access2
struct smack_parsed_rule *rule
intimport
intlen
322  If import Then
323  smk_subject = smk_import_entry - import a label, return the list entry*@string: a text string that might be a Smack label*@len: the maximum size, or zero if it is NULL terminated
324  If IS_ERR(smk_subject) Then Return PTR_ERR(smk_subject)
327  smk_object = smk_import_entry - import a label, return the list entry*@string: a text string that might be a Smack label*@len: the maximum size, or zero if it is NULL terminated
328  If IS_ERR(smk_object) Then Return PTR_ERR(smk_object)
330  Else
331  cp = smk_parse_smack - parse smack label from a text string*@string: a text string that might contain a Smack label*@len: the maximum size, or zero if it is NULL terminated.* Returns a pointer to the clean label or an error code.
332  If IS_ERR(cp) Then Return PTR_ERR(cp)
334  skp = smk_find_entry - find a label on the list, return the list entry*@string: a text string that might be a Smack label* Returns a pointer to the entry in the label list that* matches the passed string or NULL if not found.
335  kfree(cp)
336  If (skp == NULL) Then Return -ENOENT
338  smk_subject = skp
340  cp = smk_parse_smack - parse smack label from a text string*@string: a text string that might contain a Smack label*@len: the maximum size, or zero if it is NULL terminated.* Returns a pointer to the clean label or an error code.
341  If IS_ERR(cp) Then Return PTR_ERR(cp)
343  skp = smk_find_entry - find a label on the list, return the list entry*@string: a text string that might be a Smack label* Returns a pointer to the entry in the label list that* matches the passed string or NULL if not found.
344  kfree(cp)
345  If (skp == NULL) Then Return -ENOENT
347  smk_object = skp
350  smk_access1 = 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.
351  If access2 Then smk_access2 = 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.
353  Else smk_access2 = ~smk_access1
356  Return 0
Caller
NameDescribe
smk_parse_rulesmk_parse_rule - parse Smack rule from load string*@data: string to be parsed whose size is SMK_LOADLEN*@rule: Smack rule*@import: if non-zero, import labels* Returns 0 on success, -1 on errors.
smk_parse_long_rulesmk_parse_long_rule - parse Smack rule from rule string*@data: string to be parsed, null terminated*@rule: Will be filled with Smack parsed rule*@import: if non-zero, import labels*@tokens: numer of substrings expected in data