Bugs item #311717, was changed at 01.06.2009 08:47 by Martin von Gagern
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: Martin von Gagern (gagern-guest)
Date: 27.04.2011 13:40

Message:
Having nologin in /etc/shells sounds like a good way to shoot yourself in the 
foot, too: as a normal user, you could accidentially make your account 
unusable. Even worse, it allows normal users to shoot themselves in the foot. 
root should know better than to actually pull the trigger. And root might use a 
completely different binary as shell for very special accounts where having it 
in /etc/shells would be even worse.

I believe that bash completion should provide as many legal command arguments 
as reasonably possible. It is up to the command itself to prevent people from 
shooting themselves in the foot. As chsh does accept different arguments for 
root or non-root, bash completion should mirror that fact without 
second-guessing it.

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

Comment By: Ville Skyttä  (scop-guest)
Date: 25.04.2011 11: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

_______________________________________________
Bash-completion-devel mailing list
Bash-completion-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/bash-completion-devel

Reply via email to