[PATCH] *.sh: Fix kornsh-ism test(1) invocations

Daniel Lenski dlenski at gmail.com
Thu Sep 15 18:07:00 PDT 2022


On Thu, Sep 15, 2022 at 8:00 AM Bernhard Reutner-Fischer
<rep.dot.nop at gmail.com> wrote:
> On Thu, 15 Sep 2022 11:54:39 +0200
> Dimitri Papadopoulos <dimitri.papadopoulos at cea.fr> wrote:
>
> > Perhaps the double [[ == ]] can be changed to [ = ] in most cases, as it
> > implies regular expressions might be involved - but they are not.
>
> The hunks in fetch.sh indeed should not be replaced.
> If we were to be gentle we could grep instead, or use a case statement,
> but that's probably not worth it.
>
> But for all the rest plain test(1) is sufficient.

What I'm really asking here is… what actual problem do these changes solve?

Is there, perhaps, some operating system where…

(a) A version of /bin/sh supporting `==` and `[[ … ]]` is not
installed by default
(b) This prevents the CSD scripts from running correctly
(c) But for this POSIX-ly incorrect usage, OpenConnect would otherwise
work fine and allow you to connect to a Cisco server that requires
CSD.

If there *is* such a system, then that would provide a pretty clear
rationale for changing these scripts.

If there isn't, then I don't see the upside, and there could be a
potential downside. It's surprisingly hard to verify that these
scripts work correctly even on multiple Linux distributions, with
different versions of, say, cURL, and with all pre-existing Cisco
servers. Testing that things work on Android/*BSD/MacOS quickly gets
overwhelming.

See https://gitlab.com/openconnect/openconnect/-/commit/1b3538842757d97c6066be659cd04d3c90427ec1
and https://gitlab.com/openconnect/openconnect/-/commit/026236a2e2a241732ccbfd9abf434893c27e5af9
for examples of tiny little changes to these scripts (which had clear
upsides), but nevertheless caused problems for someone, somewhere.

Dan



More information about the openconnect-devel mailing list