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

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

index ba813b730f6cd69179d9f0d4d71f6f3130c6b82e..d7b9423c1528db45a30fb9b12295a2400943cbc0 100644 (file)
@@ -686,7 +686,7 @@ import "misc.idl", "lsa.idl", "security.idl";
        NTSTATUS samr_QueryAliasInfo(
                [in,ref]                  policy_handle  *alias_handle,
                [in]                      samr_AliasInfoEnum      level,
-               [out,switch_is(level),unique] samr_AliasInfo *info
+               [out,ref,switch_is(level)] samr_AliasInfo **info
                );
 
        /************************/
index 2a3666b09b291637b6540e78a416298ea6fcca52..3585c1ac6919cc447858de5e585ee8e903c50531 100644 (file)
@@ -2602,7 +2602,7 @@ static NTSTATUS dcesrv_samr_QueryAliasInfo(struct dcesrv_call_state *dce_call, T
        int ret;
        union samr_AliasInfo *info;
 
-       r->out.info = NULL;
+       *r->out.info = NULL;
 
        DCESRV_PULL_HANDLE(h, r->in.alias_handle, SAMR_HANDLE_ALIAS);
 
@@ -2639,7 +2639,7 @@ static NTSTATUS dcesrv_samr_QueryAliasInfo(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 24d16ceeb32bfc6b750bc082903ddf57aafe5c5e..493f3bef3e1c295c3c5d4edca301991117132cf6 100644 (file)
@@ -845,6 +845,7 @@ static bool test_SetAliasInfo(struct dcerpc_pipe *p, struct torture_context *tct
        NTSTATUS status;
        struct samr_SetAliasInfo r;
        struct samr_QueryAliasInfo q;
+       union samr_AliasInfo *info;
        uint16_t levels[] = {2, 3};
        int i;
        bool ret = true;
@@ -875,6 +876,7 @@ static bool test_SetAliasInfo(struct dcerpc_pipe *p, struct torture_context *tct
 
                q.in.alias_handle = handle;
                q.in.level = levels[i];
+               q.out.info = &info;
 
                status = dcerpc_samr_QueryAliasInfo(p, tctx, &q);
                if (!NT_STATUS_IS_OK(status)) {
@@ -2936,6 +2938,7 @@ static bool test_QueryAliasInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
 {
        NTSTATUS status;
        struct samr_QueryAliasInfo r;
+       union samr_AliasInfo *info;
        uint16_t levels[] = {1, 2, 3};
        int i;
        bool ret = true;
@@ -2945,6 +2948,7 @@ static bool test_QueryAliasInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
 
                r.in.alias_handle = handle;
                r.in.level = levels[i];
+               r.out.info = &info;
 
                status = dcerpc_samr_QueryAliasInfo(p, mem_ctx, &r);
                if (!NT_STATUS_IS_OK(status)) {
index 64612e21e4b79dd92ca3d4b4396b245dd79e9da1..1838e01b7fd5241eaab86640181792d04ef00cac 100644 (file)
@@ -730,6 +730,7 @@ static bool samsync_handle_alias(TALLOC_CTX *mem_ctx, struct samsync_state *sams
 
        struct samr_OpenAlias r;
        struct samr_QueryAliasInfo q;
+       union samr_AliasInfo *info;
        struct policy_handle alias_handle;
 
        if (!samsync_state->domain_name || !samsync_state->domain_handle[database_id]) {
@@ -750,6 +751,7 @@ static bool samsync_handle_alias(TALLOC_CTX *mem_ctx, struct samsync_state *sams
 
        q.in.alias_handle = &alias_handle;
        q.in.level = 1;
+       q.out.info = &info;
 
        TEST_SEC_DESC_EQUAL(alias->sdbuf, samr, &alias_handle);
 
@@ -764,8 +766,8 @@ static bool samsync_handle_alias(TALLOC_CTX *mem_ctx, struct samsync_state *sams
                return false;
        }
 
-       TEST_STRING_EQUAL(q.out.info->all.name, alias->alias_name);
-       TEST_STRING_EQUAL(q.out.info->all.description, alias->description);
+       TEST_STRING_EQUAL(info->all.name, alias->alias_name);
+       TEST_STRING_EQUAL(info->all.description, alias->description);
        return ret;
 }