summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorRafal Szczesniak <mimir@samba.org>2005-07-25 22:57:14 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:30:03 -0500
commitb2ed6343cb4650537f199089432f5b6d96dccd6d (patch)
tree5b4ed4f873dcb9900c53b11d964cd915985e17d2 /source4
parenta04e899bc07825acecd0e1d3bd5e9898b52a0bd9 (diff)
downloadsamba-b2ed6343cb4650537f199089432f5b6d96dccd6d.tar.gz
samba-b2ed6343cb4650537f199089432f5b6d96dccd6d.tar.bz2
samba-b2ed6343cb4650537f199089432f5b6d96dccd6d.zip
r8761: Propagate changes in monitor messaging code.
rafal (This used to be commit 5be8479d5cf119bcda4046bf1c5d7c3b876e718d)
Diffstat (limited to 'source4')
-rw-r--r--source4/libnet/userinfo.c24
-rw-r--r--source4/libnet/userman.c8
-rw-r--r--source4/torture/libnet/userinfo.c14
-rw-r--r--source4/torture/libnet/userman.c6
4 files changed, 43 insertions, 9 deletions
diff --git a/source4/libnet/userinfo.c b/source4/libnet/userinfo.c
index 7fb6a83a06..def9c87147 100644
--- a/source4/libnet/userinfo.c
+++ b/source4/libnet/userinfo.c
@@ -28,6 +28,7 @@
#include "libcli/composite/monitor.h"
#include "librpc/gen_ndr/ndr_samr.h"
#include "libnet/composite.h"
+#include "libnet/userinfo.h"
static void userinfo_handler(struct rpc_request *req);
@@ -129,26 +130,41 @@ static void userinfo_handler(struct rpc_request *req)
struct composite_context *c = req->async.private;
struct userinfo_state *s = talloc_get_type(c->private, struct userinfo_state);
struct monitor_msg msg;
+ struct msg_rpc_open_user *msg_open;
+ struct msg_rpc_query_user *msg_query;
+ struct msg_rpc_close_user *msg_close;
/* Stages of the call */
switch (s->stage) {
case USERINFO_OPENUSER:
c->status = userinfo_openuser(c, s);
+
msg.type = rpc_open_user;
- msg.data.rpc_open_user.rid = s->openuser.in.rid;
- msg.data.rpc_open_user.access_mask = s->openuser.in.access_mask;
+ msg_open = talloc(s, struct msg_rpc_open_user);
+ msg_open->rid = s->openuser.in.rid;
+ msg_open->access_mask = s->openuser.in.access_mask;
+ msg.data = (void*)msg_open;
+ msg.data_size = sizeof(*msg_open);
break;
case USERINFO_GETUSER:
c->status = userinfo_getuser(c, s);
+
msg.type = rpc_query_user;
- msg.data.rpc_query_user.level = s->queryuserinfo.in.level;
+ msg_query = talloc(s, struct msg_rpc_query_user);
+ msg_query->level = s->queryuserinfo.in.level;
+ msg.data = (void*)msg_query;
+ msg.data_size = sizeof(*msg_query);
break;
case USERINFO_CLOSEUSER:
c->status = userinfo_closeuser(c, s);
+
msg.type = rpc_close_user;
- msg.data.rpc_close_user.rid = s->openuser.in.rid;
+ msg_close = talloc(s, struct msg_rpc_close_user);
+ msg_close->rid = s->openuser.in.rid;
+ msg.data = (void*)msg_close;
+ msg.data_size = sizeof(*msg_close);
break;
}
diff --git a/source4/libnet/userman.c b/source4/libnet/userman.c
index c3d1435dfe..1a40b74352 100644
--- a/source4/libnet/userman.c
+++ b/source4/libnet/userman.c
@@ -28,6 +28,7 @@
#include "libcli/composite/monitor.h"
#include "librpc/gen_ndr/ndr_samr.h"
#include "libnet/composite.h"
+#include "libnet/userman.h"
/*
* Composite user add function
@@ -73,12 +74,17 @@ 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;
+ struct msg_rpc_create_user *rpc_create;
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;
+ rpc_create = talloc(s, struct msg_rpc_create_user);
+ rpc_create->rid = *s->createuser.out.rid;
+ msg.data = (void*)rpc_create;
+ msg.data_size = sizeof(*rpc_create);
break;
}
diff --git a/source4/torture/libnet/userinfo.c b/source4/torture/libnet/userinfo.c
index 2dd60b02f1..aa1e64301a 100644
--- a/source4/torture/libnet/userinfo.c
+++ b/source4/torture/libnet/userinfo.c
@@ -22,6 +22,7 @@
#include "includes.h"
#include "librpc/gen_ndr/ndr_samr.h"
#include "libnet/composite.h"
+#include "libnet/userinfo.h"
#include "libcli/composite/monitor.h"
#define TEST_USERNAME "libnetuserinfotest"
@@ -206,16 +207,23 @@ static BOOL test_userinfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
static void msg_handler(struct monitor_msg *m)
{
+ struct msg_rpc_open_user *msg_open;
+ struct msg_rpc_query_user *msg_query;
+ struct msg_rpc_close_user *msg_close;
+
switch (m->type) {
case rpc_open_user:
+ msg_open = (struct msg_rpc_open_user*)m->data;
printf("monitor_msg: user opened (rid=%d, access_mask=0x%08x)\n",
- m->data.rpc_open_user.rid, m->data.rpc_open_user.access_mask);
+ msg_open->rid, msg_open->access_mask);
break;
case rpc_query_user:
- printf("monitor_msg: user queried (level=%d)\n", m->data.rpc_query_user.level);
+ msg_query = (struct msg_rpc_query_user*)m->data;
+ printf("monitor_msg: user queried (level=%d)\n", msg_query->level);
break;
case rpc_close_user:
- printf("monitor_msg: user closed (rid=%d)\n", m->data.rpc_close_user.rid);
+ msg_close = (struct msg_rpc_close_user*)m->data;
+ printf("monitor_msg: user closed (rid=%d)\n", msg_close->rid);
break;
}
}
diff --git a/source4/torture/libnet/userman.c b/source4/torture/libnet/userman.c
index 1da57e2b35..0441a99a54 100644
--- a/source4/torture/libnet/userman.c
+++ b/source4/torture/libnet/userman.c
@@ -22,6 +22,7 @@
#include "includes.h"
#include "librpc/gen_ndr/ndr_samr.h"
#include "libnet/composite.h"
+#include "libnet/userman.h"
#include "libcli/composite/monitor.h"
#define TEST_USERNAME "libnetusermantest"
@@ -103,9 +104,12 @@ static BOOL test_useradd(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
static void msg_handler(struct monitor_msg *m)
{
+ struct msg_rpc_create_user *msg_create;
+
switch (m->type) {
case rpc_create_user:
- printf("monitor_msg: user created (rid=%d)\n", m->data.rpc_create_user.rid);
+ msg_create = (struct msg_rpc_create_user*)m->data;
+ printf("monitor_msg: user created (rid=%d)\n", msg_create->rid);
break;
}
}