Changeset 745 for trunk/server/source3/libnet/libnet_dssync.c
- Timestamp:
- Nov 27, 2012, 4:43:17 PM (13 years ago)
- Location:
- trunk/server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server
- Property svn:mergeinfo changed
/vendor/current merged: 581,587,591,594,597,600,615,618,740
- Property svn:mergeinfo changed
-
trunk/server/source3/libnet/libnet_dssync.c
r414 r745 22 22 23 23 #include "includes.h" 24 #include "libnet/libnet.h" 24 #include "libnet/libnet_dssync.h" 25 #include "rpc_client/cli_pipe.h" 25 26 #include "../libcli/drsuapi/drsuapi.h" 26 #include "../librpc/gen_ndr/ cli_drsuapi.h"27 #include "../librpc/gen_ndr/ndr_drsuapi_c.h" 27 28 28 29 /**************************************************************** … … 31 32 static int libnet_dssync_free_context(struct dssync_context *ctx) 32 33 { 34 WERROR result; 35 struct dcerpc_binding_handle *b; 36 33 37 if (!ctx) { 34 38 return 0; … … 36 40 37 41 if (is_valid_policy_hnd(&ctx->bind_handle) && ctx->cli) { 38 rpccli_drsuapi_DsUnbind(ctx->cli, ctx, &ctx->bind_handle, NULL); 42 b = ctx->cli->binding_handle; 43 dcerpc_drsuapi_DsUnbind(b, ctx, &ctx->bind_handle, &result); 39 44 } 40 45 … … 125 130 struct drsuapi_DsBindInfoCtr bind_info; 126 131 struct drsuapi_DsBindInfo28 info28; 132 struct dcerpc_binding_handle *b = ctx->cli->binding_handle; 127 133 128 134 ZERO_STRUCT(info28); … … 165 171 bind_info.info.info28 = info28; 166 172 167 status = rpccli_drsuapi_DsBind(ctx->cli, mem_ctx,173 status = dcerpc_drsuapi_DsBind(b, mem_ctx, 168 174 &bind_guid, 169 175 &bind_info, … … 219 225 NTSTATUS status; 220 226 WERROR werr; 221 int32_t level = 1;227 uint32_t level = 1; 222 228 union drsuapi_DsNameRequest req; 223 int32_t level_out;229 uint32_t level_out; 224 230 struct drsuapi_DsNameString names[1]; 225 231 union drsuapi_DsNameCtr ctr; 232 struct dcerpc_binding_handle *b = ctx->cli->binding_handle; 226 233 227 234 names[0].str = talloc_asprintf(mem_ctx, "%s\\", ctx->domain_name); … … 236 243 req.req1.format_desired = DRSUAPI_DS_NAME_FORMAT_FQDN_1779; 237 244 238 status = rpccli_drsuapi_DsCrackNames(ctx->cli, mem_ctx,245 status = dcerpc_drsuapi_DsCrackNames(b, mem_ctx, 239 246 &ctx->bind_handle, 240 247 level, … … 246 253 ctx->error_message = talloc_asprintf(ctx, 247 254 "Failed to lookup DN for domain name: %s", 255 get_friendly_nt_error_msg(status)); 256 return status; 257 } 258 259 if (!W_ERROR_IS_OK(werr)) { 260 ctx->error_message = talloc_asprintf(ctx, 261 "Failed to lookup DN for domain name: %s", 248 262 get_friendly_werror_msg(werr)); 249 return status;250 }251 252 if (!W_ERROR_IS_OK(werr)) {253 263 return werror_to_ntstatus(werr); 254 264 } … … 301 311 const char *dn, 302 312 struct replUpToDateVectorBlob *utdv, 303 int32_t *plevel,313 uint32_t *plevel, 304 314 union drsuapi_DsGetNCChangesRequest *preq) 305 315 { 306 316 NTSTATUS status; 307 317 uint32_t count; 308 int32_t level;318 uint32_t level; 309 319 union drsuapi_DsGetNCChangesRequest req; 310 320 struct dom_sid null_sid; … … 313 323 struct drsuapi_DsReplicaCursorCtrEx *cursors = NULL; 314 324 315 uint32_t replica_flags = DRSUAPI_D S_REPLICA_NEIGHBOUR_WRITEABLE|316 DRSUAPI_D S_REPLICA_NEIGHBOUR_SYNC_ON_STARTUP|317 DRSUAPI_D S_REPLICA_NEIGHBOUR_DO_SCHEDULED_SYNCS|318 DRSUAPI_D S_REPLICA_NEIGHBOUR_RETURN_OBJECT_PARENTS|319 DRSUAPI_D S_REPLICA_NEIGHBOUR_NEVER_SYNCED;325 uint32_t replica_flags = DRSUAPI_DRS_WRIT_REP | 326 DRSUAPI_DRS_INIT_SYNC | 327 DRSUAPI_DRS_PER_SYNC | 328 DRSUAPI_DRS_GET_ANC | 329 DRSUAPI_DRS_NEVER_SYNCED; 320 330 321 331 ZERO_STRUCT(null_sid); … … 416 426 static NTSTATUS libnet_dssync_getncchanges(TALLOC_CTX *mem_ctx, 417 427 struct dssync_context *ctx, 418 int32_t level,428 uint32_t level, 419 429 union drsuapi_DsGetNCChangesRequest *req, 420 430 struct replUpToDateVectorBlob **pnew_utdv) … … 426 436 struct drsuapi_DsGetNCChangesCtr6 *ctr6 = NULL; 427 437 struct replUpToDateVectorBlob *new_utdv = NULL; 428 int32_t level_out = 0;429 int32_t out_level = 0;438 uint32_t level_out = 0; 439 uint32_t out_level = 0; 430 440 int y; 431 441 bool last_query; 442 struct dcerpc_binding_handle *b = ctx->cli->binding_handle; 432 443 433 444 if (!ctx->single_object_replication) { … … 442 453 struct drsuapi_DsReplicaObjectListItemEx *first_object = NULL; 443 454 struct drsuapi_DsReplicaOIDMapping_Ctr *mapping_ctr = NULL; 455 uint32_t linked_attributes_count = 0; 456 struct drsuapi_DsReplicaLinkedAttribute *linked_attributes = NULL; 444 457 445 458 if (level == 8) { … … 453 466 } 454 467 455 status = rpccli_drsuapi_DsGetNCChanges(ctx->cli, mem_ctx,468 status = dcerpc_drsuapi_DsGetNCChanges(b, mem_ctx, 456 469 &ctx->bind_handle, 457 470 level, … … 463 476 ctx->error_message = talloc_asprintf(ctx, 464 477 "Failed to get NC Changes: %s", 465 get_friendly_ werror_msg(werr));478 get_friendly_nt_error_msg(status)); 466 479 goto out; 467 480 } … … 469 482 if (!W_ERROR_IS_OK(werr)) { 470 483 status = werror_to_ntstatus(werr); 484 ctx->error_message = talloc_asprintf(ctx, 485 "Failed to get NC Changes: %s", 486 get_friendly_werror_msg(werr)); 471 487 goto out; 472 488 } … … 525 541 mapping_ctr = &ctr6->mapping_ctr; 526 542 543 linked_attributes = ctr6->linked_attributes; 544 linked_attributes_count = ctr6->linked_attributes_count; 545 527 546 if (ctr6->more_data) { 528 547 req->req8.highwatermark = ctr6->new_highwatermark; … … 564 583 } 565 584 } 585 586 if (linked_attributes_count == 0) { 587 continue; 588 } 589 590 if (ctx->ops->process_links) { 591 status = ctx->ops->process_links(ctx, mem_ctx, 592 linked_attributes_count, 593 linked_attributes, 594 mapping_ctr); 595 if (!NT_STATUS_IS_OK(status)) { 596 ctx->error_message = talloc_asprintf(ctx, 597 "Failed to call processing function: %s", 598 nt_errstr(status)); 599 goto out; 600 } 601 } 566 602 } 567 603 … … 577 613 NTSTATUS status; 578 614 579 int32_t level = 0;615 uint32_t level = 0; 580 616 union drsuapi_DsGetNCChangesRequest req; 581 617 struct replUpToDateVectorBlob *old_utdv = NULL;
Note:
See TracChangeset
for help on using the changeset viewer.