diff options
Diffstat (limited to 'source3')
-rw-r--r-- | source3/libnet/libnet_join.c | 2 | ||||
-rw-r--r-- | source3/libnet/libnet_samsync.c | 28 |
2 files changed, 19 insertions, 11 deletions
diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c index 18986d9e33..6120617278 100644 --- a/source3/libnet/libnet_join.c +++ b/source3/libnet/libnet_join.c @@ -27,7 +27,7 @@ #include "rpc_client/init_samr.h" #include "../librpc/gen_ndr/cli_lsa.h" #include "rpc_client/cli_lsarpc.h" -#include "../librpc/gen_ndr/cli_netlogon.h" +#include "../librpc/gen_ndr/ndr_netlogon.h" #include "rpc_client/cli_netlogon.h" #include "lib/smbconf/smbconf.h" #include "lib/smbconf/smbconf_reg.h" diff --git a/source3/libnet/libnet_samsync.c b/source3/libnet/libnet_samsync.c index a464a004ab..3ae4baa3c3 100644 --- a/source3/libnet/libnet_samsync.c +++ b/source3/libnet/libnet_samsync.c @@ -27,7 +27,7 @@ #include "../libcli/samsync/samsync.h" #include "../libcli/auth/libcli_auth.h" #include "../librpc/gen_ndr/ndr_netlogon.h" -#include "../librpc/gen_ndr/cli_netlogon.h" +#include "../librpc/gen_ndr/ndr_netlogon_c.h" #include "../libcli/security/security.h" /** @@ -199,7 +199,7 @@ static NTSTATUS libnet_samsync_delta(TALLOC_CTX *mem_ctx, struct samsync_context *ctx, struct netr_ChangeLogEntry *e) { - NTSTATUS result; + NTSTATUS result, status; NTSTATUS callback_status; const char *logon_server = ctx->cli->desthost; const char *computername = global_myname(); @@ -207,6 +207,7 @@ static NTSTATUS libnet_samsync_delta(TALLOC_CTX *mem_ctx, struct netr_Authenticator return_authenticator; uint16_t restart_state = 0; uint32_t sync_context = 0; + struct dcerpc_binding_handle *b = ctx->cli->binding_handle; ZERO_STRUCT(return_authenticator); @@ -217,17 +218,18 @@ static NTSTATUS libnet_samsync_delta(TALLOC_CTX *mem_ctx, if (ctx->single_object_replication && !ctx->force_full_replication) { - result = rpccli_netr_DatabaseRedo(ctx->cli, mem_ctx, + status = dcerpc_netr_DatabaseRedo(b, mem_ctx, logon_server, computername, &credential, &return_authenticator, *e, 0, - &delta_enum_array); + &delta_enum_array, + &result); } else if (!ctx->force_full_replication && sequence_num && (*sequence_num > 0)) { - result = rpccli_netr_DatabaseDeltas(ctx->cli, mem_ctx, + status = dcerpc_netr_DatabaseDeltas(b, mem_ctx, logon_server, computername, &credential, @@ -235,9 +237,10 @@ static NTSTATUS libnet_samsync_delta(TALLOC_CTX *mem_ctx, database_id, sequence_num, &delta_enum_array, - 0xffff); + 0xffff, + &result); } else { - result = rpccli_netr_DatabaseSync2(ctx->cli, mem_ctx, + status = dcerpc_netr_DatabaseSync2(b, mem_ctx, logon_server, computername, &credential, @@ -246,11 +249,12 @@ static NTSTATUS libnet_samsync_delta(TALLOC_CTX *mem_ctx, restart_state, &sync_context, &delta_enum_array, - 0xffff); + 0xffff, + &result); } - if (NT_STATUS_EQUAL(result, NT_STATUS_NOT_SUPPORTED)) { - return result; + if (!NT_STATUS_IS_OK(status)) { + return status; } /* Check returned credentials. */ @@ -260,6 +264,10 @@ static NTSTATUS libnet_samsync_delta(TALLOC_CTX *mem_ctx, return NT_STATUS_ACCESS_DENIED; } + if (NT_STATUS_EQUAL(result, NT_STATUS_NOT_SUPPORTED)) { + return result; + } + if (NT_STATUS_IS_ERR(result)) { break; } |