Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Sep 2021 20:04:18 +0200
From:      Mateusz Piotrowski <0mp@FreeBSD.org>
To:        freebsd-current@freebsd.org
Subject:   Re: [HEADSUP] making /bin/sh the default shell for root
Message-ID:  <c9c908af-0151-2e77-2333-979ecc44d52a@FreeBSD.org>
In-Reply-To: <97ebc390-a19e-3203-7016-ce541796eb18@beastielabs.net>
References:  <20210922083645.4vnoajyvwq6wfhdf@aniel.nours.eu> <97ebc390-a19e-3203-7016-ce541796eb18@beastielabs.net>

index | next in thread | previous in thread | raw e-mail

On 23/09/2021 10:55, Hans Ottevanger wrote:
> As you mention elsewhere in this thread, usage in scripts is not affected by these changes. And 
> for interactive use it could be a POLA violation, but the astonishment would be a positive one.

Unfortunately, the switch from csh to sh is going to affect scripts. Take a look at this (examples 
below assume that toor uses /bin/sh):

# su root -c 'echo $1' abc def
abc
# su toor -c 'echo $1' abc def
def

Another example:

# ssh -p 2222 root@xxx -- '$@' echo 1 2 3
Illegal variable name.
# ssh -p 2222 toor@xxx -- '$@' echo 1 2 3
1 2 3

I've been bitten by this a couple of times when working with some production scripts. I'm afraid 
changing the default shell to csh may cause a bit of hard-to-debug problems there in the wild.

Otherwise, I'd be happy with having sh(1) as the default shell for root. From my perspective, sh(1) 
was far more forgiving to my colleagues when they started with FreeBSD.

Best,

Mateusz Piotrowski




help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?c9c908af-0151-2e77-2333-979ecc44d52a>