s4-samr: merge samr_QueryGroupInfo from s3 idl. (fixme python)
authorGünther Deschner <gd@samba.org>
Mon, 10 Nov 2008 13:15:33 +0000 (14:15 +0100)
committerGünther Deschner <gd@samba.org>
Mon, 10 Nov 2008 20:46:30 +0000 (21:46 +0100)
Guenther

librpc/idl/samr.idl
source4/libnet/groupinfo.c
source4/rpc_server/samr/dcesrv_samr.c
source4/torture/rpc/samr.c
source4/torture/rpc/samsync.c

index d7b9423c1528db45a30fb9b12295a2400943cbc0..7fc3d2d6091cbdf57ad1f1786b7bf46be8e597c3 100644 (file)
@@ -589,7 +589,7 @@ import "misc.idl", "lsa.idl", "security.idl";
        NTSTATUS samr_QueryGroupInfo(
                [in,ref]                  policy_handle *group_handle,
                [in]                      samr_GroupInfoEnum level,
-               [out,switch_is(level),unique] samr_GroupInfo *info
+               [out,ref,switch_is(level)] samr_GroupInfo **info
                );
 
        /************************/
index 1fb52a27bc4319e8c51a9ffde3607005f7d940ae..5c94c34b1dd8dfc1064622c22a117d06072afa4c 100644 (file)
@@ -152,6 +152,8 @@ static void continue_groupinfo_opengroup(struct rpc_request *req)
        /* prepare parameters for QueryGroupInfo call */
        s->querygroupinfo.in.group_handle = &s->group_handle;
        s->querygroupinfo.in.level        = s->level;
+       s->querygroupinfo.out.info        = talloc(s, union samr_GroupInfo *);
+       if (composite_nomem(s->querygroupinfo.out.info, c)) return;
        
        /* queue rpc call, set event handling and new state */
        querygroup_req = dcerpc_samr_QueryGroupInfo_send(s->pipe, c, &s->querygroupinfo);
@@ -185,7 +187,7 @@ static void continue_groupinfo_getgroup(struct rpc_request *req)
                return;
        }
 
-       s->info = talloc_steal(s, s->querygroupinfo.out.info);
+       s->info = talloc_steal(s, *s->querygroupinfo.out.info);
 
        /* issue a monitor message */
        if (s->monitor_fn) {
index 3585c1ac6919cc447858de5e585ee8e903c50531..53e4c28f8d977f42f3c7bbfa174674cd9d0ac713 100644 (file)
@@ -2129,7 +2129,7 @@ static NTSTATUS dcesrv_samr_QueryGroupInfo(struct dcesrv_call_state *dce_call, T
        int ret;
        union samr_GroupInfo *info;
 
-       r->out.info = NULL;
+       *r->out.info = NULL;
 
        DCESRV_PULL_HANDLE(h, r->in.group_handle, SAMR_HANDLE_GROUP);
 
@@ -2185,7 +2185,7 @@ static NTSTATUS dcesrv_samr_QueryGroupInfo(struct dcesrv_call_state *dce_call, T
                return NT_STATUS_INVALID_INFO_CLASS;
        }
 
-       r->out.info = info;
+       *r->out.info = info;
 
        return NT_STATUS_OK;
 }
index 493f3bef3e1c295c3c5d4edca301991117132cf6..a733063752227048c3f1c896cf19447c6ae1c7bc 100644 (file)
@@ -2966,6 +2966,7 @@ static bool test_QueryGroupInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
 {
        NTSTATUS status;
        struct samr_QueryGroupInfo r;
+       union samr_GroupInfo *info;
        uint16_t levels[] = {1, 2, 3, 4, 5};
        int i;
        bool ret = true;
@@ -2975,6 +2976,7 @@ static bool test_QueryGroupInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
 
                r.in.group_handle = handle;
                r.in.level = levels[i];
+               r.out.info = &info;
 
                status = dcerpc_samr_QueryGroupInfo(p, mem_ctx, &r);
                if (!NT_STATUS_IS_OK(status)) {
@@ -3015,6 +3017,7 @@ static bool test_SetGroupInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
 {
        NTSTATUS status;
        struct samr_QueryGroupInfo r;
+       union samr_GroupInfo *info;
        struct samr_SetGroupInfo s;
        uint16_t levels[] = {1, 2, 3, 4};
        uint16_t set_ok[] = {0, 1, 1, 1};
@@ -3026,6 +3029,7 @@ static bool test_SetGroupInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
 
                r.in.group_handle = handle;
                r.in.level = levels[i];
+               r.out.info = &info;
 
                status = dcerpc_samr_QueryGroupInfo(p, mem_ctx, &r);
                if (!NT_STATUS_IS_OK(status)) {
@@ -3038,7 +3042,7 @@ static bool test_SetGroupInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
 
                s.in.group_handle = handle;
                s.in.level = levels[i];
-               s.in.info = r.out.info;
+               s.in.info = *r.out.info;
 
 #if 0
                /* disabled this, as it changes the name only from the point of view of samr, 
index 1838e01b7fd5241eaab86640181792d04ef00cac..f6c9744449e8400c039c64b89be7037616d6b92c 100644 (file)
@@ -781,6 +781,7 @@ static bool samsync_handle_group(TALLOC_CTX *mem_ctx, struct samsync_state *sams
 
        struct samr_OpenGroup r;
        struct samr_QueryGroupInfo q;
+       union samr_GroupInfo *info;
        struct policy_handle group_handle;
 
        if (!samsync_state->domain_name || !samsync_state->domain_handle[database_id]) {
@@ -801,6 +802,7 @@ static bool samsync_handle_group(TALLOC_CTX *mem_ctx, struct samsync_state *sams
 
        q.in.group_handle = &group_handle;
        q.in.level = 1;
+       q.out.info = &info;
 
        TEST_SEC_DESC_EQUAL(group->sdbuf, samr, &group_handle);
 
@@ -815,9 +817,9 @@ static bool samsync_handle_group(TALLOC_CTX *mem_ctx, struct samsync_state *sams
                return false;
        }
 
-       TEST_STRING_EQUAL(q.out.info->all.name, group->group_name);
-       TEST_INT_EQUAL(q.out.info->all.attributes, group->attributes);
-       TEST_STRING_EQUAL(q.out.info->all.description, group->description);
+       TEST_STRING_EQUAL(info->all.name, group->group_name);
+       TEST_INT_EQUAL(info->all.attributes, group->attributes);
+       TEST_STRING_EQUAL(info->all.description, group->description);
        return ret;
 }