aboutsummaryrefslogtreecommitdiffstats
path: root/security/tomoyo/domain.c
diff options
context:
space:
mode:
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>2009-06-02 07:42:24 -0400
committerJames Morris <jmorris@namei.org>2009-06-02 17:51:51 -0400
commit7d2948b1248109dbc7f4aaf9867c54b1912d494c (patch)
tree24edc8fa319598bc32b7d53c7b61fb3ec9ae9e92 /security/tomoyo/domain.c
parentab588ccadc80f6ef5495e83e176e88c5c0fc2d0e (diff)
TOMOYO: Simplify policy reader.
We can directly assign the result of tomoyo_io_printf() to done flag. Signed-off-by: Kentaro Takeda <takedakn@nttdata.co.jp> Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Signed-off-by: Toshiharu Harada <haradats@nttdata.co.jp> Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security/tomoyo/domain.c')
-rw-r--r--security/tomoyo/domain.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/security/tomoyo/domain.c b/security/tomoyo/domain.c
index aa119ca5a782..34bb641c6743 100644
--- a/security/tomoyo/domain.c
+++ b/security/tomoyo/domain.c
@@ -189,13 +189,12 @@ bool tomoyo_read_domain_initializer_policy(struct tomoyo_io_buffer *head)
189 from = " from "; 189 from = " from ";
190 domain = ptr->domainname->name; 190 domain = ptr->domainname->name;
191 } 191 }
192 if (!tomoyo_io_printf(head, 192 done = tomoyo_io_printf(head,
193 "%s" TOMOYO_KEYWORD_INITIALIZE_DOMAIN 193 "%s" TOMOYO_KEYWORD_INITIALIZE_DOMAIN
194 "%s%s%s\n", no, ptr->program->name, from, 194 "%s%s%s\n", no, ptr->program->name,
195 domain)) { 195 from, domain);
196 done = false; 196 if (!done)
197 break; 197 break;
198 }
199 } 198 }
200 up_read(&tomoyo_domain_initializer_list_lock); 199 up_read(&tomoyo_domain_initializer_list_lock);
201 return done; 200 return done;
@@ -387,13 +386,12 @@ bool tomoyo_read_domain_keeper_policy(struct tomoyo_io_buffer *head)
387 from = " from "; 386 from = " from ";
388 program = ptr->program->name; 387 program = ptr->program->name;
389 } 388 }
390 if (!tomoyo_io_printf(head, 389 done = tomoyo_io_printf(head,
391 "%s" TOMOYO_KEYWORD_KEEP_DOMAIN 390 "%s" TOMOYO_KEYWORD_KEEP_DOMAIN
392 "%s%s%s\n", no, program, from, 391 "%s%s%s\n", no, program, from,
393 ptr->domainname->name)) { 392 ptr->domainname->name);
394 done = false; 393 if (!done)
395 break; 394 break;
396 }
397 } 395 }
398 up_read(&tomoyo_domain_keeper_list_lock); 396 up_read(&tomoyo_domain_keeper_list_lock);
399 return done; 397 return done;
@@ -513,12 +511,11 @@ bool tomoyo_read_alias_policy(struct tomoyo_io_buffer *head)
513 ptr = list_entry(pos, struct tomoyo_alias_entry, list); 511 ptr = list_entry(pos, struct tomoyo_alias_entry, list);
514 if (ptr->is_deleted) 512 if (ptr->is_deleted)
515 continue; 513 continue;
516 if (!tomoyo_io_printf(head, TOMOYO_KEYWORD_ALIAS "%s %s\n", 514 done = tomoyo_io_printf(head, TOMOYO_KEYWORD_ALIAS "%s %s\n",
517 ptr->original_name->name, 515 ptr->original_name->name,
518 ptr->aliased_name->name)) { 516 ptr->aliased_name->name);
519 done = false; 517 if (!done)
520 break; 518 break;
521 }
522 } 519 }
523 up_read(&tomoyo_alias_list_lock); 520 up_read(&tomoyo_alias_list_lock);
524 return done; 521 return done;