From 3ef6f35ddee6a48ea04358c180772bb040f64652 Mon Sep 17 00:00:00 2001 From: Rafal Szczesniak Date: Mon, 26 Jun 2006 21:17:31 +0000 Subject: r16530: Send monitor messages only after successful receiving result of a stage. rafal (This used to be commit e5dc6311633146e44063ba5eb20488468af75914) --- source4/libnet/userman.c | 58 +++++++++++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 25 deletions(-) (limited to 'source4/libnet/userman.c') diff --git a/source4/libnet/userman.c b/source4/libnet/userman.c index cd12ece0e8..08b0a2f1e2 100644 --- a/source4/libnet/userman.c +++ b/source4/libnet/userman.c @@ -767,45 +767,53 @@ static void usermod_handler(struct rpc_request *req) case USERMOD_LOOKUP: c->status = usermod_lookup(c, s); - /* monitor message */ - msg.type = rpc_lookup_name; - msg_lookup = talloc(s, struct msg_rpc_lookup_name); - - msg_lookup->rid = s->lookupname.out.rids.ids; - msg_lookup->count = s->lookupname.out.rids.count; - msg.data = (void*)msg_lookup; - msg.data_size = sizeof(*msg_lookup); + if (NT_STATUS_IS_OK(c->status)) { + /* monitor message */ + msg.type = rpc_lookup_name; + msg_lookup = talloc(s, struct msg_rpc_lookup_name); + + msg_lookup->rid = s->lookupname.out.rids.ids; + msg_lookup->count = s->lookupname.out.rids.count; + msg.data = (void*)msg_lookup; + msg.data_size = sizeof(*msg_lookup); + } break; case USERMOD_OPEN: c->status = usermod_open(c, s); - /* monitor message */ - msg.type = rpc_open_user; - msg_open = talloc(s, struct msg_rpc_open_user); - - msg_open->rid = s->openuser.in.rid; - msg_open->access_mask = s->openuser.in.rid; - msg.data = (void*)msg_open; - msg.data_size = sizeof(*msg_open); + if (NT_STATUS_IS_OK(c->status)) { + /* monitor message */ + msg.type = rpc_open_user; + msg_open = talloc(s, struct msg_rpc_open_user); + + msg_open->rid = s->openuser.in.rid; + msg_open->access_mask = s->openuser.in.rid; + msg.data = (void*)msg_open; + msg.data_size = sizeof(*msg_open); + } break; case USERMOD_QUERY: c->status = usermod_query(c, s); - /* monitor message */ - msg.type = rpc_query_user; - msg.data = NULL; - msg.data_size = 0; + if (NT_STATUS_IS_OK(c->status)) { + /* monitor message */ + msg.type = rpc_query_user; + msg.data = NULL; + msg.data_size = 0; + } break; case USERMOD_MODIFY: c->status = usermod_modify(c, s); - - /* monitor message */ - msg.type = rpc_set_user; - msg.data = NULL; - msg.data_size = 0; + + if (NT_STATUS_IS_OK(c->status)) { + /* monitor message */ + msg.type = rpc_set_user; + msg.data = NULL; + msg.data_size = 0; + } break; } -- cgit