selinux/sepolgen
Nicolas Iooss 90cff8243e 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>
2015-10-27 13:28:18 -04:00
..
src sepolgen: Reset line numbers when parsing files 2015-10-27 13:28:18 -04:00
tests sepolgen: Edit tests so they pass even on Python3 where hash is random. 2015-07-16 13:06:03 -04:00
ChangeLog Updated sepolgen ChangeLog. 2015-08-05 15:16:18 -04:00
COPYING initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
HACKING checkpolicy: libselinux: Fix dead links to www.nsa.gov/selinux 2012-03-28 08:39:07 -04:00
Makefile initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
VERSION Bump to final release 2015-02-02 09:38:10 -05:00