From: Samuel Cabrero Date: Wed, 30 Aug 2023 17:59:04 +0000 (+0200) Subject: s3:libnetapi: Return error from RequestOfflineJoin X-Git-Tag: samba-4.18.10~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f731d75081fe3fa2330dee26e931b260669d3f27;p=thirdparty%2Fsamba.git s3:libnetapi: Return error from RequestOfflineJoin The error code must be returned to caller even if the error string is not set. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13577 Signed-off-by: Samuel Cabrero Reviewed-by: Andrew Bartlett (cherry picked from commit e4afb211fe32f2aa92cc903df948874046f60305) --- diff --git a/source3/lib/netapi/joindomain.c b/source3/lib/netapi/joindomain.c index a2c66877b0c..7145ce5d6d1 100644 --- a/source3/lib/netapi/joindomain.c +++ b/source3/lib/netapi/joindomain.c @@ -862,8 +862,10 @@ static WERROR NetRequestOfflineDomainJoin_backend(struct libnetapi_ctx *ctx, WKSSVC_JOIN_FLAGS_MACHINE_PWD_PASSED; werr = libnet_Join(j, j); - if (!W_ERROR_IS_OK(werr) && j->out.error_string) { - libnetapi_set_error_string(ctx, "%s", j->out.error_string); + if (!W_ERROR_IS_OK(werr)) { + if (j->out.error_string != NULL) { + libnetapi_set_error_string(ctx, "%s", j->out.error_string); + } talloc_free(j); return werr; }