[Buildroot] [PATCH 7/7] package/mksh: add /bin/mksh to /etc/shells

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Mon Jan 15 10:35:23 UTC 2018


Hello,

On Sun, 14 Jan 2018 23:37:36 +0100, Yann E. MORIN wrote:

> On 2018-01-14 22:03 +0100, Romain Naour spake thusly:
> > When mksh is selected, /bin/mksh is not added to /etc/shells
> > (see man shells). So, login tools like dropbear reject the ssh
> > connexions for users using mksh as shell in /etc/passwd.
> > 
> > buildroot authpriv.warn dropbear[853]: User 'kubu' has invalid shell, rejected
> > 
> > Signed-off-by: Romain Naour <romain.naour at smile.fr>
> > ---
> >  package/mksh/mksh.mk | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> > 
> > diff --git a/package/mksh/mksh.mk b/package/mksh/mksh.mk
> > index b5706db..52d4b00 100644
> > --- a/package/mksh/mksh.mk
> > +++ b/package/mksh/mksh.mk
> > @@ -21,4 +21,13 @@ define MKSH_INSTALL_TARGET_CMDS
> >  	$(INSTALL) -m 0755 -D $(@D)/mksh $(TARGET_DIR)/bin/mksh
> >  endef
> >  
> > +# Add /bin/mksh to /etc/shells otherwise some login tools like dropbear
> > +# can reject the user connexion. See man shells.
> > +define MKSH_INSTALL_ADD_MKSH_TO_SHELLS
> > +	grep -qsE '^/bin/mksh' $(TARGET_DIR)/etc/shells \
> > +		|| echo "/bin/mksh" >> $(TARGET_DIR)/etc/shells
> > +endef
> > +
> > +MKSH_POST_INSTALL_TARGET_HOOKS += MKSH_INSTALL_ADD_MKSH_TO_SHELLS  
> 
> Use a simple assignement here.

Well, actually, I'm quite happy with using += for hooks, even if
there's only one registered.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com



More information about the buildroot mailing list