From: Andrew Bartlett Date: Thu, 31 Jul 2008 00:51:59 +0000 (+1000) Subject: Use the cldap reply to avoid segfaulting in RPC-DSSYNC X-Git-Url: http://git.samba.org/samba.git/?p=kai%2Fsamba.git;a=commitdiff_plain;h=2cc32c4988e69b3a8c6254cc34e66370f220d60d Use the cldap reply to avoid segfaulting in RPC-DSSYNC Also don't fail the test if the server does not implement the NT4 changelog. Andrew Bartlett (This used to be commit 514d88580bee3bb17f1032262f5518e3ab2a349a) --- diff --git a/source4/torture/rpc/dssync.c b/source4/torture/rpc/dssync.c index 2930a9b1f9d..e8c67b46c10 100644 --- a/source4/torture/rpc/dssync.c +++ b/source4/torture/rpc/dssync.c @@ -34,6 +34,7 @@ #include "libcli/auth/libcli_auth.h" #include "auth/gensec/gensec.h" #include "param/param.h" +#include "dsdb/samdb/samdb.h" struct DsSyncBindInfo { struct dcerpc_pipe *pipe; @@ -314,6 +315,14 @@ static bool test_GetInfo(struct torture_context *tctx, struct DsSyncTest *ctx) printf("cldap_netlogon() returned Server Site-Name: %s.\n",search.out.netlogon.nt5_ex.server_site); } + if (!ctx->domain_dn) { + struct ldb_context *ldb = ldb_init(ctx, tctx->ev); + struct ldb_dn *dn = samdb_dns_domain_to_dn(ldb, ctx, search.out.netlogon.nt5_ex.dns_domain); + ctx->domain_dn = ldb_dn_alloc_linearized(ctx, dn); + talloc_free(dn); + talloc_free(ldb); + } + return ret; } @@ -800,7 +809,10 @@ static bool test_FetchNT4Data(struct torture_context *tctx, r.in.req.req1.data = cookie.data; status = dcerpc_drsuapi_DsGetNT4ChangeLog(ctx->new_dc.drsuapi.pipe, ctx, &r); - if (!NT_STATUS_IS_OK(status)) { + if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_IMPLEMENTED)) { + printf("DsGetNT4ChangeLog not supported by target server\n"); + break; + } else if (!NT_STATUS_IS_OK(status)) { const char *errstr = nt_errstr(status); if (NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) { errstr = dcerpc_errstr(ctx, ctx->new_dc.drsuapi.pipe->last_fault_code);