diff options
author | tv <tv@krebsco.de> | 2023-07-18 10:38:15 +0200 |
---|---|---|
committer | tv <tv@krebsco.de> | 2023-07-18 10:38:15 +0200 |
commit | c42f3a37729ed771308fd6e2cdc384376d2966fd (patch) | |
tree | 0d5531ae31d67da7c4a7562285bf1e341cda7d70 /bin | |
parent | 058ef3084679f5e0c58df0a3daca82efc4f86afa (diff) |
Because per [sasl-3.1] The final “text” parameter is not to be
machine-parsed. Additionally, only continue on RPL_SASLSUCCESS
and abort otherwise.
[sasl-3.1]: https://ircv3.net/specs/extensions/sasl-3.1
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/ircsink | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/bin/ircsink b/bin/ircsink index dcbe294..c81f1a2 100755 --- a/bin/ircsink +++ b/bin/ircsink @@ -222,7 +222,15 @@ main() {( echo "AUTHENTICATE $message" echo "AUTHENTICATE ***REDACTED***" >&2 - sed -nru '/^(.*?):SASL authentication successful/q' + # wait for SASL to finish + # RPL_SASLSUCCESS (903) + # ERR_SASLFAIL (904) + # ERR_SASLTOOLONG (905) + sasl_result=$(sed -nru 's/^:[^ ]* (90[345]) .*/\1/p;T;q') + if test $sasl_result -ne 903; then + echo "$0: error: SASL authentication failed" >&2 + exit 1 + fi ;; esac |