From: Michael Adam Date: Fri, 18 Jul 2008 13:10:51 +0000 (+0200) Subject: rpcclient: add ability to fetch single objects with dsgetncchanges command X-Git-Tag: samba-3.3.0pre1~512 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c9ab2953c5af0dd3cddbe6c4cdd2b8da2734aa84;p=thirdparty%2Fsamba.git rpcclient: add ability to fetch single objects with dsgetncchanges command call as "dsgetncchanges single" after calling "seal" Michael --- diff --git a/source/rpcclient/cmd_drsuapi.c b/source/rpcclient/cmd_drsuapi.c index a1604d82a06..31feeceb73c 100644 --- a/source/rpcclient/cmd_drsuapi.c +++ b/source/rpcclient/cmd_drsuapi.c @@ -308,6 +308,7 @@ static WERROR cmd_drsuapi_getncchanges(struct rpc_pipe_client *cli, DATA_BLOB session_key; int32_t level = 8; + bool single = false; int32_t level_out = 0; union drsuapi_DsGetNCChangesRequest req; union drsuapi_DsGetNCChangesCtr ctr; @@ -326,8 +327,8 @@ static WERROR cmd_drsuapi_getncchanges(struct rpc_pipe_client *cli, 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]); + if (argc > 3) { + printf("usage: %s [naming_context_or_object_dn [single]]\n", argv[0]); return WERR_OK; } @@ -335,6 +336,15 @@ static WERROR cmd_drsuapi_getncchanges(struct rpc_pipe_client *cli, nc_dn = argv[1]; } + if (argc == 3) { + if (strequal(argv[2], "single")) { + single = true; + } else { + printf("warning: ignoring unknown argument '%s'\n", + argv[2]); + } + } + ZERO_STRUCT(info28); ZERO_STRUCT(null_sid); @@ -440,12 +450,18 @@ static WERROR cmd_drsuapi_getncchanges(struct rpc_pipe_client *cli, req.req8.replica_flags = replica_flags; req.req8.max_object_count = 402; req.req8.max_ndr_size = 402116; + if (single) { + req.req8.extended_op = DRSUAPI_EXOP_REPL_OBJ; + } } 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; + if (single) { + req.req5.extended_op = DRSUAPI_EXOP_REPL_OBJ; + } } for (y=0; ;y++) {