Function report |
Source Code:security\tomoyo\condition.c |
Create Date:2022-07-28 19:38:34 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:moyo_get_condition - Parse condition part.*@param: Pointer to "struct tomoyo_acl_param".* Returns pointer to "struct tomoyo_condition" on success, NULL otherwise.
Proto:struct tomoyo_condition *tomoyo_get_condition(struct tomoyo_acl_param *param)
Type:struct tomoyo_condition
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct tomoyo_acl_param * | param |
| 497 | struct tomoyo_condition * entry = NULL |
| 498 | struct tomoyo_condition_element * condp = NULL |
| 499 | struct tomoyo_number_union * numbers_p = NULL |
| 500 | struct tomoyo_name_union * names_p = NULL |
| 501 | struct tomoyo_argv * argv = NULL |
| 502 | struct tomoyo_envp * envp = NULL |
| 503 | struct tomoyo_condition e = {} |
| 506 | end_of_string = start_of_string + strlen - Find the length of a string*@s: The string to be sized |
| 509 | rerun : |
| 510 | pos = start_of_string |
| 511 | When 1 cycle |
| 512 | left = -1 |
| 513 | right = -1 |
| 519 | If Not left_word Then Break |
| 531 | 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 |
| 532 | If cp Then |
| 535 | Else |
| 536 | pos = "" |
| 538 | right_word = 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 |
| 539 | If Not right_word || right_word == left_word Then Go to out |
| 541 | is_not = *(right_word - 1) == '!' |
| 542 | If is_not Then * (right_word++ - 1) = '\0' |
| 544 | Else if *(right_word + 1) != '=' Then right_word++ = '\0' |
| 546 | Else Go to out |
| 548 | Define this to enable debug mode. (warning conditions "%u: <%s>%s=<%s>\n", __LINE__, left_word, is_not ? "!" : "", right_word) |
| 551 | If entry Then |
| 552 | If is_not || One of values in "enum tomoyo_grant_log". != TOMOYO_GRANTLOG_AUTO Then Go to out |
| 555 | Else if Not strcmp(right_word, "yes") Then One of values in "enum tomoyo_grant_log". = TOMOYO_GRANTLOG_YES |
| 557 | Else if Not strcmp(right_word, "no") Then One of values in "enum tomoyo_grant_log". = TOMOYO_GRANTLOG_NO |
| 559 | Else Go to out |
| 562 | Continue |
| 594 | left = moyo_condition_type - Get condition type.*@word: Keyword string.* Returns one of values in "enum tomoyo_conditions_index" on success,* TOMOYO_MAX_CONDITION_KEYWORD otherwise. |
| 595 | Define this to enable debug mode. (warning conditions "%u: <%s> left=%u\n", __LINE__, left_word, left) |
| 597 | If left == TOMOYO_MAX_CONDITION_KEYWORD Then |
| 598 | If Not numbers_p Then |
| 600 | Else |
| 602 | left = TOMOYO_NUMBER_UNION |
| 604 | If left_word == '@' || Not tomoyo_parse_number_union(param, numbers_p++) Then Go to out |
| 610 | If Not condp Then Number of conditions in this struct. ++ |
| 612 | Else Number of conditions in this struct. -- |
| 614 | If left == TOMOYO_EXEC_REALPATH || left == TOMOYO_SYMLINK_TARGET Then |
| 616 | If Not names_p Then |
| 618 | Else |
| 620 | right = TOMOYO_NAME_UNION |
| 621 | data = right_word |
| 626 | Go to store_value |
| 628 | right = moyo_condition_type - Get condition type.*@word: Keyword string.* Returns one of values in "enum tomoyo_conditions_index" on success,* TOMOYO_MAX_CONDITION_KEYWORD otherwise. |
| 629 | If right == TOMOYO_MAX_CONDITION_KEYWORD Then |
| 630 | If Not numbers_p Then |
| 632 | Else |
| 634 | right = TOMOYO_NUMBER_UNION |
| 635 | data = right_word |
| 636 | If Not tomoyo_parse_number_union(param, numbers_p++) Then Go to out |
| 641 | store_value : |
| 642 | If Not condp Then |
| 643 | Define this to enable debug mode. (warning conditions "%u: dry_run left=%u right=%u match=%u\n", __LINE__, left, right, !is_not) |
| 645 | Continue |
| 647 | Left hand operand. A "struct tomoyo_argv" for TOMOYO_ARGV_ENTRY, a* "struct tomoyo_envp" for TOMOYO_ENVP_ENTRY is attached to the tail* of the array of this struct. = left |
| 648 | Right hand operand. A "struct tomoyo_number_union" for* TOMOYO_NUMBER_UNION, a "struct tomoyo_name_union" for* TOMOYO_NAME_UNION is attached to the tail of the array of this* struct. = right |
| 653 | condp++ |
| 655 | Define this to enable debug mode. (formational "%u: cond=%u numbers=%u names=%u ac=%u ec=%u\n", __LINE__, Number of conditions in this struct. , Number of "struct tomoyo_number_union values". , Number of "struct tomoyo_name_union names". , Number of "struct tomoyo_argv". , Number of "struct tomoyo_envp". ) |
| 658 | If entry Then |
| 669 | entry = 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). |
| 673 | Maybe NULL. = NULL |
| 680 | bool flag = false |
| 682 | When pos < end_of_string cycle |
| 694 | Go to rerun |
| 695 | out : |
| 696 | Define this to enable debug mode. (warning conditions "%u: %s failed\n", __LINE__, __func__) |
| 697 | If entry Then |
| 701 | out2 : |
| 703 | Return NULL |
| Name | Describe |
|---|---|
| tomoyo_update_domain | moyo_update_domain - Update an entry for domain policy.*@new_entry: Pointer to "struct tomoyo_acl_info".*@size: Size of @new_entry in bytes.*@param: Pointer to "struct tomoyo_acl_param".*@check_duplicate: Callback function to find duplicated entry. |
| 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 |