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

Relaxed check for root user #2150

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

flixman
Copy link

@flixman flixman commented Oct 26, 2024

In case the user running DNF is not root, the current behavior is to raise an Exception (because is a demand) and exit. To work around the fact that DNF does not provide a mechanism for relocate packages (see #2105), a way to work around this limitation is to execute dnf from within a container, binding the required folders from the host in the expected locations in the container. However, for certain runtimes (e.g., singularity) than run under the user permissions (and not root), this is not enough: besides the binding of the folders, the check for root must not be enforced.

This PR relaxes the check for root, so that instead of raising an Exception, a warning log message gets emitted. This should not pose a problem because, even in the case the user is not allowed to perform certain actions (e.g., write to /var/cache), DNF will be running anyway as the unprivileged user and will not harm the system.

@pep8speaks
Copy link

pep8speaks commented Oct 26, 2024

Hello @flixman! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2024-10-26 15:31:35 UTC

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.

2 participants