Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sepolgen-ifgen parsing error. #362

Open
ayushman4 opened this issue Jul 8, 2022 · 4 comments
Open

sepolgen-ifgen parsing error. #362

ayushman4 opened this issue Jul 8, 2022 · 4 comments

Comments

@ayushman4
Copy link

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
Copy link
Contributor

cgzones commented Jul 8, 2022

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

Is seems 302443c should have fixed your issue, which is included in version 2.5 (23 Feb 2016).

@freedom1b2830
Copy link

link with SELinuxProject/refpolicy#565

@freedom1b2830
Copy link

@cgzone selinux-python 3.4 too

@cgzones
Copy link
Contributor

cgzones commented Feb 3, 2023

There seems to be multiple issues:

  • The refparser does not support ifelse statements
  • The refparser does not support excluded types (e.g. -type1) as interface arguments
  • The refparser does not support file type specifiers in genfscon statements
  • The refparser does not support the unquoted usage of true/false in gen_tunable statements
  • The reference policy uses true as ifdef argument, which is a reserved identifier in the refparser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants