From f1bca36c18eaf08e75cd18f31027180ecbc49273 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Sommer?= Date: Sat, 2 Feb 2019 21:51:05 +0100 Subject: [PATCH] =?UTF-8?q?parser:=20Fix=20parsing=20of=20arrow=20?= =?UTF-8?q?=E2=80=9Cpx=20->=20=E2=80=A6=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- parser/parser_lex.l | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parser/parser_lex.l b/parser/parser_lex.l index 77e5a8da6..d51def1b4 100644 --- a/parser/parser_lex.l +++ b/parser/parser_lex.l @@ -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); }