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

qm.if: fix syntax errors #478

Merged
merged 1 commit into from
Jul 4, 2024
Merged

qm.if: fix syntax errors #478

merged 1 commit into from
Jul 4, 2024

Conversation

aesteve-rh
Copy link
Collaborator

Fix syntax errors when running sepolgen-ifgen:

/usr/share/selinux/devel/include/services/qm.if: Syntax error on line 398 ) [type=CPAREN]
/usr/share/selinux/devel/include/services/qm.if: Syntax error on line 399 ) [type=CPAREN]
/usr/share/selinux/devel/include/services/qm.if: Syntax error on line 400 ) [type=CPAREN]
/usr/share/selinux/devel/include/services/qm.if: Syntax error on line 558 ' [type=SQUOTE]
/usr/share/selinux/devel/include/services/qm.if: Syntax error on line 621 ) [type=CPAREN]
/usr/share/selinux/devel/include/services/qm.if: Syntax error on line 622 ) [type=CPAREN]
/usr/share/selinux/devel/include/services/qm.if: Syntax error on line 623 ) [type=CPAREN]

Fix syntax errors when running sepolgen-ifgen:
```
/usr/share/selinux/devel/include/services/qm.if: Syntax error on line 398 ) [type=CPAREN]
/usr/share/selinux/devel/include/services/qm.if: Syntax error on line 399 ) [type=CPAREN]
/usr/share/selinux/devel/include/services/qm.if: Syntax error on line 400 ) [type=CPAREN]
/usr/share/selinux/devel/include/services/qm.if: Syntax error on line 558 ' [type=SQUOTE]
/usr/share/selinux/devel/include/services/qm.if: Syntax error on line 621 ) [type=CPAREN]
/usr/share/selinux/devel/include/services/qm.if: Syntax error on line 622 ) [type=CPAREN]
/usr/share/selinux/devel/include/services/qm.if: Syntax error on line 623 ) [type=CPAREN]
```

Signed-off-by: Albert Esteve <[email protected]>
Copy link
Collaborator

@Yarboa Yarboa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Yarboa Yarboa merged commit 460c4b5 into containers:main Jul 4, 2024
7 checks passed
@aesteve-rh aesteve-rh deleted the fix-syntax branch July 4, 2024 08:01
@aesteve-rh
Copy link
Collaborator Author

@Yarboa it may be nice to have a syntax checker in the pipelines to prevent future issues. Not sure if there is one such tool, but I assume there must be?

@sandrobonazzola
Copy link
Collaborator

@aesteve-rh , @Yarboa here's the tool: https://github.com/SELinuxProject/selint ; would be great if it can be just added to pre-commit hooks :-)

@sandrobonazzola
Copy link
Collaborator

After giving it a try, not sure selint can be used, it tests the whole selinux system, not just the file itself.
On my F40:

$ selint qm.if 
Note: Check E-007 is not performed because no permission macro has been parsed.
/usr/share/selinux/devel/include/contrib/virt.if:169: (F): syntax error, unexpected UNKNOWN_TOKEN (F-001)
  169 |     filetrans_pattern($1, virt_var_run_t, virtinterfaced_var_run_t, dir, "``interface''")
      |                                                                          ^
/usr/share/selinux/devel/include/contrib/virt.if:169: (F): Error: Invalid statement (F-001)
  169 |     filetrans_pattern($1, virt_var_run_t, virtinterfaced_var_run_t, dir, "``interface''")
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: Failed to parse files

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

Successfully merging this pull request may close these issues.

3 participants