hacks drsuapi exop and samr_client stuff...
authorStefan Metzmacher <metze@samba.org>
Fri, 18 Jul 2008 10:57:21 +0000 (12:57 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 14 Aug 2008 11:46:16 +0000 (13:46 +0200)
source/torture/rpc/dssync.c
source/torture/rpc/samr.c

index 2739081246c5228b1e3d5584a289124d76473a5e..bc4f255a0e565b201845a343132905373ae3d37d 100644 (file)
@@ -602,13 +602,13 @@ static bool test_FetchData(struct torture_context *tctx, struct DsSyncTest *ctx)
        struct {
                int32_t level;
        } array[] = {
-/*             {
+               {
                        5
                },
-*/             {
+/*             {
                        8
                }
-       };
+*/     };
 
        ZERO_STRUCT(null_guid);
        ZERO_STRUCT(null_sid);
@@ -650,7 +650,7 @@ static bool test_FetchData(struct torture_context *tctx, struct DsSyncTest *ctx)
                        nc.sid  = null_sid;
                        nc.dn   = partition; 
 
-                       r.in.req.req5.destination_dsa_guid              = ctx->new_dc.invocation_id;
+                       r.in.req.req5.destination_dsa_guid              = null_guid;//ctx->new_dc.invocation_id;
                        r.in.req.req5.source_dsa_invocation_id          = null_guid;
                        r.in.req.req5.naming_context                    = &nc;
                        r.in.req.req5.highwatermark.tmp_highest_usn     = highest_usn;
@@ -671,7 +671,7 @@ static bool test_FetchData(struct torture_context *tctx, struct DsSyncTest *ctx)
                                                                        ;
                        r.in.req.req5.max_object_count                  = 133;
                        r.in.req.req5.max_ndr_size                      = 1336770;
-                       r.in.req.req5.extended_op                       = DRSUAPI_EXOP_NONE;
+                       r.in.req.req5.extended_op                       = lp_parm_int(tctx->lp_ctx, NULL, "dssync", "exop", DRSUAPI_EXOP_NONE);
                        r.in.req.req5.fsmo_info                         = 0;
 
                        break;
@@ -681,7 +681,7 @@ static bool test_FetchData(struct torture_context *tctx, struct DsSyncTest *ctx)
                        nc.dn   = partition; 
                        /* nc.dn can be set to any other ad partition */
                        
-                       r.in.req.req8.destination_dsa_guid              = ctx->new_dc.invocation_id;
+                       r.in.req.req8.destination_dsa_guid              = null_guid;//ctx->new_dc.invocation_id;
                        r.in.req.req8.source_dsa_invocation_id          = null_guid;
                        r.in.req.req8.naming_context                    = &nc;
                        r.in.req.req8.highwatermark.tmp_highest_usn     = highest_usn;
@@ -703,7 +703,7 @@ static bool test_FetchData(struct torture_context *tctx, struct DsSyncTest *ctx)
                        r.in.req.req8.max_object_count                  = 402;
                        r.in.req.req8.max_ndr_size                      = 402116;
 
-                       r.in.req.req8.extended_op                       = DRSUAPI_EXOP_NONE;
+                       r.in.req.req8.extended_op                       = lp_parm_int(tctx->lp_ctx, NULL, "dssync", "exop", DRSUAPI_EXOP_NONE);
                        r.in.req.req8.fsmo_info                         = 0;
                        r.in.req.req8.partial_attribute_set             = NULL;
                        r.in.req.req8.partial_attribute_set_ex          = NULL;
index 6afda6e9b5239e811b8f6919abed13150b1d20d4..b0aa57a5abac07b081ee42a9e723d19098485527 100644 (file)
@@ -4581,6 +4581,83 @@ bool torture_rpc_samr(struct torture_context *torture)
                return false;
        }
 
+{
+       struct samr_Connect r;
+
+       printf("testing samr_Connect\n");
+
+       r.in.system_name = 0;
+       r.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
+       r.out.connect_handle = &handle;
+
+       status = dcerpc_samr_Connect(p, torture, &r);
+       if (!NT_STATUS_IS_OK(status)) {
+               printf("Connect failed - %s\n", nt_errstr(status));
+               ret = false;
+       }
+       
+}
+{
+       struct samr_QuerySecurity r;
+       struct samr_SetSecurity s;
+       struct sec_desc_buf sdb;
+       struct security_ace *ace;
+
+       r.in.handle = &handle;
+       r.in.sec_info = 7;
+
+       status = dcerpc_samr_QuerySecurity(p, torture, &r);
+       if (!NT_STATUS_IS_OK(status)) {
+               printf("QuerySecurity failed - %s\n", nt_errstr(status));
+               ret = false;
+       }
+
+       if (r.out.sdbuf == NULL) {
+               ret = false;
+       }
+
+       s.in.handle = &handle;
+       s.in.sec_info = 0;
+       s.in.sdbuf = &sdb;
+       sdb.sd = security_descriptor_dacl_create(torture,
+                                       0, NULL, NULL,
+                                       SID_CREATOR_OWNER,
+                                       SEC_ACE_TYPE_ACCESS_ALLOWED,
+                                       SEC_RIGHTS_FILE_READ | SEC_STD_ALL,
+                                       0,
+                                       NULL);
+
+       ace = security_ace_create(sdb.sd,
+                                 "S-1-5-21-1231233-12312312-123123123-23",
+                                 SEC_ACE_TYPE_ACCESS_ALLOWED,
+                                 SEC_RIGHTS_FILE_READ | SEC_STD_ALL,
+                                 0);
+
+{int i;
+for (i=0; i < 400; i++) {
+       security_descriptor_dacl_add(sdb.sd, ace);
+}}
+
+       status = dcerpc_samr_SetSecurity(p, torture, &s);
+       if (!NT_STATUS_IS_OK(status)) {
+               printf("SetSecurity failed - %s\n", nt_errstr(status));
+               ret = false;
+       }
+}
+{
+       struct samr_Close r;
+
+       r.in.handle = &handle;
+       r.out.handle = &handle;
+
+       status = dcerpc_samr_Close(p, torture, &r);
+       if (!NT_STATUS_IS_OK(status)) {
+               printf("Close handle failed - %s\n", nt_errstr(status));
+               ret = false;
+       }
+}
+return ret;
+       
        ret &= test_Connect(p, torture, &handle);
 
        ret &= test_QuerySecurity(p, torture, &handle);