SELinuxProject/selint

Error handling M4 ifelse

Closed this issue · 1 comments

2021-05-07T15:14:58.0933714Z systemd.if:        1731: (F): syntax error, unexpected COMMA, expecting STRING or BACKTICK (F-001)
2021-05-07T15:14:58.0934589Z  1731 |     ifelse(`$2',,, `
2021-05-07T15:14:58.0934964Z       |                 ^
2021-05-07T15:14:58.0935633Z systemd.if:        1731: (F): Error: Invalid statement (F-001)
2021-05-07T15:14:58.0936284Z  1731 |     ifelse(`$2',,, `
2021-05-07T15:14:58.0936640Z       |     ^~~~~~~~~~~~~
2021-05-07T15:14:58.0937060Z Error: Failed to parse files

I'm not clear but it may also not like the ,,, which means 2 empty parameters (empty strings) followed by quoted string parameter.

Original refpolicy build log

The solution in #204 allows empty m4 arguments.

As a workaround

ifelse(`$1',`',`', `
    refpolicywarn(`dollar one defined')
')

should work.