Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\tomoyo\common.c Create Date:2022-07-28 19:36:30
Last Modify:2020-03-18 09:15:18 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:moyo_add_entry - Add an ACL to current thread's domain. Used by learning mode.*@domain: Pointer to "struct tomoyo_domain_info".*@header: Lines containing ACL.* Returns nothing.

Proto:static void tomoyo_add_entry(struct tomoyo_domain_info *domain, char *header)

Type:void

Parameter:

TypeParameterName
struct tomoyo_domain_info *domain
char *header
2002  char * realpath = NULL
2003  char * argv0 = NULL
2004  char * symlink = NULL
2005  cp = strchr - Find the first occurrence of the character c in the string s.*@s: the string to be searched*@c: the character to search for
2008  If Not cp Then Return
2010  cp = strchr - Find the first occurrence of the character c in the string s.*@s: the string to be searched*@c: the character to search for
2011  If Not cp Then Return
2013  cp++ = '\0'
2014  len = strlen - Find the length of a string*@s: The string to be sized + 1
2016  If cp == 'f' Then
2017  argv0 = strstr - Find the first substring in a %NUL terminated string*@s1: The string to be searched*@s2: The string to search for
2018  If argv0 Then
2019  argv0 += 10
2022  realpath = strstr - Find the first substring in a %NUL terminated string*@s1: The string to be searched*@s2: The string to search for
2023  If realpath Then
2024  realpath += 8
2027  symlink = strstr - Find the first substring in a %NUL terminated string*@s1: The string to be searched*@s2: The string to search for
2028  If symlink Then len += moyo_truncate - Truncate a line.*@str: String to truncate.* Returns length of truncated @str. + 1
2031  buffer = Allocation memory
2032  If Not buffer Then Return
2034  snprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@size: The size of the buffer, including the trailing null space*@fmt: The format string to use*@
2035  If realpath Then moyo_addprintf - strncat()-like-snprintf().*@buffer: Buffer to write to. Must be '\0'-terminated.*@len: Size of @buffer.*@fmt: The printf()'s format string, followed by parameters.* Returns nothing.
2037  If argv0 Then moyo_addprintf - strncat()-like-snprintf().*@buffer: Buffer to write to. Must be '\0'-terminated.*@len: Size of @buffer.*@fmt: The printf()'s format string, followed by parameters.* Returns nothing.
2039  If symlink Then moyo_addprintf - strncat()-like-snprintf().*@buffer: Buffer to write to. Must be '\0'-terminated.*@len: Size of @buffer.*@fmt: The printf()'s format string, followed by parameters.* Returns nothing.
2041  tomoyo_normalize_line(buffer)
2042  If Not moyo_write_domain2 - Write domain policy.*@ns: Pointer to "struct tomoyo_policy_namespace".*@list: Pointer to "struct list_head".*@data: Policy to be interpreted.*@is_delete: True if it is a delete request.* Returns 0 on success, negative value otherwise. Then moyo_update_stat - Update statistic counters.*@index: Index for policy type.* Returns nothing.
2045  kfree(buffer)
Caller
NameDescribe
tomoyo_supervisormoyo_supervisor - Ask for the supervisor's decision