From e1ddfa431b9b26fef56fa327093ad416d7d72da9 Mon Sep 17 00:00:00 2001 From: mayeut Date: Tue, 15 Oct 2024 12:37:00 +0200 Subject: [PATCH 1/2] feat: use /bin/bash as the default shell --- docker/build_scripts/install-runtime-packages.sh | 6 +++++- tests/run_tests.sh | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docker/build_scripts/install-runtime-packages.sh b/docker/build_scripts/install-runtime-packages.sh index 402021af0..0c8ecf772 100755 --- a/docker/build_scripts/install-runtime-packages.sh +++ b/docker/build_scripts/install-runtime-packages.sh @@ -105,7 +105,7 @@ elif [ "${AUDITWHEEL_POLICY}" == "manylinux_2_28" ]; then fi elif [ "${BASE_POLICY}" == "musllinux" ]; then TOOLCHAIN_DEPS="binutils gcc g++ gfortran" - BASETOOLS="${BASETOOLS} curl util-linux tar" + BASETOOLS="${BASETOOLS} curl util-linux shadow tar" PACKAGE_MANAGER=apk apk add --no-cache ca-certificates gnupg else @@ -137,4 +137,8 @@ if [ "${BASE_POLICY}" == "manylinux" ]; then # c.f. https://github.com/pypa/manylinux/issues/1022 echo "/usr/local/lib" > /etc/ld.so.conf.d/00-manylinux.conf ldconfig +else + # set the default shell to bash + chsh -s /bin/bash root + useradd -D -s /bin/bash fi diff --git a/tests/run_tests.sh b/tests/run_tests.sh index d6123198d..88c5ce1df 100755 --- a/tests/run_tests.sh +++ b/tests/run_tests.sh @@ -160,5 +160,8 @@ if [ -L /usr/local/man ]; then test -d /usr/local/man fi +# check the default shell is /bin/bash +test "$SHELL" = "/bin/bash" + # final report echo "run_tests successful!" From 918a48fd42d8b40d21431f13a8ba61c739676b12 Mon Sep 17 00:00:00 2001 From: mayeut Date: Tue, 15 Oct 2024 12:57:56 +0200 Subject: [PATCH 2/2] fix musllinux_1_1 --- docker/build_scripts/install-runtime-packages.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docker/build_scripts/install-runtime-packages.sh b/docker/build_scripts/install-runtime-packages.sh index 0c8ecf772..1d63e64ca 100755 --- a/docker/build_scripts/install-runtime-packages.sh +++ b/docker/build_scripts/install-runtime-packages.sh @@ -138,6 +138,15 @@ if [ "${BASE_POLICY}" == "manylinux" ]; then echo "/usr/local/lib" > /etc/ld.so.conf.d/00-manylinux.conf ldconfig else + if [ ! -f /etc/pam.d/chsh ]; then + cat < /etc/pam.d/chsh +#%PAM-1.0 +auth sufficient pam_rootok.so +auth sufficient pam_shells.so +account required pam_permit.so +password include base-password +EOF + fi # set the default shell to bash chsh -s /bin/bash root useradd -D -s /bin/bash