]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
net_vampire: add some error output to libnet_dssync.
authorGünther Deschner <gd@samba.org>
Thu, 26 Jun 2008 08:22:40 +0000 (10:22 +0200)
committerGünther Deschner <gd@samba.org>
Thu, 26 Jun 2008 08:24:14 +0000 (10:24 +0200)
Guenther

source/libnet/libnet_dssync.c

index b1392acd7e216089e24273e8d78da8844185bbc2..0866db59bd5a7b76927a99b34606f7ff7dc9dd72 100644 (file)
@@ -158,6 +158,9 @@ static NTSTATUS libnet_dssync_lookup_nc(TALLOC_CTX *mem_ctx,
                                             &ctr,
                                             &werr);
        if (!NT_STATUS_IS_OK(status)) {
+               ctx->error_message = talloc_asprintf(mem_ctx,
+                       "Failed to lookup DN for domain name: %s",
+                       get_friendly_werror_msg(werr));
                return status;
        }
 
@@ -252,11 +255,14 @@ static NTSTATUS libnet_dssync_process(TALLOC_CTX *mem_ctx,
                                                       &ctr,
                                                       &werr);
                if (!NT_STATUS_IS_OK(status)) {
-                       werr = ntstatus_to_werror(status);
+                       ctx->error_message = talloc_asprintf(mem_ctx,
+                               "Failed to get NC Changes: %s",
+                               get_friendly_werror_msg(werr));
                        goto out;
                }
 
                if (!W_ERROR_IS_OK(werr)) {
+                       status = werror_to_ntstatus(werr);
                        goto out;
                }
 
@@ -270,6 +276,9 @@ static NTSTATUS libnet_dssync_process(TALLOC_CTX *mem_ctx,
 
                status = cli_get_session_key(mem_ctx, ctx->cli, &ctx->session_key);
                if (!NT_STATUS_IS_OK(status)) {
+                       ctx->error_message = talloc_asprintf(mem_ctx,
+                               "Failed to get Session Key: %s",
+                               nt_errstr(status));
                        return status;
                }
 
@@ -283,6 +292,9 @@ static NTSTATUS libnet_dssync_process(TALLOC_CTX *mem_ctx,
                                                            ctr1->first_object,
                                                            ctx);
                                if (!NT_STATUS_IS_OK(status)) {
+                                       ctx->error_message = talloc_asprintf(mem_ctx,
+                                               "Failed to call processing function: %s",
+                                               nt_errstr(status));
                                        goto out;
                                }
                        }
@@ -313,6 +325,9 @@ static NTSTATUS libnet_dssync_process(TALLOC_CTX *mem_ctx,
                                                            ctr6->first_object,
                                                            ctx);
                                if (!NT_STATUS_IS_OK(status)) {
+                                       ctx->error_message = talloc_asprintf(mem_ctx,
+                                               "Failed to call processing function: %s",
+                                               nt_errstr(status));
                                        goto out;
                                }
                        }