summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillem Jover <guillem@hadrons.org>2024-10-02 03:32:13 +0200
committerTimo Weingärtner <timo@tiwe.de>2024-10-24 10:55:14 +0200
commit31b9dc01eb871055de006a3fb94fdaea2059966a (patch)
tree872f8ef0b56052dbec6e195775362b8f8c196d20
parentc26168119320ca5b03e6b420e3c4192d1e2ecc6a (diff)
downloadopenssh-known-hosts-31b9dc01eb871055de006a3fb94fdaea2059966a.tar.gz
Clarify comment on exit code override to workaround overlapping codes
The framework expects to be able to ignore specific exit codes from the plugins, but if we are possibly returning exit codes from different tools, then it's hard to untangle what tool generated which exit code. In the plugins at hand the exit code 1 seems like a safe one, given both curl and rsync usage, so we currently turn any OpenPGP verification error into that.
-rwxr-xr-xplugins/curl3
-rwxr-xr-xplugins/rsync3
2 files changed, 4 insertions, 2 deletions
diff --git a/plugins/curl b/plugins/curl
index b9dd2cb..29c0ace 100755
--- a/plugins/curl
+++ b/plugins/curl
@@ -15,7 +15,8 @@ if [ "${SIGURL}" ]; then
curl -fRz "./current" -m 300 ${CURL_OPTIONS} -o new.sig "${SIGURL}" -o new "${URL}"
[ -e new ] || exit 0
gpgv --keyring "${KEYRING}" --status-fd 2 new.sig new || exit 1
- # return 1 because it's not clear what other codes may used
+ # return 1 because it's not clear what other codes may be safe to
+ # use that do not overlap with codes from curl.
else
curl -fRz "./current" -m 300 ${CURL_OPTIONS} -o new "${URL}"
fi
diff --git a/plugins/rsync b/plugins/rsync
index 1c2cae2..6aec09c 100755
--- a/plugins/rsync
+++ b/plugins/rsync
@@ -16,7 +16,8 @@ rsync -vt --timeout=300 "${URL}" new
if [ "${SIGURL}" ]; then
rsync -vt --timeout=300 "${SIGURL}" new.sig
gpgv --keyring "${KEYRING}" --status-fd 2 new.sig new || exit 1
- # return 1 because it's not clear what other codes may used
+ # return 1 because it's not clear what other codes may be safe to
+ # use that do not overlap with codes from rsync.
fi
# vim:set ft=sh: