summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafal Szczesniak <mimir@samba.org>2005-05-10 13:05:40 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:16:36 -0500
commite8eccd22ee7338d356ec51234a3181ff766bf98d (patch)
tree5da7fa1e7a95e7b5c1760115773c1c82e4cdfb40
parent5cbfca296739980c1d03fe23c275195ade0bb6b6 (diff)
downloadsamba-e8eccd22ee7338d356ec51234a3181ff766bf98d.tar.gz
samba-e8eccd22ee7338d356ec51234a3181ff766bf98d.tar.bz2
samba-e8eccd22ee7338d356ec51234a3181ff766bf98d.zip
r6709: Add monitor messages to useradd composite useradd function.
rafal (This used to be commit b3fce5b94be2f9491a53673b1baecf0c8fe5b7c4)
-rw-r--r--source4/libnet/userman.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/source4/libnet/userman.c b/source4/libnet/userman.c
index 1bba0ff718..5e9edd6efb 100644
--- a/source4/libnet/userman.c
+++ b/source4/libnet/userman.c
@@ -25,6 +25,7 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
#include "libcli/composite/composite.h"
+#include "libcli/composite/monitor.h"
#include "librpc/gen_ndr/ndr_samr.h"
#include "libnet/composite.h"
@@ -71,10 +72,13 @@ static void useradd_handler(struct rpc_request *req)
{
struct composite_context *c = req->async.private;
struct useradd_state *s = talloc_get_type(c->private, struct useradd_state);
+ struct monitor_msg msg;
switch (s->stage) {
case USERADD_CREATE:
c->status = useradd_create(c, s);
+ msg.type = rpc_create_user;
+ msg.data.rpc_create_user.rid = *s->createuser.out.rid;
break;
}
@@ -82,6 +86,10 @@ static void useradd_handler(struct rpc_request *req)
c->state = SMBCLI_REQUEST_ERROR;
}
+ if (c->monitor_fn) {
+ c->monitor_fn(&msg);
+ }
+
if (c->state >= SMBCLI_REQUEST_DONE &&
c->async.fn) {
c->async.fn(c);
@@ -97,7 +105,8 @@ static void useradd_handler(struct rpc_request *req)
*/
struct composite_context *rpc_composite_useradd_send(struct dcerpc_pipe *p,
- struct rpc_composite_useradd *io)
+ struct rpc_composite_useradd *io,
+ void (*monitor)(struct monitor_msg*))
{
struct composite_context *c;
struct useradd_state *s;
@@ -111,9 +120,10 @@ struct composite_context *rpc_composite_useradd_send(struct dcerpc_pipe *p,
s->domain_handle = io->in.domain_handle;
s->pipe = p;
- c->state = SMBCLI_REQUEST_SEND;
- c->private = s;
- c->event_ctx = dcerpc_event_context(p);
+ c->state = SMBCLI_REQUEST_SEND;
+ c->private = s;
+ c->event_ctx = dcerpc_event_context(p);
+ c->monitor_fn = monitor;
/* preparing parameters to send rpc request */
s->createuser.in.domain_handle = &io->in.domain_handle;
@@ -179,7 +189,7 @@ NTSTATUS rpc_composite_useradd(struct dcerpc_pipe *pipe,
TALLOC_CTX *mem_ctx,
struct rpc_composite_useradd *io)
{
- struct composite_context *c = rpc_composite_useradd_send(pipe, io);
+ struct composite_context *c = rpc_composite_useradd_send(pipe, io, NULL);
return rpc_composite_useradd_recv(c, mem_ctx, io);
}