]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libnet join: Fix error handling on provision_store_self_join failure
authorGary Lockyer <gary@catalyst.net.nz>
Tue, 23 May 2017 02:11:35 +0000 (14:11 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 25 May 2017 04:28:02 +0000 (06:28 +0200)
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

source4/libnet/libnet_join.c

index cd747cc550275a2710ff3bc11ed8c30d9773504f..0c206444a535e3c5eedcadd57854da01dfd40d6f 100644 (file)
@@ -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;
        }