]> rtime.felk.cvut.cz Git - coffee/buildroot.git/commitdiff
package/tmux: add /usr/bin/tmux to /etc/shells
authorRomain Naour <romain.naour@smile.fr>
Fri, 19 Jan 2018 10:15:05 +0000 (11:15 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Thu, 3 May 2018 21:15:06 +0000 (23:15 +0200)
When tmux is selected, /usr/bin/tmux is not added to /etc/shells
(see man shells). So, login tools like dropbear reject the ssh
connections for users using tmux as shell in /etc/passwd.

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

Signed-off-by: Romain Naour <romain.naour@smile.fr>
Cc: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/tmux/tmux.mk

index 6e03d01abfca3c06ea5e128bf49217461acca288..e380227475a74409d15ce9ae296583140be1aa08 100644 (file)
@@ -10,4 +10,12 @@ TMUX_LICENSE = ISC
 TMUX_LICENSE_FILES = README
 TMUX_DEPENDENCIES = libevent ncurses host-pkgconf
 
+# Add /usr/bin/tmux to /etc/shells otherwise some login tools like dropbear
+# can reject the user connection. See man shells.
+define TMUX_ADD_TMUX_TO_SHELLS
+       grep -qsE '^/usr/bin/tmux$$' $(TARGET_DIR)/etc/shells \
+               || echo "/usr/bin/tmux" >> $(TARGET_DIR)/etc/shells
+endef
+TMUX_TARGET_FINALIZE_HOOKS += TMUX_ADD_TMUX_TO_SHELLS
+
 $(eval $(autotools-package))