summaryrefslogtreecommitdiff
path: root/source4/libnet
diff options
context:
space:
mode:
authorGary Lockyer <gary@catalyst.net.nz>2017-05-23 14:11:35 +1200
committerAndrew Bartlett <abartlet@samba.org>2017-05-25 06:28:02 +0200
commitfa6753d6c2f83392e9517bd3cee7d65561fb7c0c (patch)
tree8712c68c9751a73c45593858c88516903d13ee5d /source4/libnet
parent7796364d623011343c3f19c3167a41ab569eaea0 (diff)
downloadsamba-fa6753d6c2f83392e9517bd3cee7d65561fb7c0c.tar.gz
libnet join: Fix error handling on provision_store_self_join failure
This avoids leaving the error string NULL. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Thu May 25 06:28:02 CEST 2017 on sn-devel-144
Diffstat (limited to 'source4/libnet')
-rw-r--r--source4/libnet/libnet_join.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source4/libnet/libnet_join.c b/source4/libnet/libnet_join.c
index cd747cc5502..0c206444a53 100644
--- a/source4/libnet/libnet_join.c
+++ b/source4/libnet/libnet_join.c
@@ -1000,7 +1000,14 @@ NTSTATUS libnet_Join_member(struct libnet_context *ctx,
status = provision_store_self_join(ctx, ctx->lp_ctx, ctx->event_ctx, set_secrets, &error_string);
if (!NT_STATUS_IS_OK(status)) {
- r->out.error_string = talloc_steal(mem_ctx, error_string);
+ if (r->out.error_string) {
+ r->out.error_string = talloc_steal(mem_ctx, error_string);
+ } else {
+ r->out.error_string
+ = talloc_asprintf(mem_ctx,
+ "provision_store_self_join failed with %s",
+ nt_errstr(status));
+ }
talloc_free(tmp_mem);
return status;
}