diff options
author | Michael Adam <obnox@samba.org> | 2008-07-18 15:10:51 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2008-07-18 15:15:49 +0200 |
commit | 4f0e0e5e83e027edff7ef9875c9ef46be562e3a1 (patch) | |
tree | ac615744718c34c7a161ec2700c308040d64659a | |
parent | bcb652451b6360b0de595c13961b11134097f3bb (diff) | |
download | samba-4f0e0e5e83e027edff7ef9875c9ef46be562e3a1.tar.gz samba-4f0e0e5e83e027edff7ef9875c9ef46be562e3a1.tar.bz2 samba-4f0e0e5e83e027edff7ef9875c9ef46be562e3a1.zip |
rpcclient: add ability to fetch single objects with dsgetncchanges command
call as "dsgetncchanges <object_dn> single"
after calling "seal"
Michael
(This used to be commit c9ab2953c5af0dd3cddbe6c4cdd2b8da2734aa84)
-rw-r--r-- | source3/rpcclient/cmd_drsuapi.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/source3/rpcclient/cmd_drsuapi.c b/source3/rpcclient/cmd_drsuapi.c index a1604d82a0..31feeceb73 100644 --- a/source3/rpcclient/cmd_drsuapi.c +++ b/source3/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++) { |