s4-lsa: merge lsa_QueryTrustedDomainInfoBySid from s3 lsa idl.
authorGünther Deschner <gd@samba.org>
Tue, 21 Oct 2008 00:34:45 +0000 (02:34 +0200)
committerGünther Deschner <gd@samba.org>
Mon, 27 Oct 2008 18:33:22 +0000 (19:33 +0100)
Guenther

source4/librpc/idl/lsa.idl
source4/rpc_server/lsa/dcesrv_lsa.c
source4/torture/rpc/lsa.c
source4/torture/rpc/lsa_lookup.c

index 0f22ca7de18f927de0f8127a150b84135448f4c5..9cc39d8d2ede041a0546cc91dfb2d050b34c4479 100644 (file)
@@ -835,9 +835,9 @@ import "misc.idl", "security.idl";
        /* Function:   0x27 */
        NTSTATUS lsa_QueryTrustedDomainInfoBySid(
                [in]               policy_handle         *handle,
-               [in]               dom_sid2              *dom_sid,
+               [in,ref]           dom_sid2              *dom_sid,
                [in]               lsa_TrustDomInfoEnum  level,
-               [out,switch_is(level),unique] lsa_TrustedDomainInfo *info
+               [out,switch_is(level),ref] lsa_TrustedDomainInfo **info
         );
 
        /* Function:     0x28 */
index d88a87632a68349ac0bbf8b145d5795894fadf3a..9989e031de150275069bc8786ffc3c9eeca06072 100644 (file)
@@ -1426,12 +1426,12 @@ static NTSTATUS dcesrv_lsa_QueryTrustedDomainInfoBySid(struct dcesrv_call_state
        
        query.in.trustdom_handle = open.out.trustdom_handle;
        query.in.level = r->in.level;
+       query.out.info = r->out.info;
        status = dcesrv_lsa_QueryTrustedDomainInfo(dce_call, mem_ctx, &query);
        if (!NT_STATUS_IS_OK(status)) {
                return status;
        }
-       
-       r->out.info = query.out.info;
+
        return NT_STATUS_OK;
 }
 
index e065c294d9e98fb9d753a98e6ac3b817ed79bb89..34e3c1b78d26c0b8ad5c79def335571c39faec2e 100644 (file)
@@ -1838,7 +1838,7 @@ static bool test_query_each_TrustDom(struct dcerpc_pipe *p,
 
                        for (j=0; j < ARRAY_SIZE(levels); j++) {
                                struct lsa_QueryTrustedDomainInfoBySid q;
-                               union lsa_TrustedDomainInfo info;
+                               union lsa_TrustedDomainInfo *info = NULL;
                                
                                if (!domains->domains[i].sid) {
                                        continue;
@@ -1848,6 +1848,7 @@ static bool test_query_each_TrustDom(struct dcerpc_pipe *p,
                                q.in.dom_sid = domains->domains[i].sid;
                                q.in.level   = levels[j];
                                q.out.info   = &info;
+
                                status = dcerpc_lsa_QueryTrustedDomainInfoBySid(p, mem_ctx, &q);
                                if (!NT_STATUS_IS_OK(status) && ok[j]) {
                                        printf("QueryTrustedDomainInfoBySid level %d failed - %s\n", 
index 9c817a7061cf7691c8a4336a3554cdaa4e39297d..beb299b5974438b241d8d52c1ccafcc7fdbe1681 100644 (file)
@@ -192,6 +192,7 @@ static bool get_downleveltrust(struct torture_context *tctx, struct dcerpc_pipe
 
        for (i=0; i<domains.count; i++) {
                struct lsa_QueryTrustedDomainInfoBySid q;
+               union lsa_TrustedDomainInfo *info = NULL;
 
                if (domains.domains[i].sid == NULL)
                        continue;
@@ -199,11 +200,13 @@ static bool get_downleveltrust(struct torture_context *tctx, struct dcerpc_pipe
                q.in.handle = handle;
                q.in.dom_sid = domains.domains[i].sid;
                q.in.level = 6;
+               q.out.info = &info;
+
                status = dcerpc_lsa_QueryTrustedDomainInfoBySid(p, tctx, &q);
                if (!NT_STATUS_IS_OK(status)) continue;
 
-               if ((q.out.info->info_ex.trust_direction & 2) &&
-                   (q.out.info->info_ex.trust_type == 1)) {
+               if ((info->info_ex.trust_direction & 2) &&
+                   (info->info_ex.trust_type == 1)) {
                        *sid = domains.domains[i].sid;
                        return true;
                }