Message ID | 20220214170855.10603-1-cgzones@googlemail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | b8159f32f07f |
Headers | show |
Series | python/sepolgen: accept square brackets in FILENAME token | expand |
On Mon, Feb 14, 2022 at 4:19 PM Christian Göttsche <cgzones@googlemail.com> wrote: > > When parsing Reference Policy style files accept square brackets in file > names. The FILENAME token is used in the TYPE_TRANSITION grammar rule > for the optional name based argument. This name can contain square > brackets, e.g. for anonymous inodes like "[io_uring]". > > Signed-off-by: Christian Göttsche <cgzones@googlemail.com> Acked-by: James Carter <jwcart2@gmail.com> > --- > added missing signed-off > --- > python/sepolgen/src/sepolgen/refparser.py | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/python/sepolgen/src/sepolgen/refparser.py b/python/sepolgen/src/sepolgen/refparser.py > index e611637f..1bb90564 100644 > --- a/python/sepolgen/src/sepolgen/refparser.py > +++ b/python/sepolgen/src/sepolgen/refparser.py > @@ -261,7 +261,7 @@ def t_IDENTIFIER(t): > return t > > def t_FILENAME(t): > - r'\"[a-zA-Z0-9_\-\+\.\$\*~ :]+\"' > + r'\"[a-zA-Z0-9_\-\+\.\$\*~ :\[\]]+\"' > # Handle any keywords > t.type = reserved.get(t.value,'FILENAME') > return t > -- > 2.34.1 >
On Mon, Feb 28, 2022 at 3:09 PM James Carter <jwcart2@gmail.com> wrote: > > On Mon, Feb 14, 2022 at 4:19 PM Christian Göttsche > <cgzones@googlemail.com> wrote: > > > > When parsing Reference Policy style files accept square brackets in file > > names. The FILENAME token is used in the TYPE_TRANSITION grammar rule > > for the optional name based argument. This name can contain square > > brackets, e.g. for anonymous inodes like "[io_uring]". > > > > Signed-off-by: Christian Göttsche <cgzones@googlemail.com> > > Acked-by: James Carter <jwcart2@gmail.com> > Merged. Thanks, Jim > > --- > > added missing signed-off > > --- > > python/sepolgen/src/sepolgen/refparser.py | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/python/sepolgen/src/sepolgen/refparser.py b/python/sepolgen/src/sepolgen/refparser.py > > index e611637f..1bb90564 100644 > > --- a/python/sepolgen/src/sepolgen/refparser.py > > +++ b/python/sepolgen/src/sepolgen/refparser.py > > @@ -261,7 +261,7 @@ def t_IDENTIFIER(t): > > return t > > > > def t_FILENAME(t): > > - r'\"[a-zA-Z0-9_\-\+\.\$\*~ :]+\"' > > + r'\"[a-zA-Z0-9_\-\+\.\$\*~ :\[\]]+\"' > > # Handle any keywords > > t.type = reserved.get(t.value,'FILENAME') > > return t > > -- > > 2.34.1 > >
diff --git a/python/sepolgen/src/sepolgen/refparser.py b/python/sepolgen/src/sepolgen/refparser.py index e611637f..1bb90564 100644 --- a/python/sepolgen/src/sepolgen/refparser.py +++ b/python/sepolgen/src/sepolgen/refparser.py @@ -261,7 +261,7 @@ def t_IDENTIFIER(t): return t def t_FILENAME(t): - r'\"[a-zA-Z0-9_\-\+\.\$\*~ :]+\"' + r'\"[a-zA-Z0-9_\-\+\.\$\*~ :\[\]]+\"' # Handle any keywords t.type = reserved.get(t.value,'FILENAME') return t
When parsing Reference Policy style files accept square brackets in file names. The FILENAME token is used in the TYPE_TRANSITION grammar rule for the optional name based argument. This name can contain square brackets, e.g. for anonymous inodes like "[io_uring]". Signed-off-by: Christian Göttsche <cgzones@googlemail.com> --- added missing signed-off --- python/sepolgen/src/sepolgen/refparser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)