struct {
int32_t level;
} array[] = {
-/* {
+ {
5
},
-*/ {
+/* {
8
}
- };
+*/ };
ZERO_STRUCT(null_guid);
ZERO_STRUCT(null_sid);
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;
;
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;
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;
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;
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);