From: Stefan Metzmacher Date: Wed, 14 Jun 2017 08:39:26 +0000 (+0200) Subject: auth/gensec: add GENSEC_UPDATE_IS_NTERROR() helper macro X-Git-Tag: tevent-0.9.32~71 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c3a47ceab43989ccc513c16cd9c65b339ebb9f2f;p=thirdparty%2Fsamba.git auth/gensec: add GENSEC_UPDATE_IS_NTERROR() helper macro This allows us to write clearer code that checks for NT_STATUS_OK and NT_STATUS_MORE_PROCESSING_REQUIRED. Signed-off-by: Stefan Metzmacher Reviewed-by: Andreas Schneider Reviewed-by: Andrew Bartlett --- diff --git a/auth/gensec/gensec.h b/auth/gensec/gensec.h index da3e0fdf31d..a466f27b756 100644 --- a/auth/gensec/gensec.h +++ b/auth/gensec/gensec.h @@ -147,6 +147,12 @@ struct tevent_req *gensec_update_send(TALLOC_CTX *mem_ctx, struct gensec_security *gensec_security, const DATA_BLOB in); NTSTATUS gensec_update_recv(struct tevent_req *req, TALLOC_CTX *out_mem_ctx, DATA_BLOB *out); + +#define GENSEC_UPDATE_IS_NTERROR(status) ( \ + !NT_STATUS_IS_OK(status) && \ + !NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED) \ + ) + /** * @brief Ask for features for a following authentication *