History log of /external/selinux/sepolgen/src/sepolgen/refparser.py
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
90cff8243e69f6c30f598ee94447b017a7dd1739 24-Oct-2015 Nicolas Iooss <nicolas.iooss@m4x.org> sepolgen: Reset line numbers when parsing files

When running sepolgen-ifgen on refpolicy (git master branch), the
following messages show up:

/usr/share/selinux/refpolicy/include/kernel/selinux.if: Syntax error
on line 3369 gen_context [type=GEN_CONTEXT]
/usr/share/selinux/refpolicy/include/system/init.if: Syntax error on
line 188379 ' [type=SQUOTE]
/usr/share/selinux/refpolicy/include/system/init.if: Syntax error on
line 188385 ' [type=SQUOTE]

The line numbers are incorrect because the lineno member of the lexer
object is not resetted after each file has been processed. After fixing
this, the messages are nicer:

/usr/share/selinux/refpolicy/include/kernel/selinux.if: Syntax error
on line 43 gen_context [type=GEN_CONTEXT]
/usr/share/selinux/refpolicy/include/system/init.if: Syntax error on
line 1416 ' [type=SQUOTE]
/usr/share/selinux/refpolicy/include/system/init.if: Syntax error on
line 1422 ' [type=SQUOTE]

As line 43 of kernel/selinux.if contains a genfscon statement with a
gen_context component, the reported line numbers are now correct.

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
/external/selinux/sepolgen/src/sepolgen/refparser.py
15a7553d2274a351fb1098f7bfab86346c5a04b8 16-Jul-2015 Robert Kuska <rkuska@redhat.com> sepolgen: Apply fixes discovered by 2to3 where needed.

Replace usage of print statement with print function.
Use `in` instead of `has_key` when checking for key in dict.
When using `raise` add text (if any) as parameter of exception function.
Add Python3 imports of moved modules.
Replace `map` with list comprehension.
Use reserved word `as` in try-except when catching exception.
Replace `ifilter` function with `filter`.

Signed-off-by: Robert Kuska <rkuska@redhat.com>
/external/selinux/sepolgen/src/sepolgen/refparser.py
fd00e882c4886124008cf473e4a9af1dd7a93b68 16-Jul-2015 Robert Kuska <rkuska@redhat.com> sepolgen: Use relative imports for modules within sepolgen.

Python 3 changes the syntax for imports from within a package,
requiring you to use the relative import syntax,
saying from . import mymodule instead of the just import mymodule.

Signed-off-by: Robert Kuska <rkuska@redhat.com>
/external/selinux/sepolgen/src/sepolgen/refparser.py
f0290677091e7eee4a3724a2a86ede9e11f93802 17-Mar-2015 Daniel De Graaf <dgdegra@tycho.nsa.gov> libsepol, checkpolicy: add device tree ocontext nodes to Xen policy

In Xen on ARM, device tree nodes identified by a path (string) need to
be labeled by the security policy.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
/external/selinux/sepolgen/src/sepolgen/refparser.py
8b4fb2d2dee3664d9c736915d79e2166f41843eb 26-Aug-2014 Steve Lawrence <slawrence@tresys.com> sepolgen: remove unnecessary grammar in interface call param list

The addition of this rule caused interface vectors to be less accurate.
The grammar looks correct without the rule, so remove it.

Reverted hunk from commit 17cc87e56b0241688c119f774f103622b002e0ae

Signed-off-by: Steve Lawrence <slawrence@tresys.com>
/external/selinux/sepolgen/src/sepolgen/refparser.py
17cc87e56b0241688c119f774f103622b002e0ae 09-Oct-2013 Dan Walsh <dwalsh@redhat.com> sepolgen did not work with filename transitions.

This patch adds support for it.
/external/selinux/sepolgen/src/sepolgen/refparser.py
3dd13f7d0859b3f8b97700f5c24651af4807af49 09-Jan-2013 Miroslav Grepl <mgrepl@redhat.com> sepolgen: understand role attributes

Parse and handle role attributes in sepolgen.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
/external/selinux/sepolgen/src/sepolgen/refparser.py
0eed03e7561a979dfd29201180a201a911ac51a6 04-Apr-2012 Dan Walsh <dwalsh@redhat.com> 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>
/external/selinux/sepolgen/src/sepolgen/refparser.py
a0af38a531788d2ffc4fd1c03c38fb66c3a61c17 16-Nov-2011 Dan Walsh <dwalsh@redhat.com> sepolgen: Allow ~ as a file identifier

We already allow this in policy, so allow it in sepolgen as well.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
/external/selinux/sepolgen/src/sepolgen/refparser.py
9cbd404ceb6c87483a4b8b2718b8d9ed8e4e6b56 30-Sep-2011 Dan Walsh <dwalsh@redhat.com> sepolgen: Ignore permissive qualifier if found in an interface

During Rawhide releases we change all "unconfined_domains" to
permissive domains in order to find new AVC messages without breaking
rawhide boxes. The way we do this is changing the unconfined_domain
interface and putting permissive $1; in it. sepolgen does not like
this and blows up the build. This patch tells sepolgen to ignore the
permissive in an interface.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
/external/selinux/sepolgen/src/sepolgen/refparser.py
3f1446944eef99734bf4caef093b7fc1de51c747 26-Aug-2011 Eric Paris <eparis@redhat.com> sepolgen: refparser: include open among valid permissions

The perser doesn't recognize 'open'. Make it so.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
/external/selinux/sepolgen/src/sepolgen/refparser.py
de311acdc976f8a8ec186d99181782e56b12b454 26-Aug-2011 Eric Paris <eparis@redhat.com> sepolgen: refparser: add support for filename_trans rules

The parser cannot handle the new format of filename_trans rules. Nor
can it handle the " now used. Add support for both.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
/external/selinux/sepolgen/src/sepolgen/refparser.py
52f9d9f2ad3225e44f9fd55722b49231f060e2f3 12-Mar-2010 Karl MacMillan <karlwmacmillan@gmail.com> Sepolgen: improve parser error recovery

Sepolgen has long not recovered from parsing errors, leading to
a blacklist of none bad modules in the source. I finally tracked
down the problem (lexer state) and this patch fixes the problem
by causing the lexer to be rebuilt on error.

Acked-by: Joshua Brindle <jbrindle@tresys.com>
/external/selinux/sepolgen/src/sepolgen/refparser.py
6341f6a4926b46f36ba9a05736460da53bd95557 15-Sep-2009 pjnuzzi <pjnuzzi@tycho.ncsc.mil> sepolgen: Add support for multiple target OSes

Add support to sepolgen for new Xen ocontext identifiers.

Signed-off-by: Paul Nuzzi <pjnuzzi@tycho.ncsc.mil>
Signed-off-by: Joshua Brindle <method@manicmethod.com>
/external/selinux/sepolgen/src/sepolgen/refparser.py
13cd4c8960688af11ad23b4c946149015c80d549 19-Aug-2008 Joshua Brindle <method@manicmethod.com> initial import from svn trunk revision 2950
/external/selinux/sepolgen/src/sepolgen/refparser.py