2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-22 10:07:12 +00:00

parser: Fix parsing of arrow “px -> …”

The parser failed to read the profile name after the the arrow. Rules with
`-> foo-bar;` failed with “Found unexpected character: '-'”. Rules with
`-> @{tgt};` compiled fine, but failed at runtime with “profile transition
not found”.

The patch was written by sbeattie and published on
https://paste.ubuntu.com/p/tzxxmVwGJ8/

https://matrix.to/#/!pNJIrowvqsuGgjXsEY:matrix.org/$15477566201815716pmube:matrix.org?via=matrix.org&via=alea.gnuu.de
PR: https://gitlab.com/apparmor/apparmor/merge_requests/334
(cherry picked from commit 0e0663e99e993e578e6092b5907fcbe5ae8988b1)
Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
Jörg Sommer 2019-02-02 21:51:05 +01:00 committed by John Johansen
parent 5a2db81f93
commit f1bca36c18

View File

@ -597,7 +597,7 @@ include/{WS} {
{CARET} { PUSH_AND_RETURN(SUB_ID, TOK_CARET); }
{ARROW} { RETURN_TOKEN(TOK_ARROW); }
{ARROW} { PUSH_AND_RETURN(SUB_ID_WS, TOK_ARROW); }
{EQUALS} { PUSH_AND_RETURN(ASSIGN_MODE, TOK_EQUALS); }