s4-tort-drs: Add bind_info for dcerpc_drsuapi_DsBind() call
authorKamen Mazdrashki <kamen.mazdrashki@postpath.com>
Fri, 18 Sep 2009 16:04:22 +0000 (19:04 +0300)
committerAnatoliy Atanasov <anatoliy.atanasov@postpath.com>
Thu, 1 Oct 2009 08:29:23 +0000 (11:29 +0300)
After this patch DsGetNCChanges() test works fine.

bind_info returned by server is also cached for future use

Signed-off-by: Anatoliy Atanasov <anatoliy.atanasov@postpath.com>
source4/torture/rpc/drsuapi.c
source4/torture/rpc/drsuapi.h

index 6142096bc95f82c5b3552f893022841899eaf1d4..8f6bbb163b6198f7de22794a97c8815076dc7e77 100644 (file)
@@ -35,11 +35,46 @@ bool test_DsBind(struct dcerpc_pipe *p,
 {
        NTSTATUS status;
        struct drsuapi_DsBind r;
+       struct drsuapi_DsBindInfo28 *bind_info28;
+       struct drsuapi_DsBindInfoCtr bind_info_ctr;
+
+       ZERO_STRUCT(bind_info_ctr);
+       bind_info_ctr.length = 28;
+
+       bind_info28 = &bind_info_ctr.info.info28;
+       bind_info28->supported_extensions       |= DRSUAPI_SUPPORTED_EXTENSION_BASE;
+       bind_info28->supported_extensions       |= DRSUAPI_SUPPORTED_EXTENSION_ASYNC_REPLICATION;
+       bind_info28->supported_extensions       |= DRSUAPI_SUPPORTED_EXTENSION_REMOVEAPI;
+       bind_info28->supported_extensions       |= DRSUAPI_SUPPORTED_EXTENSION_MOVEREQ_V2;
+       bind_info28->supported_extensions       |= DRSUAPI_SUPPORTED_EXTENSION_GETCHG_COMPRESS;
+       bind_info28->supported_extensions       |= DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V1;
+       bind_info28->supported_extensions       |= DRSUAPI_SUPPORTED_EXTENSION_RESTORE_USN_OPTIMIZATION;
+       bind_info28->supported_extensions       |= DRSUAPI_SUPPORTED_EXTENSION_KCC_EXECUTE;
+       bind_info28->supported_extensions       |= DRSUAPI_SUPPORTED_EXTENSION_ADDENTRY_V2;
+       bind_info28->supported_extensions       |= DRSUAPI_SUPPORTED_EXTENSION_LINKED_VALUE_REPLICATION;
+       bind_info28->supported_extensions       |= DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V2;
+       bind_info28->supported_extensions       |= DRSUAPI_SUPPORTED_EXTENSION_INSTANCE_TYPE_NOT_REQ_ON_MOD;
+       bind_info28->supported_extensions       |= DRSUAPI_SUPPORTED_EXTENSION_CRYPTO_BIND;
+       bind_info28->supported_extensions       |= DRSUAPI_SUPPORTED_EXTENSION_GET_REPL_INFO;
+       bind_info28->supported_extensions       |= DRSUAPI_SUPPORTED_EXTENSION_STRONG_ENCRYPTION;
+       bind_info28->supported_extensions       |= DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V01;
+       bind_info28->supported_extensions       |= DRSUAPI_SUPPORTED_EXTENSION_TRANSITIVE_MEMBERSHIP;
+       bind_info28->supported_extensions       |= DRSUAPI_SUPPORTED_EXTENSION_ADD_SID_HISTORY;
+       bind_info28->supported_extensions       |= DRSUAPI_SUPPORTED_EXTENSION_POST_BETA3;
+       bind_info28->supported_extensions       |= DRSUAPI_SUPPORTED_EXTENSION_GET_MEMBERSHIPS2;
+       bind_info28->supported_extensions       |= DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V6;
+       bind_info28->supported_extensions       |= DRSUAPI_SUPPORTED_EXTENSION_NONDOMAIN_NCS;
+       bind_info28->supported_extensions       |= DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V8;
+       bind_info28->supported_extensions       |= DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V5;
+       bind_info28->supported_extensions       |= DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V6;
+       bind_info28->supported_extensions       |= DRSUAPI_SUPPORTED_EXTENSION_ADDENTRYREPLY_V3;
+       bind_info28->supported_extensions       |= DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V7;
+       bind_info28->supported_extensions       |= DRSUAPI_SUPPORTED_EXTENSION_VERIFY_OBJECT;
 
        GUID_from_string(DRSUAPI_DS_BIND_GUID, &priv->bind_guid);
 
        r.in.bind_guid = &priv->bind_guid;
-       r.in.bind_info = NULL;
+       r.in.bind_info = &bind_info_ctr;
        r.out.bind_handle = &priv->bind_handle;
 
        torture_comment(tctx, "testing DsBind\n");
@@ -47,6 +82,9 @@ bool test_DsBind(struct dcerpc_pipe *p,
        status = dcerpc_drsuapi_DsBind(p, tctx, &r);
        torture_drsuapi_assert_call(tctx, p, status, &r, "dcerpc_drsuapi_DsBind");
 
+       /* cache server supported extensions, i.e. bind_info */
+       priv->srv_bind_info = r.out.bind_info->info.info28;
+
        return true;
 }
 
index 89017675494596a323d05ae893d41da253399c3c..a10ea5068e60b091212f058097c8210f0631a710 100644 (file)
@@ -30,6 +30,8 @@ struct DsPrivate {
        struct dcerpc_pipe *pipe;
        struct policy_handle bind_handle;
        struct GUID bind_guid;
+       struct drsuapi_DsBindInfo28 srv_bind_info;
+
        const char *domain_obj_dn;
        const char *domain_guid_str;
        const char *domain_dns_name;