sh: Parse a larger number of error messages
commit0528ebde97cedd2ab2c1fefe2bc383a2306ecd47
authorEric Blake <eblake@redhat.com>
Tue, 2 Jul 2019 22:14:00 +0000 (2 17:14 -0500)
committerEric Blake <eblake@redhat.com>
Wed, 3 Jul 2019 03:07:28 +0000 (2 22:07 -0500)
treeff34b275242656bff9c8f646143a148d8a01fd02
parent2b2343c3114bbbcaba0b5671f979170bafe8293f
sh: Parse a larger number of error messages

In order to trigger a non-EIO failure, a script had to output
_exactly_ 'EINVAL ' or similar, with one trailing space and no other
message, because we forgot to limit the length of the string
comparison. Fix things to tolerate an error name without a message, as
well as to be case-insensitive.

Also, parse EOVERFLOW (missed in commit 6f8c8084).

The next patch will add a test to avoid regressions.

Not done here but perhaps worth considering: if the first portion of
the scripts output resembles a numeric value, we could see if that
matches a known errno value.

Fixes: 262787dc86
Signed-off-by: Eric Blake <eblake@redhat.com>
plugins/sh/call.c
plugins/sh/nbdkit-sh-plugin.pod