change_profile's target namespace parsing doesn't work as intended
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
AppArmor |
Fix Released
|
Medium
|
Tyler Hicks |
Bug Description
While modifying the change_profile rule parsing logic, I noticed that the
portion that is intended to parse the target profile's namespace is not working
as intended:
parser/
1525 change_profile: change_profile_head TOK_ARROW opt_ns TOK_ID TOK_END_OF_RULE
1526 {
1527 struct cod_entry *entry;
1528 PDEBUG("Matched change_profile: tok_id (:%s://%s)\n", $3 ? $3 : "", $4);
1529 entry = new_entry($3, $4, AA_CHANGE_PROFILE, $1);
1530 if (!entry)
1531 yyerror(_("Memory allocation error."));
1532 PDEBUG(
1533 $$ = entry;
1534 };
$ echo "/t { change_profile /bin/true -> :ns://profile, }" | ./parser/
...
parser: Matched change_profile: tok_id (:://:ns://profile)
...
You can see from the PDEBUG() output that NULL is being passed as the first
parameter to new_entry(). I've also verified this through other means.
tags: | added: aa-parser |
https:/ /bazaar. launchpad. net/~apparmor- dev/apparmor/ master/ revision/ 3377