diff options
author | Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> | 2009-06-02 07:42:24 -0400 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2009-06-02 17:51:51 -0400 |
commit | 7d2948b1248109dbc7f4aaf9867c54b1912d494c (patch) | |
tree | 24edc8fa319598bc32b7d53c7b61fb3ec9ae9e92 /security/tomoyo/file.c | |
parent | ab588ccadc80f6ef5495e83e176e88c5c0fc2d0e (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/file.c')
-rw-r--r-- | security/tomoyo/file.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/security/tomoyo/file.c b/security/tomoyo/file.c index adf786d7421d..a67f9e61ee60 100644 --- a/security/tomoyo/file.c +++ b/security/tomoyo/file.c | |||
@@ -247,11 +247,10 @@ bool tomoyo_read_globally_readable_policy(struct tomoyo_io_buffer *head) | |||
247 | list); | 247 | list); |
248 | if (ptr->is_deleted) | 248 | if (ptr->is_deleted) |
249 | continue; | 249 | continue; |
250 | if (!tomoyo_io_printf(head, TOMOYO_KEYWORD_ALLOW_READ "%s\n", | 250 | done = tomoyo_io_printf(head, TOMOYO_KEYWORD_ALLOW_READ "%s\n", |
251 | ptr->filename->name)) { | 251 | ptr->filename->name); |
252 | done = false; | 252 | if (!done) |
253 | break; | 253 | break; |
254 | } | ||
255 | } | 254 | } |
256 | up_read(&tomoyo_globally_readable_list_lock); | 255 | up_read(&tomoyo_globally_readable_list_lock); |
257 | return done; | 256 | return done; |
@@ -369,11 +368,10 @@ bool tomoyo_read_file_pattern(struct tomoyo_io_buffer *head) | |||
369 | ptr = list_entry(pos, struct tomoyo_pattern_entry, list); | 368 | ptr = list_entry(pos, struct tomoyo_pattern_entry, list); |
370 | if (ptr->is_deleted) | 369 | if (ptr->is_deleted) |
371 | continue; | 370 | continue; |
372 | if (!tomoyo_io_printf(head, TOMOYO_KEYWORD_FILE_PATTERN "%s\n", | 371 | done = tomoyo_io_printf(head, TOMOYO_KEYWORD_FILE_PATTERN |
373 | ptr->pattern->name)) { | 372 | "%s\n", ptr->pattern->name); |
374 | done = false; | 373 | if (!done) |
375 | break; | 374 | break; |
376 | } | ||
377 | } | 375 | } |
378 | up_read(&tomoyo_pattern_list_lock); | 376 | up_read(&tomoyo_pattern_list_lock); |
379 | return done; | 377 | return done; |
@@ -483,11 +481,10 @@ bool tomoyo_read_no_rewrite_policy(struct tomoyo_io_buffer *head) | |||
483 | ptr = list_entry(pos, struct tomoyo_no_rewrite_entry, list); | 481 | ptr = list_entry(pos, struct tomoyo_no_rewrite_entry, list); |
484 | if (ptr->is_deleted) | 482 | if (ptr->is_deleted) |
485 | continue; | 483 | continue; |
486 | if (!tomoyo_io_printf(head, TOMOYO_KEYWORD_DENY_REWRITE "%s\n", | 484 | done = tomoyo_io_printf(head, TOMOYO_KEYWORD_DENY_REWRITE |
487 | ptr->pattern->name)) { | 485 | "%s\n", ptr->pattern->name); |
488 | done = false; | 486 | if (!done) |
489 | break; | 487 | break; |
490 | } | ||
491 | } | 488 | } |
492 | up_read(&tomoyo_no_rewrite_list_lock); | 489 | up_read(&tomoyo_no_rewrite_list_lock); |
493 | return done; | 490 | return done; |