ldap_get() should fail if curl fails

ldap_get() incorrectly returns 0 if curl indicates an error.
This commit is contained in:
David Cooper 2018-04-30 10:42:47 -04:00 committed by David Cooper
parent b6c527598b
commit 87a7fa5df6
1 changed files with 3 additions and 4 deletions

View File

@ -1436,10 +1436,9 @@ ldap_get() {
if which curl &>/dev/null; then
ldif="$(curl -s "$crl")"
if [[ $? -eq 0 ]]; then
[[ $? -eq 0 ]] || return 1
awk '/certificateRevocationList/ { print $2 }' <<< "$ldif" | $OPENSSL base64 -d -A -out "$tmpfile" 2>/dev/null
[[ -s "$tmpfile" ]] || return 1
fi
return 0
else
pr_litecyan " (for LDAP CRL check install \"curl\")"