函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\tomoyo\common.c Create Date:2022-07-27 21:03:42
Last Modify:2020-03-18 09:15:18 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称: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.

函数原型:static int tomoyo_set_mode(char *name, const char *value, struct tomoyo_profile *profile)

返回类型:int

参数:

类型参数名称
char *name
const char *value
struct tomoyo_profile *profile
600  如果非字符串比较
601  i等于TOMOYO_MAX_MAC_INDEXTOMOYO_MAX_MAC_CATEGORY_INDEX
602  config等于default_config
603  否则如果tomoyo_str_starts( & name, "CONFIG::")则
604  config等于0
607  len等于0
609  如果i小于TOMOYO_MAX_MAC_INDEX
610  c等于tomoyo_index2category[i]
615  如果字符串指定长度比较name[len++]不等于':'或name[len++]不等于':'则继续下一循环
619  如果字符串比较则继续下一循环
621  config等于config[i]
622  退出
624  如果i恒等于TOMOYO_MAX_MAC_INDEXTOMOYO_MAX_MAC_CATEGORY_INDEX则返回:负EINVAL
626  否则
627  返回:负EINVAL
629  如果strstr - Find the first substring in a %NUL terminated string*@s1: The string to be searched*@s2: The string to search for
630  config等于TOMOYO_CONFIG_USE_DEFAULT
631  否则
634 mode小于4循环如果strstr - Find the first substring in a %NUL terminated string*@s1: The string to be searched*@s2: The string to search for
640  config等于config按位与7的反按位或mode
641  如果config不等于TOMOYO_CONFIG_USE_DEFAULT
660  如果i小于TOMOYO_MAX_MAC_INDEXTOMOYO_MAX_MAC_CATEGORY_INDEXconfig[i]等于config
662  否则如果config不等于TOMOYO_CONFIG_USE_DEFAULTdefault_config等于config
664  返回:0
调用者
名称描述
tomoyo_write_profilemoyo_write_profile - Write profile table.*@head: Pointer to "struct tomoyo_io_buffer".* Returns 0 on success, negative value otherwise.