diff options
author | Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> | 2010-06-17 03:54:33 -0400 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2010-08-02 01:34:41 -0400 |
commit | 31845e8c6d3f4f26702e567c667277f9fd1f73a3 (patch) | |
tree | 5c457513fcdae4e7e39b19d36e1698ae298ce8d4 /security/tomoyo/domain.c | |
parent | a230f9e7121cbcbfe23bd5a630abf6b53cece555 (diff) |
TOMOYO: Aggregate reader functions.
Now lists are accessible via array index. Aggregate reader functions using index.
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/domain.c')
-rw-r--r-- | security/tomoyo/domain.c | 140 |
1 files changed, 0 insertions, 140 deletions
diff --git a/security/tomoyo/domain.c b/security/tomoyo/domain.c index 3575b0e7c7fd..038071a8a3d3 100644 --- a/security/tomoyo/domain.c +++ b/security/tomoyo/domain.c | |||
@@ -210,45 +210,6 @@ static int tomoyo_update_domain_initializer_entry(const char *domainname, | |||
210 | } | 210 | } |
211 | 211 | ||
212 | /** | 212 | /** |
213 | * tomoyo_read_domain_initializer_policy - Read "struct tomoyo_domain_initializer_entry" list. | ||
214 | * | ||
215 | * @head: Pointer to "struct tomoyo_io_buffer". | ||
216 | * | ||
217 | * Returns true on success, false otherwise. | ||
218 | * | ||
219 | * Caller holds tomoyo_read_lock(). | ||
220 | */ | ||
221 | bool tomoyo_read_domain_initializer_policy(struct tomoyo_io_buffer *head) | ||
222 | { | ||
223 | struct list_head *pos; | ||
224 | bool done = true; | ||
225 | |||
226 | list_for_each_cookie(pos, head->read_var2, &tomoyo_policy_list | ||
227 | [TOMOYO_ID_DOMAIN_INITIALIZER]) { | ||
228 | const char *no; | ||
229 | const char *from = ""; | ||
230 | const char *domain = ""; | ||
231 | struct tomoyo_domain_initializer_entry *ptr; | ||
232 | ptr = list_entry(pos, struct tomoyo_domain_initializer_entry, | ||
233 | head.list); | ||
234 | if (ptr->head.is_deleted) | ||
235 | continue; | ||
236 | no = ptr->is_not ? "no_" : ""; | ||
237 | if (ptr->domainname) { | ||
238 | from = " from "; | ||
239 | domain = ptr->domainname->name; | ||
240 | } | ||
241 | done = tomoyo_io_printf(head, | ||
242 | "%s" TOMOYO_KEYWORD_INITIALIZE_DOMAIN | ||
243 | "%s%s%s\n", no, ptr->program->name, | ||
244 | from, domain); | ||
245 | if (!done) | ||
246 | break; | ||
247 | } | ||
248 | return done; | ||
249 | } | ||
250 | |||
251 | /** | ||
252 | * tomoyo_write_domain_initializer_policy - Write "struct tomoyo_domain_initializer_entry" list. | 213 | * tomoyo_write_domain_initializer_policy - Write "struct tomoyo_domain_initializer_entry" list. |
253 | * | 214 | * |
254 | * @data: String to parse. | 215 | * @data: String to parse. |
@@ -399,46 +360,6 @@ int tomoyo_write_domain_keeper_policy(char *data, const bool is_not, | |||
399 | } | 360 | } |
400 | 361 | ||
401 | /** | 362 | /** |
402 | * tomoyo_read_domain_keeper_policy - Read "struct tomoyo_domain_keeper_entry" list. | ||
403 | * | ||
404 | * @head: Pointer to "struct tomoyo_io_buffer". | ||
405 | * | ||
406 | * Returns true on success, false otherwise. | ||
407 | * | ||
408 | * Caller holds tomoyo_read_lock(). | ||
409 | */ | ||
410 | bool tomoyo_read_domain_keeper_policy(struct tomoyo_io_buffer *head) | ||
411 | { | ||
412 | struct list_head *pos; | ||
413 | bool done = true; | ||
414 | |||
415 | list_for_each_cookie(pos, head->read_var2, | ||
416 | &tomoyo_policy_list[TOMOYO_ID_DOMAIN_KEEPER]) { | ||
417 | struct tomoyo_domain_keeper_entry *ptr; | ||
418 | const char *no; | ||
419 | const char *from = ""; | ||
420 | const char *program = ""; | ||
421 | |||
422 | ptr = list_entry(pos, struct tomoyo_domain_keeper_entry, | ||
423 | head.list); | ||
424 | if (ptr->head.is_deleted) | ||
425 | continue; | ||
426 | no = ptr->is_not ? "no_" : ""; | ||
427 | if (ptr->program) { | ||
428 | from = " from "; | ||
429 | program = ptr->program->name; | ||
430 | } | ||
431 | done = tomoyo_io_printf(head, | ||
432 | "%s" TOMOYO_KEYWORD_KEEP_DOMAIN | ||
433 | "%s%s%s\n", no, program, from, | ||
434 | ptr->domainname->name); | ||
435 | if (!done) | ||
436 | break; | ||
437 | } | ||
438 | return done; | ||
439 | } | ||
440 | |||
441 | /** | ||
442 | * tomoyo_domain_keeper - Check whether the given program causes domain transition suppression. | 363 | * tomoyo_domain_keeper - Check whether the given program causes domain transition suppression. |
443 | * | 364 | * |
444 | * @domainname: The name of domain. | 365 | * @domainname: The name of domain. |
@@ -527,37 +448,6 @@ static int tomoyo_update_aggregator_entry(const char *original_name, | |||
527 | } | 448 | } |
528 | 449 | ||
529 | /** | 450 | /** |
530 | * tomoyo_read_aggregator_policy - Read "struct tomoyo_aggregator_entry" list. | ||
531 | * | ||
532 | * @head: Pointer to "struct tomoyo_io_buffer". | ||
533 | * | ||
534 | * Returns true on success, false otherwise. | ||
535 | * | ||
536 | * Caller holds tomoyo_read_lock(). | ||
537 | */ | ||
538 | bool tomoyo_read_aggregator_policy(struct tomoyo_io_buffer *head) | ||
539 | { | ||
540 | struct list_head *pos; | ||
541 | bool done = true; | ||
542 | |||
543 | list_for_each_cookie(pos, head->read_var2, | ||
544 | &tomoyo_policy_list[TOMOYO_ID_AGGREGATOR]) { | ||
545 | struct tomoyo_aggregator_entry *ptr; | ||
546 | |||
547 | ptr = list_entry(pos, struct tomoyo_aggregator_entry, | ||
548 | head.list); | ||
549 | if (ptr->head.is_deleted) | ||
550 | continue; | ||
551 | done = tomoyo_io_printf(head, TOMOYO_KEYWORD_AGGREGATOR | ||
552 | "%s %s\n", ptr->original_name->name, | ||
553 | ptr->aggregated_name->name); | ||
554 | if (!done) | ||
555 | break; | ||
556 | } | ||
557 | return done; | ||
558 | } | ||
559 | |||
560 | /** | ||
561 | * tomoyo_write_aggregator_policy - Write "struct tomoyo_aggregator_entry" list. | 451 | * tomoyo_write_aggregator_policy - Write "struct tomoyo_aggregator_entry" list. |
562 | * | 452 | * |
563 | * @data: String to parse. | 453 | * @data: String to parse. |
@@ -624,36 +514,6 @@ static int tomoyo_update_alias_entry(const char *original_name, | |||
624 | } | 514 | } |
625 | 515 | ||
626 | /** | 516 | /** |
627 | * tomoyo_read_alias_policy - Read "struct tomoyo_alias_entry" list. | ||
628 | * | ||
629 | * @head: Pointer to "struct tomoyo_io_buffer". | ||
630 | * | ||
631 | * Returns true on success, false otherwise. | ||
632 | * | ||
633 | * Caller holds tomoyo_read_lock(). | ||
634 | */ | ||
635 | bool tomoyo_read_alias_policy(struct tomoyo_io_buffer *head) | ||
636 | { | ||
637 | struct list_head *pos; | ||
638 | bool done = true; | ||
639 | |||
640 | list_for_each_cookie(pos, head->read_var2, | ||
641 | &tomoyo_policy_list[TOMOYO_ID_ALIAS]) { | ||
642 | struct tomoyo_alias_entry *ptr; | ||
643 | |||
644 | ptr = list_entry(pos, struct tomoyo_alias_entry, head.list); | ||
645 | if (ptr->head.is_deleted) | ||
646 | continue; | ||
647 | done = tomoyo_io_printf(head, TOMOYO_KEYWORD_ALIAS "%s %s\n", | ||
648 | ptr->original_name->name, | ||
649 | ptr->aliased_name->name); | ||
650 | if (!done) | ||
651 | break; | ||
652 | } | ||
653 | return done; | ||
654 | } | ||
655 | |||
656 | /** | ||
657 | * tomoyo_write_alias_policy - Write "struct tomoyo_alias_entry" list. | 517 | * tomoyo_write_alias_policy - Write "struct tomoyo_alias_entry" list. |
658 | * | 518 | * |
659 | * @data: String to parse. | 519 | * @data: String to parse. |