[External] : configure shell game
Theo de Raadt
deraadt at openbsd.org
Wed Jun 3 02:28:38 AEST 2026
Nico Williams <nico at cryptonector.com> wrote:
> Oh, and also the set of warnings that a POSIX shell is allowed to emit
> might not be specified by POSIX. Looking at
> https://pubs.opengroup.org/onlinepubs/9799919799/utilities/sh.html
>
> | Except as otherwise stated (by the descriptions of any invoked
> | utilities or in interactive mode), standard error shall be used only
> | for diagnostic messages.
>
> Warnings about `` are -IMO- not diagnostic messages so, I think you're
> quite right that this is a bug in Solaris.
Imagine if we modified the OpenBSD pdksh variant (which is installed as
both /bin/sh and /bin/ksh and changes behaviours in a complicated way),
so that in sh mode it would ALWAYS emit a warning at startup:
/bin/sh: Why are you still writing scripts in sh instead of ksh?
to stderr.
It would be advice trying to move the community to do something different.
But since it lands on stderr, it would break an large number of scripts.
No matter how much we want scripts written in ksh, this would be dangerous.
The Solaris warning's effects are not quite as dramatic because it
doesn't happen in all scripts. But I'm sure it is breaking a large
number of scripts which use the standardized `` pattern, and I'd probably bet
some beer that this OpenSSH case is not the first. I think the best action
would be for Solaris to remove the warning (and the special case where it
becomes an error), and there is no action for OpenSSH (or other software) to
do change anything.
In particular, I think a change to $() without careful checking is going to
unwisely break some other system.
More information about the openssh-unix-dev
mailing list