Re: [HEADSUP] making /bin/sh the default shell for root
Date: Tue, 28 Sep 2021 18:04:18 UTC
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