aboutsummaryrefslogtreecommitdiffstats
path: root/security/tomoyo/common.c
diff options
context:
space:
mode:
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>2010-06-14 20:22:42 -0400
committerJames Morris <jmorris@namei.org>2010-08-02 01:34:28 -0400
commit82e0f001a4c1112dcff9cafa9812a33889ad9b8a (patch)
tree55c7e99f8773129b602f837f0c79f8d542021195 /security/tomoyo/common.c
parent237ab459f12cb98eadd3fe7b85343e183a1076a4 (diff)
TOMOYO: Use common structure for list element.
Use common "struct list_head" + "bool" structure. 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.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/security/tomoyo/common.c b/security/tomoyo/common.c
index 6556e5d27d74..7bfad45fcd61 100644
--- a/security/tomoyo/common.c
+++ b/security/tomoyo/common.c
@@ -499,10 +499,10 @@ static int tomoyo_update_manager_entry(const char *manager,
499 return -ENOMEM; 499 return -ENOMEM;
500 if (mutex_lock_interruptible(&tomoyo_policy_lock)) 500 if (mutex_lock_interruptible(&tomoyo_policy_lock))
501 goto out; 501 goto out;
502 list_for_each_entry_rcu(ptr, &tomoyo_policy_manager_list, list) { 502 list_for_each_entry_rcu(ptr, &tomoyo_policy_manager_list, head.list) {
503 if (ptr->manager != e.manager) 503 if (ptr->manager != e.manager)
504 continue; 504 continue;
505 ptr->is_deleted = is_delete; 505 ptr->head.is_deleted = is_delete;
506 error = 0; 506 error = 0;
507 break; 507 break;
508 } 508 }
@@ -510,7 +510,7 @@ static int tomoyo_update_manager_entry(const char *manager,
510 struct tomoyo_policy_manager_entry *entry = 510 struct tomoyo_policy_manager_entry *entry =
511 tomoyo_commit_ok(&e, sizeof(e)); 511 tomoyo_commit_ok(&e, sizeof(e));
512 if (entry) { 512 if (entry) {
513 list_add_tail_rcu(&entry->list, 513 list_add_tail_rcu(&entry->head.list,
514 &tomoyo_policy_manager_list); 514 &tomoyo_policy_manager_list);
515 error = 0; 515 error = 0;
516 } 516 }
@@ -562,8 +562,8 @@ static int tomoyo_read_manager_policy(struct tomoyo_io_buffer *head)
562 &tomoyo_policy_manager_list) { 562 &tomoyo_policy_manager_list) {
563 struct tomoyo_policy_manager_entry *ptr; 563 struct tomoyo_policy_manager_entry *ptr;
564 ptr = list_entry(pos, struct tomoyo_policy_manager_entry, 564 ptr = list_entry(pos, struct tomoyo_policy_manager_entry,
565 list); 565 head.list);
566 if (ptr->is_deleted) 566 if (ptr->head.is_deleted)
567 continue; 567 continue;
568 done = tomoyo_io_printf(head, "%s\n", ptr->manager->name); 568 done = tomoyo_io_printf(head, "%s\n", ptr->manager->name);
569 if (!done) 569 if (!done)
@@ -593,8 +593,8 @@ static bool tomoyo_is_policy_manager(void)
593 return true; 593 return true;
594 if (!tomoyo_manage_by_non_root && (task->cred->uid || task->cred->euid)) 594 if (!tomoyo_manage_by_non_root && (task->cred->uid || task->cred->euid))
595 return false; 595 return false;
596 list_for_each_entry_rcu(ptr, &tomoyo_policy_manager_list, list) { 596 list_for_each_entry_rcu(ptr, &tomoyo_policy_manager_list, head.list) {
597 if (!ptr->is_deleted && ptr->is_domain 597 if (!ptr->head.is_deleted && ptr->is_domain
598 && !tomoyo_pathcmp(domainname, ptr->manager)) { 598 && !tomoyo_pathcmp(domainname, ptr->manager)) {
599 found = true; 599 found = true;
600 break; 600 break;
@@ -605,8 +605,8 @@ static bool tomoyo_is_policy_manager(void)
605 exe = tomoyo_get_exe(); 605 exe = tomoyo_get_exe();
606 if (!exe) 606 if (!exe)
607 return false; 607 return false;
608 list_for_each_entry_rcu(ptr, &tomoyo_policy_manager_list, list) { 608 list_for_each_entry_rcu(ptr, &tomoyo_policy_manager_list, head.list) {
609 if (!ptr->is_deleted && !ptr->is_domain 609 if (!ptr->head.is_deleted && !ptr->is_domain
610 && !strcmp(exe, ptr->manager->name)) { 610 && !strcmp(exe, ptr->manager->name)) {
611 found = true; 611 found = true;
612 break; 612 break;