package/bash: add /bin/bash to /etc/shells

When bash is selected, /bin/bash is not added to /etc/shells
(see man shells). So, login tools like dropbear reject the ssh
connexions for users using bash as shell in /etc/passwd.

buildroot authpriv.warn dropbear[853]: User 'kubu' has invalid shell, rejected

Reported-by: Jeremy Rosen <jeremy.rosen@smile.fr>
Signed-off-by: Romain Naour <romain.naour@smile.fr>
Cc: "Yann E. MORIN" <yann.morin.1998@free.fr>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
This commit is contained in:
Romain Naour 2018-01-13 17:05:27 +01:00 committed by Thomas Petazzoni
parent bbceda5654
commit 4d279697af

View File

@ -40,10 +40,14 @@ endif
endif
# Make /bin/sh -> bash (no other shell, better than busybox shells)
# Add /bin/bash to /etc/shells otherwise some login tools like dropbear
# can reject the user connexion. See man shells.
define BASH_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
DESTDIR=$(TARGET_DIR) exec_prefix=/ install
rm -f $(TARGET_DIR)/bin/bashbug
grep -qsE '^/bin/bash' $(TARGET_DIR)/etc/shells \
|| echo "/bin/bash" >> $(TARGET_DIR)/etc/shells
endef
$(eval $(autotools-package))