[Bash-completion-devel] [bash-completion-Bugs][311717] chsh -s: different behaviour for root

bash-completion-bugs at alioth.debian.org bash-completion-bugs at alioth.debian.org
Mon Apr 25 11:28:12 UTC 2011


Bugs item #311717, was changed at 2009-06-01 11:47 by Ville Skyttä 
You can respond by visiting: 
https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=311717&group_id=100114

Status: Open
Priority: 3
Submitted By: Martin von Gagern (gagern-guest)
Assigned to: Nobody (None)
Summary: chsh -s: different behaviour for root 
Distribution: Gentoo
Originally reported in: Gentoo Bugzilla
Milestone: None
Status: None
Original bug number: 271521


Initial Comment:
The bash completion for "chsh -s" uses the contents of /etc/shells as the list of posible completions. This makes sense for normal users, as their choice is usually restricted to one of these shells. However, there is no such restriction for root. In fact, on many systems there are binaries like /sbin/nologin or similar which are unsuitable as a login shell for normal users, but which are likely to be chosen by root as the login shell for special system accounts.

I therefore suggest that the completion for "chsh -s" detect whether it's run by UID 0, and if so, use normal path completin instead of using the contents from /etc/shells.

----------------------------------------------------------------------

>Comment By: Ville Skyttä  (scop-guest)
Date: 2011-04-25 14:28

Message:
I'm not sure if this is a good idea, it'd provide people a way to shoot themselves in the foot.  FWIW on my Fedora 14 system, /etc/shells contains /sbin/nologin.

----------------------------------------------------------------------

You can respond by visiting: 
https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=311717&group_id=100114



More information about the Bash-completion-devel mailing list