SELinuxProject / selinux

This is the upstream repository for the Security Enhanced Linux (SELinux) userland libraries and tools. The software provided by this project complements the SELinux features integrated into the Linux kernel and is used by Linux distributions. All bugs and patches should be submitted to selinux@vger.kernel.org
Other
1.35k stars 360 forks source link

sepolgen-ifgen parsing error. #362

Open ayushman4 opened 2 years ago

ayushman4 commented 2 years ago

While do "make build-interface-db" I get the following parsing errors

The parsing errors are related to sepolgen-ifgen. Can someone let me know what is going wrong. I am using the policy files from here - https://github.com/SELinuxProject/refpolicy

##############/usr/share/selinux/refpolicy/include/kernel/selinux.if: Syntax error on line 43 - [type=MINUS] error parsing file /usr/share/selinux/refpolicy/include/kernel/selinux.if: could not parse text: "/usr/share/selinux/refpolicy/include/kernel/selinux.if: Syntax error on line 43 - [type=MINUS]" ############################/usr/share/selinux/refpolicy/include/services/ssh.if: Syntax error on line 183 $1_port_forwarding [type=IDENTIFIER] /usr/share/selinux/refpolicy/include/services/ssh.if: Syntax error on line 294 ' [type=SQUOTE] error parsing file /usr/share/selinux/refpolicy/include/services/ssh.if: could not parse text: "/usr/share/selinux/refpolicy/include/services/ssh.if: Syntax error on line 294 ' [type=SQUOTE]"

/usr/share/selinux/refpolicy/include/system/init.if: Syntax error on line 2164 true [type=TRUE]

/usr/share/selinux/refpolicy/include/system/init.if: Syntax error on line 2175 ' [type=SQUOTE] /usr/share/selinux/refpolicy/include/system/init.if: Syntax error on line 2179 ' [type=SQUOTE] /usr/share/selinux/refpolicy/include/system/init.if: Syntax error on line 2190 ' [type=SQUOTE] /usr/share/selinux/refpolicy/include/system/init.if: Syntax error on line 2194 ' [type=SQUOTE] error parsing file /usr/share/selinux/refpolicy/include/system/init.if: could not parse text: "/usr/share/selinux/refpolicy/include/system/init.if: Syntax error on line 2194 ' [type=SQUOTE]"

failed to parse some headers: /usr/share/selinux/refpolicy/include/kernel/selinux.if, /usr/share/selinux/refpolicy/include/services/ssh.if, /usr/share/selinux/refpolicy/include/system/init.if

cgzones commented 2 years ago

What version of sepolgen (or in general SELinux userspace) are you using?

Is seems https://github.com/SELinuxProject/selinux/commit/302443cbbb506ac9010a6f798115e0ef513a1550 should have fixed your issue, which is included in version 2.5 (23 Feb 2016).

freedom1b2830 commented 1 year ago

link with https://github.com/SELinuxProject/refpolicy/issues/565

freedom1b2830 commented 1 year ago

@cgzone selinux-python 3.4 too

cgzones commented 1 year ago

There seems to be multiple issues: