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

Group ownership and process ownership defaults to mock #1306

Merged
merged 2 commits into from
Feb 6, 2024

Conversation

praiskup
Copy link
Member

@praiskup praiskup commented Feb 4, 2024

Trying to address #1257

@xsuchy
Copy link
Member

xsuchy commented Feb 5, 2024

@praiskup can you rebase it, so it is easier to review - as this includes already merged CI commits.

Hopefully, we do not open a can of worms.., but using GID=135 for
non-privileged operations seems like the most expected Mock behavior.
This way, we automatically maintain the ownership-bridge between the
on-host user and the in-chroot user (both present in the 'mock' group).

Mock started to map the unprivGid to the default GID of the on-host user
in the commits 9c4e0f4 and
5cce73a, both are very old and it
rather seems like a mistake than intention.

Fixes: rpm-software-management#1257
Changing ownership of the entire $HOME directory tree is sometimes an
expensive task and a no-op anyway because there's typically no reason
for files with the wrong ownership to appear. Let's stop doing it to
make the subsequent mock --chroot calls faster and more predictable.

In other words, if users want to shoot themselves in the foot and give
the files in '/builddir' away (e.g., using "privileged" --chroot calls),
Mock will no longer fix the ownership problems.  We only continue to fix
the permissions for the --rebuild mode, which shouldn't be expensive
(because there are pre-build cleanups) and seems important enough to
risk changing.

Suggested by @kdudka in rpm-software-management#1257.
@xsuchy xsuchy merged commit db64d46 into rpm-software-management:main Feb 6, 2024
19 checks passed
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