summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-03-11 12:15:50 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:11:01 -0500
commit4b83366b6cf81a29fab0f9dac5e6074784c639a8 (patch)
treea3e230e7b8f097af86099515e7c4c6e3b14699ca /source4/torture
parent736797ef7fe3b9cf542fa69281272501f95bfa3f (diff)
downloadsamba-4b83366b6cf81a29fab0f9dac5e6074784c639a8.tar.gz
samba-4b83366b6cf81a29fab0f9dac5e6074784c639a8.tar.bz2
samba-4b83366b6cf81a29fab0f9dac5e6074784c639a8.zip
r5742: - add torture test and idl for DsReplicaUpdateRefs()
(the torture test currently only tests if the idl is correct) - add start for idl for DsGetNCChanges() (if someone didn't noticed the current ethereal trunk code can successful decrypt DCERPC and LDAP gsskrb5 encrypted blobs, when you provide a keytab and have compiled against heimdal :-) - add a view bitmaps and enum's for better debugging metze (This used to be commit cf7c1352ab2857b80256e02f70ab3fbd5177d596)
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/rpc/drsuapi.c70
1 files changed, 65 insertions, 5 deletions
diff --git a/source4/torture/rpc/drsuapi.c b/source4/torture/rpc/drsuapi.c
index e10c088e36..a6c0f5b9c6 100644
--- a/source4/torture/rpc/drsuapi.c
+++ b/source4/torture/rpc/drsuapi.c
@@ -29,6 +29,7 @@ struct DsPrivate {
struct GUID bind_guid;
const char *domain_obj_dn;
const char *domain_guid_str;
+ const char *domain_dns_name;
struct GUID domain_guid;
struct drsuapi_DsGetDCInfo2 dcinfo;
};
@@ -133,6 +134,7 @@ static BOOL test_DsCrackNames(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
return ret;
}
+ priv->domain_dns_name = r.out.ctr.ctr1->array[0].dns_domain_name;
priv->domain_guid_str = r.out.ctr.ctr1->array[0].result_name;
GUID_from_string(priv->domain_guid_str, &priv->domain_guid);
@@ -780,21 +782,20 @@ static BOOL test_DsReplicaSync(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
r.in.bind_handle = &priv->bind_handle;
for (i=0; i < ARRAY_SIZE(array); i++) {
- printf("testing DsReplicaGetInfo level %d\n",
+ printf("testing DsReplicaSync level %d\n",
array[i].level);
r.in.level = array[i].level;
switch(r.in.level) {
case 1:
r.in.req.req1.info = &info1;
- r.in.req.req1.info->unknown1 = 32;
- r.in.req.req1.info->unknown2 = 120;
+ r.in.req.req1.info->unknown1 = 0;
ZERO_STRUCT(r.in.req.req1.info->guid1);
- ZERO_STRUCT(r.in.req.req1.info->unknown3);
+ ZERO_STRUCT(r.in.req.req1.info->byte_array);
r.in.req.req1.info->nc_dn = priv->domain_obj_dn?priv->domain_obj_dn:"";
r.in.req.req1.guid1 = priv->dcinfo.ntds_guid;
r.in.req.req1.string1 = NULL;
- r.in.req.req1.unknown1 = 16;
+ r.in.req.req1.options = 16;
break;
}
@@ -815,6 +816,63 @@ static BOOL test_DsReplicaSync(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
return ret;
}
+static BOOL test_DsReplicaUpdateRefs(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
+ struct DsPrivate *priv)
+{
+ NTSTATUS status;
+ BOOL ret = True;
+ int i;
+ struct drsuapi_DsReplicaUpdateRefs r;
+ struct GUID null_guid;
+ struct {
+ int32_t level;
+ } array[] = {
+ {
+ 1
+ }
+ };
+
+ ZERO_STRUCT(null_guid);
+
+ r.in.bind_handle = &priv->bind_handle;
+
+ for (i=0; i < ARRAY_SIZE(array); i++) {
+ printf("testing DsReplicaUpdateRefs level %d\n",
+ array[i].level);
+
+ r.in.level = array[i].level;
+ switch(r.in.level) {
+ case 1:
+ r.in.req.req1.unknown1 = 0;
+ r.in.req.req1.unknown2 = 0;
+ r.in.req.req1.dest_dsa_guid = null_guid;
+ r.in.req.req1.options = 0;
+ r.in.req.req1.sync_req_info1.unknown1 = 0;
+ r.in.req.req1.sync_req_info1.guid1 = null_guid;
+ ZERO_STRUCT(r.in.req.req1.sync_req_info1.byte_array);
+ r.in.req.req1.sync_req_info1.nc_dn = priv->domain_obj_dn?priv->domain_obj_dn:"";
+ r.in.req.req1.dest_dsa_dns_name = talloc_asprintf(mem_ctx, "__some_dest_dsa_guid_string._msdn.%s",
+ priv->domain_dns_name);
+ break;
+ }
+
+ status = dcerpc_drsuapi_DsReplicaUpdateRefs(p, mem_ctx, &r);
+ 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(mem_ctx, p->last_fault_code);
+ }
+ printf("dcerpc_drsuapi_DsReplicaUpdateRefs failed - %s\n", errstr);
+ ret = False;
+ } else if (!W_ERROR_IS_OK(r.out.result)) {
+ printf("DsReplicaUpdateRefs failed - %s\n", win_errstr(r.out.result));
+ ret = False;
+ }
+ }
+
+ return ret;
+}
+
static BOOL test_DsUnbind(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
struct DsPrivate *priv)
{
@@ -877,6 +935,8 @@ BOOL torture_rpc_drsuapi(void)
ret &= test_DsReplicaSync(p, mem_ctx, &priv);
+ ret &= test_DsReplicaUpdateRefs(p, mem_ctx, &priv);
+
ret &= test_DsUnbind(p, mem_ctx, &priv);
talloc_free(mem_ctx);