Changeset 745 for trunk/server/source3/rpcclient/cmd_drsuapi.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/rpcclient/cmd_drsuapi.c
r414 r745 21 21 #include "includes.h" 22 22 #include "rpcclient.h" 23 #include "../librpc/gen_ndr/ cli_drsuapi.h"23 #include "../librpc/gen_ndr/ndr_drsuapi_c.h" 24 24 25 25 static WERROR cracknames(struct rpc_pipe_client *cli, … … 35 35 WERROR werr; 36 36 int i; 37 int32_t level = 1;37 uint32_t level = 1; 38 38 union drsuapi_DsNameRequest req; 39 int32_t level_out;39 uint32_t level_out; 40 40 struct drsuapi_DsNameString *names; 41 struct dcerpc_binding_handle *b = cli->binding_handle; 41 42 42 43 names = TALLOC_ZERO_ARRAY(mem_ctx, struct drsuapi_DsNameString, argc); … … 55 56 req.req1.format_desired = format_desired; 56 57 57 status = rpccli_drsuapi_DsCrackNames(cli, mem_ctx,58 status = dcerpc_drsuapi_DsCrackNames(b, mem_ctx, 58 59 bind_handle, 59 60 level, … … 83 84 struct GUID bind_guid; 84 85 struct policy_handle bind_handle; 86 struct dcerpc_binding_handle *b = cli->binding_handle; 85 87 86 88 union drsuapi_DsNameCtr ctr; … … 93 95 GUID_from_string(DRSUAPI_DS_BIND_GUID, &bind_guid); 94 96 95 status = rpccli_drsuapi_DsBind(cli, mem_ctx,97 status = dcerpc_drsuapi_DsBind(b, mem_ctx, 96 98 &bind_guid, 97 99 NULL, … … 101 103 if (!NT_STATUS_IS_OK(status)) { 102 104 return ntstatus_to_werror(status); 105 } 106 107 if (!W_ERROR_IS_OK(werr)) { 108 return werr; 103 109 } 104 110 … … 126 132 out: 127 133 if (is_valid_policy_hnd(&bind_handle)) { 128 rpccli_drsuapi_DsUnbind(cli, mem_ctx, &bind_handle, &werr); 134 WERROR _werr; 135 dcerpc_drsuapi_DsUnbind(b, mem_ctx, &bind_handle, &_werr); 129 136 } 130 137 … … 235 242 struct GUID bind_guid; 236 243 struct policy_handle bind_handle; 244 struct dcerpc_binding_handle *b = cli->binding_handle; 237 245 238 246 const char *domain = NULL; … … 254 262 GUID_from_string(DRSUAPI_DS_BIND_GUID, &bind_guid); 255 263 256 status = rpccli_drsuapi_DsBind(cli, mem_ctx,264 status = dcerpc_drsuapi_DsBind(b, mem_ctx, 257 265 &bind_guid, 258 266 NULL, … … 264 272 } 265 273 274 if (!W_ERROR_IS_OK(werr)) { 275 return werr; 276 } 277 266 278 req.req1.domain_name = domain; 267 279 req.req1.level = level; 268 280 269 status = rpccli_drsuapi_DsGetDomainControllerInfo(cli, mem_ctx,281 status = dcerpc_drsuapi_DsGetDomainControllerInfo(b, mem_ctx, 270 282 &bind_handle, 271 283 1, … … 286 298 out: 287 299 if (is_valid_policy_hnd(&bind_handle)) { 288 rpccli_drsuapi_DsUnbind(cli, mem_ctx, &bind_handle, &werr); 300 WERROR _werr; 301 dcerpc_drsuapi_DsUnbind(b, mem_ctx, &bind_handle, &_werr); 289 302 } 290 303 … … 300 313 301 314 struct policy_handle bind_handle; 315 struct dcerpc_binding_handle *b = cli->binding_handle; 302 316 303 317 struct GUID bind_guid; … … 309 323 DATA_BLOB session_key; 310 324 311 int32_t level = 8;325 uint32_t level = 8; 312 326 bool single = false; 313 int32_t level_out = 0;327 uint32_t level_out = 0; 314 328 union drsuapi_DsGetNCChangesRequest req; 315 329 union drsuapi_DsGetNCChangesCtr ctr; … … 319 333 struct drsuapi_DsGetNCChangesCtr1 *ctr1 = NULL; 320 334 struct drsuapi_DsGetNCChangesCtr6 *ctr6 = NULL; 321 int32_t out_level = 0;335 uint32_t out_level = 0; 322 336 int y; 323 337 324 338 uint32_t supported_extensions = 0; 325 uint32_t replica_flags = DRSUAPI_D S_REPLICA_NEIGHBOUR_WRITEABLE|326 DRSUAPI_D S_REPLICA_NEIGHBOUR_SYNC_ON_STARTUP|327 DRSUAPI_D S_REPLICA_NEIGHBOUR_DO_SCHEDULED_SYNCS|328 DRSUAPI_D S_REPLICA_NEIGHBOUR_RETURN_OBJECT_PARENTS|329 DRSUAPI_D S_REPLICA_NEIGHBOUR_NEVER_SYNCED;339 uint32_t replica_flags = DRSUAPI_DRS_WRIT_REP | 340 DRSUAPI_DRS_INIT_SYNC | 341 DRSUAPI_DRS_PER_SYNC | 342 DRSUAPI_DRS_GET_ANC | 343 DRSUAPI_DRS_NEVER_SYNCED; 330 344 331 345 if (argc > 3) { … … 389 403 bind_info.info.info28 = info28; 390 404 391 status = rpccli_drsuapi_DsBind(cli, mem_ctx,405 status = dcerpc_drsuapi_DsBind(b, mem_ctx, 392 406 &bind_guid, 393 407 &bind_info, … … 476 490 } 477 491 478 status = rpccli_drsuapi_DsGetNCChanges(cli, mem_ctx,492 status = dcerpc_drsuapi_DsGetNCChanges(b, mem_ctx, 479 493 &bind_handle, 480 494 level, … … 484 498 &werr); 485 499 if (!NT_STATUS_IS_OK(status)) { 500 werr = ntstatus_to_werror(status); 501 printf("Failed to get NC Changes: %s", 502 get_friendly_nt_error_msg(status)); 503 goto out; 504 } 505 506 if (!W_ERROR_IS_OK(werr)) { 486 507 printf("Failed to get NC Changes: %s", 487 508 get_friendly_werror_msg(werr)); 488 goto out;489 }490 491 if (!W_ERROR_IS_OK(werr)) {492 status = werror_to_ntstatus(werr);493 509 goto out; 494 510 }
Note:
See TracChangeset
for help on using the changeset viewer.