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

shadow_utils: make shadow --root work by fake permissive mode #1313

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

praiskup
Copy link
Member

@praiskup praiskup commented Feb 7, 2024

Fixes: #1285

@praiskup praiskup marked this pull request as draft February 7, 2024 08:53
@praiskup
Copy link
Member Author

praiskup commented Feb 7, 2024

While the use of --root is desired and safer than --prefix, I'm not convinced we want to apply the needed SELinux workaround. I'd rather wait till shadow-utils people tell us what to do about this.

@xsuchy
Copy link
Member

xsuchy commented Feb 7, 2024

This does not work for me. When I change it from host, then it is remounted. And it is read only, so I cannot change it from chroot neither.

@praiskup
Copy link
Member Author

praiskup commented Feb 7, 2024

Yes, Mock's selinux plugin has some hacks related to SELinux too, and we do recursive bind-mounts later:

BindMountPoint(srcpath=mount_point,
bindpath=host_path,
recursive=True,
options="nodev,noexec,nosuid,readonly,rprivate"),

The point of this hack is to prepare the enforce file right before shadow-utils (useradd, groupadd, etc.) are executed (from /usr/sbin on host).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

We should do shadow-utils (e.g. useradd) with --root, not --prefix
2 participants