2023-08-02 12:12:18

by Russell Coker

[permalink] [raw]
Subject: syntax errors from sepolgen-ifgen

/usr/share/selinux/devel/include/system/init.if: Syntax error on line 2064
true [type=TRUE]
/usr/share/selinux/devel/include/system/init.if: Syntax error on line 2075 '
[type=SQUOTE]
/usr/share/selinux/devel/include/system/init.if: Syntax error on line 2079 '
[type=SQUOTE]
/usr/share/selinux/devel/include/system/init.if: Syntax error on line 2090 '
[type=SQUOTE]
/usr/share/selinux/devel/include/system/init.if: Syntax error on line 2094 '
[type=SQUOTE]
/usr/share/selinux/devel/include/kernel/kernel.if: Syntax error on line 1737 -
[type=MINUS]
/usr/share/selinux/devel/include/kernel/kernel.if: Syntax error on line 1755 -
[type=MINUS]

I see the above errors when I run sepolgen-ifgen.


interface(`init_startstop_service',`
ifelse(`init_systemd',`true',`
# This ifelse condition is temporary, until
# all callers are updated to provide unit files.
ifelse(`$5',`',`',`
gen_require(`
class service { start status stop };
')

allow $1 $5:service { start status stop };
')

',`distro_gentoo',`true',`
# for OpenRC
seutil_labeled_init_script_run_runinit($1, $2, $4)

',`direct_sysadm_daemon',`true',`
gen_require(`
role system_r;
')


The first 3 are from the above, the init_systemd, distro_gentoo, and
direct_sysadm_daemon macros.

https://www.gnu.org/software/m4/manual/html_node/Ifelse.html

According to the above web page we shouldn't have quotes around those macros
to allow expansion. But removing them gives the following errors:

/usr/share/selinux/devel/include/system/init.if: Syntax error on line 2064
init_systemd [type=IDENTIFIER]
/usr/share/selinux/devel/include/system/init.if: Syntax error on line 2075 '
[type=SQUOTE]
/usr/share/selinux/devel/include/system/init.if: Syntax error on line 2079 '
[type=SQUOTE]

The errors about type=MINUS are from the the -proc_type in the following:

interface(`kernel_write_non_proc_init_mountpoint_files',`
gen_require(`
attribute proc_type;
')

init_write_mountpoint_files($1, -proc_type)
')


Any suggestions on how to address this? My m4 skills aren't up to this task.

--
My Main Blog http://etbe.coker.com.au/
My Documents Blog http://doc.coker.com.au/