r16476: Error in composite functions implemented the 'old way' (single event handler,
authorRafal Szczesniak <mimir@samba.org>
Thu, 22 Jun 2006 21:29:21 +0000 (21:29 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:09:30 +0000 (14:09 -0500)
no continue functions) need to report an error by means of state only.
composite_error calls event handler function which frees the context and
state structure. This fixes a segfault in some cases (caught it on modifyuser
test).

rafal
(This used to be commit 9e800fd0cfda9e731905fc0f19781def5cdba89f)

source4/libnet/userman.c

index 9c084eee4892820806a0d66ea183aae375a05a05..cd12ece0e828c7df4fc6e4c0b82af49d1634c172 100644 (file)
@@ -519,11 +519,13 @@ static NTSTATUS usermod_lookup(struct composite_context *c,
           and what if there's more than one rid resolved */
        if (!s->lookupname.out.rids.count) {
                c->status = NT_STATUS_NO_SUCH_USER;
-               composite_error(c, c->status);
+               c->state  = COMPOSITE_STATE_ERROR;
+               return c->status;
 
        } else if (!s->lookupname.out.rids.count > 1) {
                c->status = NT_STATUS_INVALID_ACCOUNT_NAME;
-               composite_error(c, c->status);
+               c->state  = COMPOSITE_STATE_ERROR;
+               return c->status;
        }
 
        /* prepare the next rpc call */