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@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
This commit is contained in:
Dan Walsh 2012-04-03 18:56:20 -04:00 committed by Eric Paris
parent 0ea11e7315
commit 0eed03e756
2 changed files with 2 additions and 2 deletions

View File

@ -234,7 +234,7 @@ HIGH { return(HIGH); }
low | low |
LOW { return(LOW); } LOW { return(LOW); }
"/"({alnum}|[_\.\-/])* { return(PATH); } "/"({alnum}|[_\.\-/])* { return(PATH); }
\"({alnum}|[_\.\-\~])+\" { return(FILENAME); } \"({alnum}|[_\.\-\+\~])+\" { return(FILENAME); }
{letter}({alnum}|[_\-])*([\.]?({alnum}|[_\-]))* { return(IDENTIFIER); } {letter}({alnum}|[_\-])*([\.]?({alnum}|[_\-]))* { return(IDENTIFIER); }
{alnum}*{letter}{alnum}* { return(FILESYSTEM); } {alnum}*{letter}{alnum}* { return(FILESYSTEM); }
{digit}+|0x{hexval}+ { return(NUMBER); } {digit}+|0x{hexval}+ { return(NUMBER); }

View File

@ -245,7 +245,7 @@ def t_refpolicywarn(t):
t.lexer.lineno += 1 t.lexer.lineno += 1
def t_IDENTIFIER(t): def t_IDENTIFIER(t):
r'[a-zA-Z_\$\"][a-zA-Z0-9_\-\.\$\*\"~]*' r'[a-zA-Z_\$\"][a-zA-Z0-9_\-\+\.\$\*\"~]*'
# Handle any keywords # Handle any keywords
t.type = reserved.get(t.value,'IDENTIFIER') t.type = reserved.get(t.value,'IDENTIFIER')
return t return t