Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

Proto:char *smk_parse_smack(const char *string, int len)

Type:char

Parameter:

TypeParameterName
const char *string
intlen
449  If len <= 0 Then len = strlen - Find the length of a string*@s: The string to be sized + 1
457  If string[0] == '-' Then Return ERR_PTR( - EINVAL)
460  When i < len cycle If string[i] > '~' || string[i] <= ' ' || string[i] == '/' || string[i] == '"' || string[i] == '\\' || string[i] == '\'' Then
463  Break
465  If i == 0 || i >= SMK_LONGLABEL Then Return ERR_PTR( - EINVAL)
468  smack = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
469  If (smack == NULL) Then Return ERR_PTR( - ENOMEM)
472  strncpy(smack, string, i)
474  Return smack
Caller
NameDescribe
smk_import_entrysmk_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
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
smk_write_revoke_subjsmk_write_revoke_subj - write() for /smack/revoke-subject*@file: file pointer*@buf: data from user space*@count: bytes sent*@ppos: where to start - must be 0