Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:moyo_set_mode - Set mode for specified profile.*@name: Name of functionality.*@value: Mode for @name.*@profile: Pointer to "struct tomoyo_profile".* Returns 0 on success, negative value otherwise.

Proto:static int tomoyo_set_mode(char *name, const char *value, struct tomoyo_profile *profile)

Type:int

Parameter:

TypeParameterName
char *name
const char *value
struct tomoyo_profile *profile
600  If Not strcmp(name, "CONFIG") Then
601  i = TOMOYO_MAX_MAC_INDEX + TOMOYO_MAX_MAC_CATEGORY_INDEX
602  config = default_config
603  Else if tomoyo_str_starts( & name, "CONFIG::") Then
604  config = 0
607  len = 0
609  If i < TOMOYO_MAX_MAC_INDEX Then
621  config = config[i]
622  Break
624  If i == TOMOYO_MAX_MAC_INDEX + TOMOYO_MAX_MAC_CATEGORY_INDEX Then Return -EINVAL
626  Else
627  Return -EINVAL
629  If strstr - Find the first substring in a %NUL terminated string*@s1: The string to be searched*@s2: The string to search for Then
630  config = TOMOYO_CONFIG_USE_DEFAULT
631  Else
634  When mode < 4 cycle If strstr - Find the first substring in a %NUL terminated string*@s1: The string to be searched*@s2: The string to search for Then
640  config = config & ~7 | mode
645  Break
660  If i < TOMOYO_MAX_MAC_INDEX + TOMOYO_MAX_MAC_CATEGORY_INDEX Then config[i] = config
662  Else if config != TOMOYO_CONFIG_USE_DEFAULT Then default_config = config
664  Return 0
Caller
NameDescribe
tomoyo_write_profilemoyo_write_profile - Write profile table.*@head: Pointer to "struct tomoyo_io_buffer".* Returns 0 on success, negative value otherwise.