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

create_dirs_from_rpmdb: set SELinux file context of missing directories #86

Merged
merged 3 commits into from
Jul 5, 2022

Conversation

qby-wenzel
Copy link
Contributor

During a t-u package installation, the SELinux RPM plugin handles the
contexts of created elements. The /var directory could be located on a
separate partition, which is not mounted in the tu-env. Therefore the
file contexts are lost in the snapshot and need to be set after boot by
the create_dirs_from_rpmdb service.
Fixes #84

Furthermore the coding style of create_dirs_from_rpmdb was fixed and
a small issue about handling the return code of create_dirs() was fixed, too.

Alexander Wenzel added 3 commits June 23, 2022 07:56
Styled with: BasedOnStyle: Google, IndentWidth: 4, ColumnLimit: 0
An error state could be lost, if the creation of a successor directory
was successful. The previous error state has been overwritten.
During a t-u package installation, the SELinux RPM plugin handles the
contexts of created elements. The /var directory could be located on a
separate partition, which is not mounted in the tu-env. Therefore the
file contexts are lost in the snapshot and need to be set after boot by
the create_dirs_from_rpmdb service.
Fixes openSUSE#84
@laenion laenion merged commit 8f3bbc8 into openSUSE:master Jul 5, 2022
@laenion
Copy link
Collaborator

laenion commented Jul 5, 2022

Thanks a lot for the SELinux fixes and return code changes! The approach to delete the directories sounds reasonable; let's see if it works out that way, it can still be changed if proves to be troublesome.

Code review and tests are looking good, so I'll accept the coding style "fixes", too, although at least one person won't be happy about them :-)

The only thing missing from this pull request are the Makefile.am changes for linking SELinux, I'll add them in a minute. (And probably also some debugging output when the corresponding flag is set.)

@qby-wenzel
Copy link
Contributor Author

Thanks for merging! Looking forward to remove our workaround due to this bug.

Regarding the styling: I'm sorry. I didn't want to offend anyone and just followed the style of the other files :)

About the Makefile: Damn... I forget to readd it again after changing the work mode from best effort to directory deletion... Force push is not always good ;) Thanks anyway for adding it!

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.

[SELinux] FileContexts which are set in /var during the pkg installation are not synced
2 participants