Function report |
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 activity | Download SCCT | Chinese |
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:
| Type | Parameter | Name |
|---|---|---|
| char * | name | |
| const char * | value | |
| struct tomoyo_profile * | profile |
| 602 | config = default_config |
| 603 | Else if tomoyo_str_starts( & name, "CONFIG::") Then |
| 604 | config = 0 |
| 605 | When i < TOMOYO_MAX_MAC_INDEX + TOMOYO_MAX_MAC_CATEGORY_INDEX cycle |
| 607 | len = 0 |
| 609 | If i < TOMOYO_MAX_MAC_INDEX Then |
| 610 | c = tomoyo_index2category[i] |
| 611 | category = String table for categories. [c] |
| 619 | If strcmp(name + len, String table for /sys/kernel/security/tomoyo/profile [i]) Then Continue |
| 622 | Break |
| 624 | If i == TOMOYO_MAX_MAC_INDEX + TOMOYO_MAX_MAC_CATEGORY_INDEX Then Return -EINVAL |
| 626 | Else |
| 627 | Return -EINVAL |
| 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 |
| 641 | If config != TOMOYO_CONFIG_USE_DEFAULT Then |
| 645 | Break |
| 647 | config &= ~TOMOYO_CONFIG_WANT_GRANT_LOG |
| 648 | Break |
| 653 | Break |
| 655 | config &= ~TOMOYO_CONFIG_WANT_REJECT_LOG |
| 656 | 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 |
| Name | Describe |
|---|---|
| tomoyo_write_profile | moyo_write_profile - Write profile table.*@head: Pointer to "struct tomoyo_io_buffer".* Returns 0 on success, negative value otherwise. |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |