s3: don't replace the error message if already defined
[ira/wip.git] / source3 / libnet / libnet_dssync.c
index c768226e8baba6db88dc2cd00df6a36532b4fe6f..a8431066efa9a5691bb2ec0d38d5853cce6a48ab 100644 (file)
@@ -652,9 +652,11 @@ static NTSTATUS libnet_dssync_process(TALLOC_CTX *mem_ctx,
                status = libnet_dssync_getncchanges(mem_ctx, ctx, level, &req,
                                                    &pnew_utdv);
                if (!NT_STATUS_IS_OK(status)) {
-                       ctx->error_message = talloc_asprintf(ctx,
-                               "Failed to call DsGetNCCHanges: %s",
-                               nt_errstr(status));
+                       if (!ctx->error_message) {
+                               ctx->error_message = talloc_asprintf(ctx,
+                                       "Failed to call DsGetNCCHanges: %s",
+                                       nt_errstr(status));
+                       }
                        goto out;
                }
        }