diff options
author | Michael Adam <obnox@samba.org> | 2008-07-17 23:27:38 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2008-07-18 14:34:46 +0200 |
commit | f52b17f25cf2b332433562bfe998b1469ac1ed66 (patch) | |
tree | 759c1f9ae363d55fd063046264e1b3664cc3c7a0 /source3/rpcclient | |
parent | 82a5c62e6415c9841f68235400de7f2fda4fd158 (diff) | |
download | samba-f52b17f25cf2b332433562bfe998b1469ac1ed66.tar.gz samba-f52b17f25cf2b332433562bfe998b1469ac1ed66.tar.xz samba-f52b17f25cf2b332433562bfe998b1469ac1ed66.zip |
rpcclient: use level 5 or level 8 in dsgetncchanges command based on bind-info.
Michael
(This used to be commit 3ab2e7fada1f31e87337065b5bc30a7b92a6d117)
Diffstat (limited to 'source3/rpcclient')
-rw-r--r-- | source3/rpcclient/cmd_drsuapi.c | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/source3/rpcclient/cmd_drsuapi.c b/source3/rpcclient/cmd_drsuapi.c index 2593a431409..a1604d82a06 100644 --- a/source3/rpcclient/cmd_drsuapi.c +++ b/source3/rpcclient/cmd_drsuapi.c @@ -319,6 +319,13 @@ static WERROR cmd_drsuapi_getncchanges(struct rpc_pipe_client *cli, int32_t out_level = 0; int y; + uint32_t supported_extensions = 0; + uint32_t replica_flags = DRSUAPI_DS_REPLICA_NEIGHBOUR_WRITEABLE | + DRSUAPI_DS_REPLICA_NEIGHBOUR_SYNC_ON_STARTUP | + DRSUAPI_DS_REPLICA_NEIGHBOUR_DO_SCHEDULED_SYNCS | + DRSUAPI_DS_REPLICA_NEIGHBOUR_RETURN_OBJECT_PARENTS | + DRSUAPI_DS_REPLICA_NEIGHBOUR_NEVER_SYNCED; + if (argc > 2) { printf("usage: %s naming_context_dn\n", argv[0]); return WERR_OK; @@ -384,6 +391,12 @@ static WERROR cmd_drsuapi_getncchanges(struct rpc_pipe_client *cli, return werr; } + if (bind_info.length == 24) { + supported_extensions = bind_info.info.info24.supported_extensions; + } else if (bind_info.length == 28) { + supported_extensions = bind_info.info.info28.supported_extensions; + } + if (!nc_dn) { union drsuapi_DsNameCtr crack_ctr; @@ -421,14 +434,19 @@ static WERROR cmd_drsuapi_getncchanges(struct rpc_pipe_client *cli, nc.guid = GUID_zero(); nc.sid = null_sid; - req.req8.naming_context = &nc; - req.req8.replica_flags = DRSUAPI_DS_REPLICA_NEIGHBOUR_WRITEABLE | - DRSUAPI_DS_REPLICA_NEIGHBOUR_SYNC_ON_STARTUP | - DRSUAPI_DS_REPLICA_NEIGHBOUR_DO_SCHEDULED_SYNCS | - DRSUAPI_DS_REPLICA_NEIGHBOUR_RETURN_OBJECT_PARENTS | - DRSUAPI_DS_REPLICA_NEIGHBOUR_NEVER_SYNCED; - req.req8.max_object_count = 402; - req.req8.max_ndr_size = 402116; + if (supported_extensions & DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V8) { + level = 8; + req.req8.naming_context = &nc; + req.req8.replica_flags = replica_flags; + req.req8.max_object_count = 402; + req.req8.max_ndr_size = 402116; + } else { + level = 5; + req.req5.naming_context = &nc; + req.req5.replica_flags = replica_flags; + req.req5.max_object_count = 402; + req.req5.max_ndr_size = 402116; + } for (y=0; ;y++) { |