diff options
author | Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> | 2010-06-16 03:23:55 -0400 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2010-08-02 01:34:33 -0400 |
commit | 75093152a97ee0ec281895b4f6229ff3c481fd64 (patch) | |
tree | 960bdf1d441f43c2dfa3c4d54c48af5fc524a1a8 /security/tomoyo/common.c | |
parent | 99a852596beb26cc449ca1a79834c107ef4080e1 (diff) |
TOMOYO: Rename symbols.
Use shorter name in order to make it easier to fix 80 columns limit.
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security/tomoyo/common.c')
-rw-r--r-- | security/tomoyo/common.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/security/tomoyo/common.c b/security/tomoyo/common.c index 4ee47af0917d..1a22fff89e70 100644 --- a/security/tomoyo/common.c +++ b/security/tomoyo/common.c | |||
@@ -494,12 +494,12 @@ static int tomoyo_update_manager_entry(const char *manager, | |||
494 | struct tomoyo_policy_manager_entry e = { }; | 494 | struct tomoyo_policy_manager_entry e = { }; |
495 | int error; | 495 | int error; |
496 | 496 | ||
497 | if (tomoyo_is_domain_def(manager)) { | 497 | if (tomoyo_domain_def(manager)) { |
498 | if (!tomoyo_is_correct_domain(manager)) | 498 | if (!tomoyo_correct_domain(manager)) |
499 | return -EINVAL; | 499 | return -EINVAL; |
500 | e.is_domain = true; | 500 | e.is_domain = true; |
501 | } else { | 501 | } else { |
502 | if (!tomoyo_is_correct_path(manager)) | 502 | if (!tomoyo_correct_path(manager)) |
503 | return -EINVAL; | 503 | return -EINVAL; |
504 | } | 504 | } |
505 | e.manager = tomoyo_get_name(manager); | 505 | e.manager = tomoyo_get_name(manager); |
@@ -565,14 +565,14 @@ static int tomoyo_read_manager_policy(struct tomoyo_io_buffer *head) | |||
565 | } | 565 | } |
566 | 566 | ||
567 | /** | 567 | /** |
568 | * tomoyo_is_policy_manager - Check whether the current process is a policy manager. | 568 | * tomoyo_policy_manager - Check whether the current process is a policy manager. |
569 | * | 569 | * |
570 | * Returns true if the current process is permitted to modify policy | 570 | * Returns true if the current process is permitted to modify policy |
571 | * via /sys/kernel/security/tomoyo/ interface. | 571 | * via /sys/kernel/security/tomoyo/ interface. |
572 | * | 572 | * |
573 | * Caller holds tomoyo_read_lock(). | 573 | * Caller holds tomoyo_read_lock(). |
574 | */ | 574 | */ |
575 | static bool tomoyo_is_policy_manager(void) | 575 | static bool tomoyo_policy_manager(void) |
576 | { | 576 | { |
577 | struct tomoyo_policy_manager_entry *ptr; | 577 | struct tomoyo_policy_manager_entry *ptr; |
578 | const char *exe; | 578 | const char *exe; |
@@ -617,7 +617,7 @@ static bool tomoyo_is_policy_manager(void) | |||
617 | } | 617 | } |
618 | 618 | ||
619 | /** | 619 | /** |
620 | * tomoyo_is_select_one - Parse select command. | 620 | * tomoyo_select_one - Parse select command. |
621 | * | 621 | * |
622 | * @head: Pointer to "struct tomoyo_io_buffer". | 622 | * @head: Pointer to "struct tomoyo_io_buffer". |
623 | * @data: String to parse. | 623 | * @data: String to parse. |
@@ -626,7 +626,7 @@ static bool tomoyo_is_policy_manager(void) | |||
626 | * | 626 | * |
627 | * Caller holds tomoyo_read_lock(). | 627 | * Caller holds tomoyo_read_lock(). |
628 | */ | 628 | */ |
629 | static bool tomoyo_is_select_one(struct tomoyo_io_buffer *head, | 629 | static bool tomoyo_select_one(struct tomoyo_io_buffer *head, |
630 | const char *data) | 630 | const char *data) |
631 | { | 631 | { |
632 | unsigned int pid; | 632 | unsigned int pid; |
@@ -647,7 +647,7 @@ static bool tomoyo_is_select_one(struct tomoyo_io_buffer *head, | |||
647 | read_unlock(&tasklist_lock); | 647 | read_unlock(&tasklist_lock); |
648 | rcu_read_unlock(); | 648 | rcu_read_unlock(); |
649 | } else if (!strncmp(data, "domain=", 7)) { | 649 | } else if (!strncmp(data, "domain=", 7)) { |
650 | if (tomoyo_is_domain_def(data + 7)) | 650 | if (tomoyo_domain_def(data + 7)) |
651 | domain = tomoyo_find_domain(data + 7); | 651 | domain = tomoyo_find_domain(data + 7); |
652 | } else | 652 | } else |
653 | return false; | 653 | return false; |
@@ -748,12 +748,12 @@ static int tomoyo_write_domain_policy(struct tomoyo_io_buffer *head) | |||
748 | is_delete = true; | 748 | is_delete = true; |
749 | else if (tomoyo_str_starts(&data, TOMOYO_KEYWORD_SELECT)) | 749 | else if (tomoyo_str_starts(&data, TOMOYO_KEYWORD_SELECT)) |
750 | is_select = true; | 750 | is_select = true; |
751 | if (is_select && tomoyo_is_select_one(head, data)) | 751 | if (is_select && tomoyo_select_one(head, data)) |
752 | return 0; | 752 | return 0; |
753 | /* Don't allow updating policies by non manager programs. */ | 753 | /* Don't allow updating policies by non manager programs. */ |
754 | if (!tomoyo_is_policy_manager()) | 754 | if (!tomoyo_policy_manager()) |
755 | return -EPERM; | 755 | return -EPERM; |
756 | if (tomoyo_is_domain_def(data)) { | 756 | if (tomoyo_domain_def(data)) { |
757 | domain = NULL; | 757 | domain = NULL; |
758 | if (is_delete) | 758 | if (is_delete) |
759 | tomoyo_delete_domain(data); | 759 | tomoyo_delete_domain(data); |
@@ -894,26 +894,26 @@ static bool tomoyo_print_path_number_acl(struct tomoyo_io_buffer *head, | |||
894 | } | 894 | } |
895 | 895 | ||
896 | /** | 896 | /** |
897 | * tomoyo_print_path_number3_acl - Print a path_number3 ACL entry. | 897 | * tomoyo_print_mkdev_acl - Print a mkdev ACL entry. |
898 | * | 898 | * |
899 | * @head: Pointer to "struct tomoyo_io_buffer". | 899 | * @head: Pointer to "struct tomoyo_io_buffer". |
900 | * @ptr: Pointer to "struct tomoyo_path_number3_acl". | 900 | * @ptr: Pointer to "struct tomoyo_mkdev_acl". |
901 | * | 901 | * |
902 | * Returns true on success, false otherwise. | 902 | * Returns true on success, false otherwise. |
903 | */ | 903 | */ |
904 | static bool tomoyo_print_path_number3_acl(struct tomoyo_io_buffer *head, | 904 | static bool tomoyo_print_mkdev_acl(struct tomoyo_io_buffer *head, |
905 | struct tomoyo_path_number3_acl *ptr) | 905 | struct tomoyo_mkdev_acl *ptr) |
906 | { | 906 | { |
907 | int pos; | 907 | int pos; |
908 | u8 bit; | 908 | u8 bit; |
909 | const u16 perm = ptr->perm; | 909 | const u16 perm = ptr->perm; |
910 | for (bit = head->read_bit; bit < TOMOYO_MAX_PATH_NUMBER3_OPERATION; | 910 | for (bit = head->read_bit; bit < TOMOYO_MAX_MKDEV_OPERATION; |
911 | bit++) { | 911 | bit++) { |
912 | if (!(perm & (1 << bit))) | 912 | if (!(perm & (1 << bit))) |
913 | continue; | 913 | continue; |
914 | pos = head->read_avail; | 914 | pos = head->read_avail; |
915 | if (!tomoyo_io_printf(head, "allow_%s", | 915 | if (!tomoyo_io_printf(head, "allow_%s", |
916 | tomoyo_path_number32keyword(bit)) || | 916 | tomoyo_mkdev2keyword(bit)) || |
917 | !tomoyo_print_name_union(head, &ptr->name) || | 917 | !tomoyo_print_name_union(head, &ptr->name) || |
918 | !tomoyo_print_number_union(head, &ptr->mode) || | 918 | !tomoyo_print_number_union(head, &ptr->mode) || |
919 | !tomoyo_print_number_union(head, &ptr->major) || | 919 | !tomoyo_print_number_union(head, &ptr->major) || |
@@ -984,11 +984,11 @@ static bool tomoyo_print_entry(struct tomoyo_io_buffer *head, | |||
984 | head); | 984 | head); |
985 | return tomoyo_print_path_number_acl(head, acl); | 985 | return tomoyo_print_path_number_acl(head, acl); |
986 | } | 986 | } |
987 | if (acl_type == TOMOYO_TYPE_PATH_NUMBER3_ACL) { | 987 | if (acl_type == TOMOYO_TYPE_MKDEV_ACL) { |
988 | struct tomoyo_path_number3_acl *acl | 988 | struct tomoyo_mkdev_acl *acl |
989 | = container_of(ptr, struct tomoyo_path_number3_acl, | 989 | = container_of(ptr, struct tomoyo_mkdev_acl, |
990 | head); | 990 | head); |
991 | return tomoyo_print_path_number3_acl(head, acl); | 991 | return tomoyo_print_mkdev_acl(head, acl); |
992 | } | 992 | } |
993 | if (acl_type == TOMOYO_TYPE_MOUNT_ACL) { | 993 | if (acl_type == TOMOYO_TYPE_MOUNT_ACL) { |
994 | struct tomoyo_mount_acl *acl | 994 | struct tomoyo_mount_acl *acl |
@@ -1910,7 +1910,7 @@ int tomoyo_write_control(struct file *file, const char __user *buffer, | |||
1910 | /* Don't allow updating policies by non manager programs. */ | 1910 | /* Don't allow updating policies by non manager programs. */ |
1911 | if (head->write != tomoyo_write_pid && | 1911 | if (head->write != tomoyo_write_pid && |
1912 | head->write != tomoyo_write_domain_policy && | 1912 | head->write != tomoyo_write_domain_policy && |
1913 | !tomoyo_is_policy_manager()) | 1913 | !tomoyo_policy_manager()) |
1914 | return -EPERM; | 1914 | return -EPERM; |
1915 | if (mutex_lock_interruptible(&head->io_sem)) | 1915 | if (mutex_lock_interruptible(&head->io_sem)) |
1916 | return -EINTR; | 1916 | return -EINTR; |