-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 This patch looks good to me. acked. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk/I+PcACgkQrlYvE4MpobOvnQCfYC3/9djh9PC6jFQCAp/fB2SK ylsAnjeEEgsSoYcBEwPfNUq7tULJgvi2 =+Iti -----END PGP SIGNATURE-----
>From 821e0f204fbf5b47ba60e746ae8391d57f2c7625 Mon Sep 17 00:00:00 2001 From: Dan Walsh <dwalsh@xxxxxxxxxx> Date: Tue, 3 Apr 2012 18:56:20 -0400 Subject: [PATCH 36/90] checkpolicy: sepolgen: We need to support files that have a + in them Filenames can have a +, so we should be able to parse and handle those files. Signed-off-by: Eric Paris <eparis@xxxxxxxxxx> --- checkpolicy/policy_scan.l | 2 +- sepolgen/src/sepolgen/refparser.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/checkpolicy/policy_scan.l b/checkpolicy/policy_scan.l index e767b5f..143e797 100644 --- a/checkpolicy/policy_scan.l +++ b/checkpolicy/policy_scan.l @@ -234,7 +234,7 @@ HIGH { return(HIGH); } low | LOW { return(LOW); } "/"({alnum}|[_\.\-/])* { return(PATH); } -\"({alnum}|[_\.\-\~])+\" { return(FILENAME); } +\"({alnum}|[_\.\-\+\~])+\" { return(FILENAME); } {letter}({alnum}|[_\-])*([\.]?({alnum}|[_\-]))* { return(IDENTIFIER); } {alnum}*{letter}{alnum}* { return(FILESYSTEM); } {digit}+|0x{hexval}+ { return(NUMBER); } diff --git a/sepolgen/src/sepolgen/refparser.py b/sepolgen/src/sepolgen/refparser.py index 9a79340..a4adbd8 100644 --- a/sepolgen/src/sepolgen/refparser.py +++ b/sepolgen/src/sepolgen/refparser.py @@ -245,7 +245,7 @@ def t_refpolicywarn(t): t.lexer.lineno += 1 def t_IDENTIFIER(t): - r'[a-zA-Z_\$\"][a-zA-Z0-9_\-\.\$\*\"~]*' + r'[a-zA-Z_\$\"][a-zA-Z0-9_\-\+\.\$\*\"~]*' # Handle any keywords t.type = reserved.get(t.value,'IDENTIFIER') return t -- 1.7.10.2