-
Notifications
You must be signed in to change notification settings - Fork 429
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
[Error] Fedora's shadow-utils passwd implementation needs '--stdin' #1209
Comments
I have been testing this patch and it seems to resolve the issue for me. If there is a prettier or more acceptable way to workaround this, please ignore this suggestion. diff --git a/distrobox-init b/distrobox-init
index 8f5bf8d..19287ad 100755
--- a/distrobox-init
+++ b/distrobox-init
@@ -1983,7 +1983,11 @@ if [ ! -e /etc/passwd.done ]; then
if [ "${rootful}" -eq 0 ]; then
# We're rootless so we don't care about account password, so we remove it
- printf "%s\n%s\n" "${temporary_password}" "${temporary_password}" | passwd root
+ passwd_cmd=passwd
+ if [ -n "$(passwd --help 2>&1 | grep -- --stdin)" ]; then
+ passwd_cmd="passwd --stdin"
+ fi
+ printf "%s\n%s\n" "${temporary_password}" "${temporary_password}" | ${passwd_cmd} root
printf "%s:" "root" | chpasswd -e
else
# We're rootful, so we don't want passwordless accounts, so we lock them |
@nathanchance I think that's the only way, I'm doing something similar for the |
Fedora recently changed their passwd implementation from its own package to the implementation in shadow-utils, adding '--stdin' in the process (which has been subsequently accepted upstream). Without that flag, entering up a Fedora container for the first time fails with + printf '%s\n%s\n' 7867745a-41ea-4493-8b7b-83d8fd18924a 7867745a-41ea-4493-8b7b-83d8fd18924a + passwd root The password for root is unchanged. Changing password for root Enter the new password (minimum of 8 characters) Please use a combination of upper and lower case letters and numbers. + '[' 1 -ne 0 ']' + printf 'Error: An error occurred\n' Error: An error occurred Look for '--stdin' in the help output of 'passwd' and use it if it is supported so the root password is properly changed. Closes: 89luca89#1209 Link: shadow-maint/shadow@49001ca Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Thanks for the input :) I have sent #1221 for this. |
Fedora recently changed their passwd implementation from its own package to the implementation in shadow-utils, adding '--stdin' in the process (which has been subsequently accepted upstream). Without that flag, entering up a Fedora container for the first time fails with + printf '%s\n%s\n' 7867745a-41ea-4493-8b7b-83d8fd18924a 7867745a-41ea-4493-8b7b-83d8fd18924a + passwd root The password for root is unchanged. Changing password for root Enter the new password (minimum of 8 characters) Please use a combination of upper and lower case letters and numbers. + '[' 1 -ne 0 ']' + printf 'Error: An error occurred\n' Error: An error occurred Look for '--stdin' in the help output of 'passwd' and use it if it is supported so the root password is properly changed. Closes: #1209 Link: shadow-maint/shadow@49001ca Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Describe the bug
After Fedora switched their
passwd
implementation away from its own package and intoshadow-utils
(https://src.fedoraproject.org/rpms/shadow-utils/c/91360f25a8c8b810d59bec2803a2477a2647c775?branch=rawhide), I am unable to start a container that includes it.To Reproduce
Expected behavior
I expect to be able to start my container :)
Logs
Desktop (please complete the following information):
podman
4.9.2
git
.Additional context
The following diff allows the container to start but I am not sure if there are implications for other
passwd
implementations so I am not submitting it.The text was updated successfully, but these errors were encountered: