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

Backport fix for AttributeError: 'Comment' object has no attribute 'gen_cil' #68

Open
maage opened this issue Jan 19, 2025 · 0 comments

Comments

@maage
Copy link
Contributor

maage commented Jan 19, 2025

Upstream has:

SELinuxProject/selinux@b6910aa

And in
policycoreutils-python-utils-3.7-6.fc41.noarch

if you have same audit violations, you will get:

$ sudo audit2allow -al -e
Traceback (most recent call last):
  File "/usr/bin/audit2allow", line 399, in <module>
    app.main()
    ~~~~~~~~^^
  File "/usr/bin/audit2allow", line 387, in main
    self.__output()
    ~~~~~~~~~~~~~^^
  File "/usr/bin/audit2allow", line 353, in __output
    g.add_access(self.__avs)
    ~~~~~~~~~~~~^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/sepolgen/policygen.py", line 255, in add_access
    self.__add_av_rule(av)
    ~~~~~~~~~~~~~~~~~~^^^^
  File "/usr/lib/python3.13/site-packages/sepolgen/policygen.py", line 182, in __add_av_rule
    rule.comment = str(refpolicy.Comment(explain_access(av, verbosity=self.explain)))
                   ~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/sepolgen/refpolicy.py", line 1242, in __str__
    return self.to_string()
           ~~~~~~~~~~~~~~^^
  File "/usr/lib/python3.13/site-packages/sepolgen/refpolicy.py", line 1229, in to_string
    if self.gen_cil:
       ^^^^^^^^^^^^
AttributeError: 'Comment' object has no attribute 'gen_cil'

Please backport the commit from upstream.

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

1 participant