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

sysusers.sh: Create /etc/login.defs if missing #3207

Closed
wants to merge 1 commit into from

Conversation

ffesti
Copy link
Contributor

@ffesti ffesti commented Jul 15, 2024

useradd needs both /etc/group and /etc/login.defs to work. It does chroot into a new system and then looks for these files. While this is technically correct it is a bit inconvenient for RPM. Creating etc/login.defs as an empty file make this work but still runs useradd without proper configuration until the shadow-utils package gets installed. There isn't really anything RPM can do about that and distribution need to ahndle the situation to make installations to an empty directory with rpm --roo work.

Resolves: #3186

useradd needs both /etc/group and /etc/login.defs to work. It does
chroot into a new system and then looks for these files. While this is
technically correct it is a bit inconvenient for RPM. Creating
etc/login.defs as an empty file make this work but still runs useradd
without  proper configuration until the shadow-utils package gets
installed. There isn't really anything RPM can do about that and
distribution need to ahndle the situation to make installations to an
empty directory with rpm --roo work.

Resolves: rpm-software-management#3186
@ffesti
Copy link
Contributor Author

ffesti commented Jul 15, 2024

OK, looks like this is not quite the right solution...

@ffesti ffesti added the DONT DO NOT merge, for whatever reason label Jul 15, 2024
@ffesti
Copy link
Contributor Author

ffesti commented Jul 26, 2024

Looks like useradd behaves differently in different environments wrt /etc/login.defs. May be setting the right variable via the command line and -K can fix this issue without needing to provide a /etc/login.defs in empty chroots.

@pmatilai
Copy link
Member

As discussed in the ticket, this apperars to be an issue with shadow-utils SELinux integration and there doesn't appear to be any reasonable workaround we could do. Let's just close this.

@pmatilai pmatilai closed this Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DONT DO NOT merge, for whatever reason
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sysusers.sh fails in empty chroot
2 participants