aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>2011-08-06 10:38:30 -0400
committerJames Morris <jmorris@namei.org>2011-08-07 23:13:45 -0400
commit4d81897139ffb738ee14b6f84f63f93ecda1136b (patch)
tree27bbf6c03ccc9087e6bdc73b7fed31b471eb8048 /security
parent322a8b034003c0d46d39af85bf24fee27b902f48 (diff)
TOMOYO: Fix incomplete read of /sys/kernel/security/tomoyo/profile
Commit bd03a3e4 "TOMOYO: Add policy namespace support." forgot to set EOF flag and forgot to print namespace at PREFERENCE line. Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security')
-rw-r--r--security/tomoyo/common.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/security/tomoyo/common.c b/security/tomoyo/common.c
index c8439cf2a448..2e43aec1c36b 100644
--- a/security/tomoyo/common.c
+++ b/security/tomoyo/common.c
@@ -710,8 +710,10 @@ static void tomoyo_read_profile(struct tomoyo_io_buffer *head)
710 head->r.index++) 710 head->r.index++)
711 if (ns->profile_ptr[head->r.index]) 711 if (ns->profile_ptr[head->r.index])
712 break; 712 break;
713 if (head->r.index == TOMOYO_MAX_PROFILES) 713 if (head->r.index == TOMOYO_MAX_PROFILES) {
714 head->r.eof = true;
714 return; 715 return;
716 }
715 head->r.step++; 717 head->r.step++;
716 break; 718 break;
717 case 2: 719 case 2:
@@ -723,6 +725,7 @@ static void tomoyo_read_profile(struct tomoyo_io_buffer *head)
723 tomoyo_io_printf(head, "%u-COMMENT=", index); 725 tomoyo_io_printf(head, "%u-COMMENT=", index);
724 tomoyo_set_string(head, comment ? comment->name : ""); 726 tomoyo_set_string(head, comment ? comment->name : "");
725 tomoyo_set_lf(head); 727 tomoyo_set_lf(head);
728 tomoyo_print_namespace(head);
726 tomoyo_io_printf(head, "%u-PREFERENCE={ ", index); 729 tomoyo_io_printf(head, "%u-PREFERENCE={ ", index);
727 for (i = 0; i < TOMOYO_MAX_PREF; i++) 730 for (i = 0; i < TOMOYO_MAX_PREF; i++)
728 tomoyo_io_printf(head, "%s=%u ", 731 tomoyo_io_printf(head, "%s=%u ",