Skip to content

Commit

Permalink
TOMOYO: Fix incomplete read of /sys/kernel/security/tomoyo/profile
Browse files Browse the repository at this point in the history
Commit bd03a3e "TOMOYO: Add policy namespace support." forgot to set EOF flag
and forgot to print namespace at PREFERENCE line.

Signed-off-by: Tetsuo Handa <[email protected]>
Signed-off-by: James Morris <[email protected]>
  • Loading branch information
Tetsuo Handa authored and James Morris committed Aug 8, 2011
1 parent 322a8b0 commit 4d81897
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion security/tomoyo/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -710,8 +710,10 @@ static void tomoyo_read_profile(struct tomoyo_io_buffer *head)
head->r.index++)
if (ns->profile_ptr[head->r.index])
break;
if (head->r.index == TOMOYO_MAX_PROFILES)
if (head->r.index == TOMOYO_MAX_PROFILES) {
head->r.eof = true;
return;
}
head->r.step++;
break;
case 2:
Expand All @@ -723,6 +725,7 @@ static void tomoyo_read_profile(struct tomoyo_io_buffer *head)
tomoyo_io_printf(head, "%u-COMMENT=", index);
tomoyo_set_string(head, comment ? comment->name : "");
tomoyo_set_lf(head);
tomoyo_print_namespace(head);
tomoyo_io_printf(head, "%u-PREFERENCE={ ", index);
for (i = 0; i < TOMOYO_MAX_PREF; i++)
tomoyo_io_printf(head, "%s=%u ",
Expand Down

0 comments on commit 4d81897

Please sign in to comment.