summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorRafal Szczesniak <mimir@samba.org>2005-04-21 23:25:38 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:11:36 -0500
commit622554452bf810d3489bf4a1052147e22cf49477 (patch)
tree16aa7d4d462b90030a7801ba6a7a83367cd50e3f /source4
parentf6e585d69bda48ef7625ce57b78978f77bb9c04c (diff)
downloadsamba-622554452bf810d3489bf4a1052147e22cf49477.tar.gz
samba-622554452bf810d3489bf4a1052147e22cf49477.tar.bz2
samba-622554452bf810d3489bf4a1052147e22cf49477.zip
r6424: More comments and fixes to existing ones.
rafal (This used to be commit 25dd10cedb7247ec90dface59df8704c97e667b8)
Diffstat (limited to 'source4')
-rw-r--r--source4/libnet/userman.c43
1 files changed, 39 insertions, 4 deletions
diff --git a/source4/libnet/userman.c b/source4/libnet/userman.c
index 9a8c1d6035..51bcdc885e 100644
--- a/source4/libnet/userman.c
+++ b/source4/libnet/userman.c
@@ -95,6 +95,7 @@ static void useradd_handler(struct rpc_request *req)
* @param p dce/rpc call pipe
* @param io arguments and results of the call
*/
+
struct composite_context *rpc_composite_useradd_send(struct dcerpc_pipe *p,
struct rpc_composite_useradd *io)
{
@@ -141,7 +142,7 @@ failure:
/**
* Waits for and receives result of asynchronous useradd call
*
- * @param c composite context returned by asynchronous userinfo call
+ * @param c composite context returned by asynchronous useradd call
* @param mem_ctx memory context of the call
* @param io pointer to results (and arguments) of the call
* @return nt status code of execution
@@ -185,7 +186,7 @@ NTSTATUS rpc_composite_useradd(struct dcerpc_pipe *pipe,
/*
- * Composite user del function
+ * Composite user delete function
*/
static void userdel_handler(struct rpc_request*);
@@ -204,6 +205,9 @@ struct userdel_state {
};
+/**
+ * Stage 1: Lookup the user name and resolve it to rid
+ */
static NTSTATUS userdel_lookup(struct composite_context *c,
struct userdel_state *s)
{
@@ -239,6 +243,9 @@ failure:
}
+/**
+ * Stage 2: Open user account.
+ */
static NTSTATUS userdel_open(struct composite_context *c,
struct userdel_state *s)
{
@@ -260,6 +267,9 @@ static NTSTATUS userdel_open(struct composite_context *c,
}
+/**
+ * Stage 3: Delete user account
+ */
static NTSTATUS userdel_delete(struct composite_context *c,
struct userdel_state *s)
{
@@ -274,6 +284,12 @@ static NTSTATUS userdel_delete(struct composite_context *c,
}
+/**
+ * Event handler for asynchronous request. Handles transition through
+ * intermediate stages of the call.
+ *
+ * @param req rpc call context
+ */
static void userdel_handler(struct rpc_request *req)
{
struct composite_context *c = req->async.private;
@@ -302,6 +318,13 @@ static void userdel_handler(struct rpc_request *req)
}
+/**
+ * Sends asynchronous userdel request
+ *
+ * @param p dce/rpc call pipe
+ * @param io arguments and results of the call
+ */
+
struct composite_context *rpc_composite_userdel_send(struct dcerpc_pipe *p,
struct rpc_composite_userdel *io)
{
@@ -320,14 +343,17 @@ struct composite_context *rpc_composite_userdel_send(struct dcerpc_pipe *p,
s->pipe = p;
s->domain_handle = io->in.domain_handle;
-
+
+ /* preparing parameters to send rpc request */
s->lookupname.in.domain_handle = &io->in.domain_handle;
s->lookupname.in.num_names = 1;
s->lookupname.in.names = talloc_zero(s, struct samr_String);
s->lookupname.in.names->string = io->in.username;
+ /* send the request */
s->req = dcerpc_samr_LookupNames_send(p, c, &s->lookupname);
-
+
+ /* callback handler */
s->req->async.callback = userdel_handler;
s->req->async.private = c;
s->stage = USERDEL_LOOKUP;
@@ -340,6 +366,15 @@ failure:
}
+/**
+ * Waits for and receives results of asynchronous userdel call
+ *
+ * @param c composite context returned by asynchronous userdel call
+ * @param mem_ctx memory context of the call
+ * @param io pointer to results (and arguments) of the call
+ * @return nt status code of execution
+ */
+
NTSTATUS rpc_composite_userdel_recv(struct composite_context *c, TALLOC_CTX *mem_ctx,
struct rpc_composite_userdel *io)
{