The branch, master has been updated
       via  2070c04... s4-smbtorture: add lsa_SetTrustedDomainInfoByName NDR 
test.
       via  0e47277... s3: re-run make samba3-idl.
       via  4f28afc... lsa: fix IDL for lsa_SetTrustedDomainInfoByName.
      from  f989410... Fix developer build, remove malloc

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 2070c042305eb14bac5182d7a061aaf38086f3f3
Author: Günther Deschner <g...@samba.org>
Date:   Tue Mar 16 21:50:07 2010 +0100

    s4-smbtorture: add lsa_SetTrustedDomainInfoByName NDR test.
    
    Thanks Simo for providing the data and pointing out the IDL failure.
    
    Guenther

commit 0e47277dd7305c7add269ebe41820780ea4ab6bf
Author: Günther Deschner <g...@samba.org>
Date:   Tue Mar 16 21:15:50 2010 +0100

    s3: re-run make samba3-idl.
    
    Guenther

commit 4f28afc929eadd8a7ae4448a815b5a0cc381750a
Author: Günther Deschner <g...@samba.org>
Date:   Tue Mar 16 21:14:45 2010 +0100

    lsa: fix IDL for lsa_SetTrustedDomainInfoByName.
    
    Guenther

-----------------------------------------------------------------------

Summary of changes:
 librpc/gen_ndr/cli_lsa.c  |    8 ++--
 librpc/gen_ndr/cli_lsa.h  |    8 ++--
 librpc/gen_ndr/lsa.h      |    4 +-
 librpc/gen_ndr/ndr_lsa.c  |   55 +++++++++++++-----------
 librpc/gen_ndr/ndr_lsa.h  |    2 +
 librpc/idl/lsa.idl        |    6 +-
 source4/torture/ndr/lsa.c |  102 ++++++++++++++++++++++++++++++++++++++++++++-
 7 files changed, 146 insertions(+), 39 deletions(-)


Changeset truncated at 500 lines:

diff --git a/librpc/gen_ndr/cli_lsa.c b/librpc/gen_ndr/cli_lsa.c
index c75fb8f..7945ee9 100644
--- a/librpc/gen_ndr/cli_lsa.c
+++ b/librpc/gen_ndr/cli_lsa.c
@@ -7274,9 +7274,9 @@ struct tevent_req 
*rpccli_lsa_SetTrustedDomainInfoByName_send(TALLOC_CTX *mem_ct
                                                              struct 
tevent_context *ev,
                                                              struct 
rpc_pipe_client *cli,
                                                              struct 
policy_handle *_handle /* [in] [ref] */,
-                                                             struct lsa_String 
_trusted_domain /* [in]  */,
+                                                             struct lsa_String 
*_trusted_domain /* [in] [ref] */,
                                                              enum 
lsa_TrustDomInfoEnum _level /* [in]  */,
-                                                             union 
lsa_TrustedDomainInfo *_info /* [in] [unique,switch_is(level)] */)
+                                                             union 
lsa_TrustedDomainInfo *_info /* [in] [ref,switch_is(level)] */)
 {
        struct tevent_req *req;
        struct rpccli_lsa_SetTrustedDomainInfoByName_state *state;
@@ -7374,9 +7374,9 @@ NTSTATUS 
rpccli_lsa_SetTrustedDomainInfoByName_recv(struct tevent_req *req,
 NTSTATUS rpccli_lsa_SetTrustedDomainInfoByName(struct rpc_pipe_client *cli,
                                               TALLOC_CTX *mem_ctx,
                                               struct policy_handle *handle /* 
[in] [ref] */,
-                                              struct lsa_String trusted_domain 
/* [in]  */,
+                                              struct lsa_String 
*trusted_domain /* [in] [ref] */,
                                               enum lsa_TrustDomInfoEnum level 
/* [in]  */,
-                                              union lsa_TrustedDomainInfo 
*info /* [in] [unique,switch_is(level)] */)
+                                              union lsa_TrustedDomainInfo 
*info /* [in] [ref,switch_is(level)] */)
 {
        struct lsa_SetTrustedDomainInfoByName r;
        NTSTATUS status;
diff --git a/librpc/gen_ndr/cli_lsa.h b/librpc/gen_ndr/cli_lsa.h
index 3caeb84..b38a4a2 100644
--- a/librpc/gen_ndr/cli_lsa.h
+++ b/librpc/gen_ndr/cli_lsa.h
@@ -699,18 +699,18 @@ struct tevent_req 
*rpccli_lsa_SetTrustedDomainInfoByName_send(TALLOC_CTX *mem_ct
                                                              struct 
tevent_context *ev,
                                                              struct 
rpc_pipe_client *cli,
                                                              struct 
policy_handle *_handle /* [in] [ref] */,
-                                                             struct lsa_String 
_trusted_domain /* [in]  */,
+                                                             struct lsa_String 
*_trusted_domain /* [in] [ref] */,
                                                              enum 
lsa_TrustDomInfoEnum _level /* [in]  */,
-                                                             union 
lsa_TrustedDomainInfo *_info /* [in] [unique,switch_is(level)] */);
+                                                             union 
lsa_TrustedDomainInfo *_info /* [in] [ref,switch_is(level)] */);
 NTSTATUS rpccli_lsa_SetTrustedDomainInfoByName_recv(struct tevent_req *req,
                                                    TALLOC_CTX *mem_ctx,
                                                    NTSTATUS *result);
 NTSTATUS rpccli_lsa_SetTrustedDomainInfoByName(struct rpc_pipe_client *cli,
                                               TALLOC_CTX *mem_ctx,
                                               struct policy_handle *handle /* 
[in] [ref] */,
-                                              struct lsa_String trusted_domain 
/* [in]  */,
+                                              struct lsa_String 
*trusted_domain /* [in] [ref] */,
                                               enum lsa_TrustDomInfoEnum level 
/* [in]  */,
-                                              union lsa_TrustedDomainInfo 
*info /* [in] [unique,switch_is(level)] */);
+                                              union lsa_TrustedDomainInfo 
*info /* [in] [ref,switch_is(level)] */);
 struct tevent_req *rpccli_lsa_EnumTrustedDomainsEx_send(TALLOC_CTX *mem_ctx,
                                                        struct tevent_context 
*ev,
                                                        struct rpc_pipe_client 
*cli,
diff --git a/librpc/gen_ndr/lsa.h b/librpc/gen_ndr/lsa.h
index 82c377f..a03fdc2 100644
--- a/librpc/gen_ndr/lsa.h
+++ b/librpc/gen_ndr/lsa.h
@@ -1513,9 +1513,9 @@ struct lsa_QueryTrustedDomainInfoByName {
 struct lsa_SetTrustedDomainInfoByName {
        struct {
                struct policy_handle *handle;/* [ref] */
-               struct lsa_String trusted_domain;
+               struct lsa_String *trusted_domain;/* [ref] */
                enum lsa_TrustDomInfoEnum level;
-               union lsa_TrustedDomainInfo *info;/* [unique,switch_is(level)] 
*/
+               union lsa_TrustedDomainInfo *info;/* [ref,switch_is(level)] */
        } in;
 
        struct {
diff --git a/librpc/gen_ndr/ndr_lsa.c b/librpc/gen_ndr/ndr_lsa.c
index 4389b95..9d1fb09 100644
--- a/librpc/gen_ndr/ndr_lsa.c
+++ b/librpc/gen_ndr/ndr_lsa.c
@@ -10623,20 +10623,23 @@ _PUBLIC_ void 
ndr_print_lsa_QueryTrustedDomainInfoByName(struct ndr_print *ndr,
        ndr->depth--;
 }
 
-static enum ndr_err_code ndr_push_lsa_SetTrustedDomainInfoByName(struct 
ndr_push *ndr, int flags, const struct lsa_SetTrustedDomainInfoByName *r)
+_PUBLIC_ enum ndr_err_code ndr_push_lsa_SetTrustedDomainInfoByName(struct 
ndr_push *ndr, int flags, const struct lsa_SetTrustedDomainInfoByName *r)
 {
        if (flags & NDR_IN) {
                if (r->in.handle == NULL) {
                        return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, 
"NULL [ref] pointer");
                }
                NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, 
r->in.handle));
-               NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, 
&r->in.trusted_domain));
+               if (r->in.trusted_domain == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, 
"NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, 
r->in.trusted_domain));
                NDR_CHECK(ndr_push_lsa_TrustDomInfoEnum(ndr, NDR_SCALARS, 
r->in.level));
-               NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.info));
-               if (r->in.info) {
-                       NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.info, 
r->in.level));
-                       NDR_CHECK(ndr_push_lsa_TrustedDomainInfo(ndr, 
NDR_SCALARS|NDR_BUFFERS, r->in.info));
+               if (r->in.info == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, 
"NULL [ref] pointer");
                }
+               NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.info, 
r->in.level));
+               NDR_CHECK(ndr_push_lsa_TrustedDomainInfo(ndr, 
NDR_SCALARS|NDR_BUFFERS, r->in.info));
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
@@ -10644,10 +10647,10 @@ static enum ndr_err_code 
ndr_push_lsa_SetTrustedDomainInfoByName(struct ndr_push
        return NDR_ERR_SUCCESS;
 }
 
-static enum ndr_err_code ndr_pull_lsa_SetTrustedDomainInfoByName(struct 
ndr_pull *ndr, int flags, struct lsa_SetTrustedDomainInfoByName *r)
+_PUBLIC_ enum ndr_err_code ndr_pull_lsa_SetTrustedDomainInfoByName(struct 
ndr_pull *ndr, int flags, struct lsa_SetTrustedDomainInfoByName *r)
 {
-       uint32_t _ptr_info;
        TALLOC_CTX *_mem_save_handle_0;
+       TALLOC_CTX *_mem_save_trusted_domain_0;
        TALLOC_CTX *_mem_save_info_0;
        if (flags & NDR_IN) {
                if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
@@ -10657,21 +10660,22 @@ static enum ndr_err_code 
ndr_pull_lsa_SetTrustedDomainInfoByName(struct ndr_pull
                NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, 
r->in.handle));
                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, 
LIBNDR_FLAG_REF_ALLOC);
-               NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, 
&r->in.trusted_domain));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->in.trusted_domain);
+               }
+               _mem_save_trusted_domain_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->in.trusted_domain, 
LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_lsa_String(ndr, NDR_SCALARS|NDR_BUFFERS, 
r->in.trusted_domain));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusted_domain_0, 
LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_lsa_TrustDomInfoEnum(ndr, NDR_SCALARS, 
&r->in.level));
-               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
-               if (_ptr_info) {
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
                        NDR_PULL_ALLOC(ndr, r->in.info);
-               } else {
-                       r->in.info = NULL;
-               }
-               if (r->in.info) {
-                       _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
-                       NDR_PULL_SET_MEM_CTX(ndr, r->in.info, 0);
-                       NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, 
r->in.level));
-                       NDR_CHECK(ndr_pull_lsa_TrustedDomainInfo(ndr, 
NDR_SCALARS|NDR_BUFFERS, r->in.info));
-                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0);
                }
+               _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->in.info, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.info, 
r->in.level));
+               NDR_CHECK(ndr_pull_lsa_TrustedDomainInfo(ndr, 
NDR_SCALARS|NDR_BUFFERS, r->in.info));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 
LIBNDR_FLAG_REF_ALLOC);
        }
        if (flags & NDR_OUT) {
                NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
@@ -10693,14 +10697,15 @@ _PUBLIC_ void 
ndr_print_lsa_SetTrustedDomainInfoByName(struct ndr_print *ndr, co
                ndr->depth++;
                ndr_print_policy_handle(ndr, "handle", r->in.handle);
                ndr->depth--;
-               ndr_print_lsa_String(ndr, "trusted_domain", 
&r->in.trusted_domain);
+               ndr_print_ptr(ndr, "trusted_domain", r->in.trusted_domain);
+               ndr->depth++;
+               ndr_print_lsa_String(ndr, "trusted_domain", 
r->in.trusted_domain);
+               ndr->depth--;
                ndr_print_lsa_TrustDomInfoEnum(ndr, "level", r->in.level);
                ndr_print_ptr(ndr, "info", r->in.info);
                ndr->depth++;
-               if (r->in.info) {
-                       ndr_print_set_switch_value(ndr, r->in.info, 
r->in.level);
-                       ndr_print_lsa_TrustedDomainInfo(ndr, "info", 
r->in.info);
-               }
+               ndr_print_set_switch_value(ndr, r->in.info, r->in.level);
+               ndr_print_lsa_TrustedDomainInfo(ndr, "info", r->in.info);
                ndr->depth--;
                ndr->depth--;
        }
diff --git a/librpc/gen_ndr/ndr_lsa.h b/librpc/gen_ndr/ndr_lsa.h
index 5ff7451..c6bfa71 100644
--- a/librpc/gen_ndr/ndr_lsa.h
+++ b/librpc/gen_ndr/ndr_lsa.h
@@ -373,6 +373,8 @@ void ndr_print_lsa_GetUserName(struct ndr_print *ndr, const 
char *name, int flag
 void ndr_print_lsa_QueryInfoPolicy2(struct ndr_print *ndr, const char *name, 
int flags, const struct lsa_QueryInfoPolicy2 *r);
 void ndr_print_lsa_SetInfoPolicy2(struct ndr_print *ndr, const char *name, int 
flags, const struct lsa_SetInfoPolicy2 *r);
 void ndr_print_lsa_QueryTrustedDomainInfoByName(struct ndr_print *ndr, const 
char *name, int flags, const struct lsa_QueryTrustedDomainInfoByName *r);
+enum ndr_err_code ndr_push_lsa_SetTrustedDomainInfoByName(struct ndr_push 
*ndr, int flags, const struct lsa_SetTrustedDomainInfoByName *r);
+enum ndr_err_code ndr_pull_lsa_SetTrustedDomainInfoByName(struct ndr_pull 
*ndr, int flags, struct lsa_SetTrustedDomainInfoByName *r);
 void ndr_print_lsa_SetTrustedDomainInfoByName(struct ndr_print *ndr, const 
char *name, int flags, const struct lsa_SetTrustedDomainInfoByName *r);
 void ndr_print_lsa_EnumTrustedDomainsEx(struct ndr_print *ndr, const char 
*name, int flags, const struct lsa_EnumTrustedDomainsEx *r);
 void ndr_print_lsa_CreateTrustedDomainEx(struct ndr_print *ndr, const char 
*name, int flags, const struct lsa_CreateTrustedDomainEx *r);
diff --git a/librpc/idl/lsa.idl b/librpc/idl/lsa.idl
index 6c4b439..3560fa1 100644
--- a/librpc/idl/lsa.idl
+++ b/librpc/idl/lsa.idl
@@ -1040,11 +1040,11 @@ import "misc.idl", "security.idl";
 
        /**********************/
        /* Function 0x31 */
-       NTSTATUS lsa_SetTrustedDomainInfoByName(
+       [public] NTSTATUS lsa_SetTrustedDomainInfoByName(
                [in]                   policy_handle         *handle,
-               [in]                   lsa_String             trusted_domain,
+               [in,ref]               lsa_String             *trusted_domain,
                [in]                   lsa_TrustDomInfoEnum   level,
-               [in,unique,switch_is(level)] lsa_TrustedDomainInfo *info
+               [in,ref,switch_is(level)] lsa_TrustedDomainInfo *info
                );
 
        /* Function 0x32 */
diff --git a/source4/torture/ndr/lsa.c b/source4/torture/ndr/lsa.c
index 216bf42..e9e01d3 100644
--- a/source4/torture/ndr/lsa.c
+++ b/source4/torture/ndr/lsa.c
@@ -21,6 +21,17 @@
 #include "includes.h"
 #include "torture/ndr/ndr.h"
 #include "librpc/gen_ndr/ndr_lsa.h"
+#include "libcli/security/security.h"
+
+#define torture_assert_sid_equal(torture_ctx,got,expected,cmt)\
+       do { struct dom_sid *__got = (got), *__expected = (expected); \
+       if (!dom_sid_equal(__got, __expected)) { \
+               torture_result(torture_ctx, TORTURE_FAIL, \
+                                          __location__": "#got" was %s, 
expected %s: %s", \
+                                          dom_sid_string(torture_ctx, __got), 
dom_sid_string(torture_ctx, __expected), cmt); \
+               return false; \
+       } \
+       } while(0)
 
 static const uint8_t lsarlookupnames_in_data[] = {
   0x00, 0x00, 0x00, 0x00, 0x2a, 0xab, 0xb8, 0x84, 0x36, 0xc6, 0xed, 0x4f,
@@ -2029,6 +2040,94 @@ static bool 
lsarsetforesttrustsinformation_in_check(struct torture_context *tctx
        return true;
 }
 
+static const uint8_t lsasettrusteddomaininfobyname_in_data[] = {
+  0x00, 0x00, 0x00, 0x00, 0xe2, 0xbe, 0xb5, 0xfe, 0x4a, 0xe2, 0x25, 0x43,
+  0xaf, 0x37, 0x14, 0x77, 0xa5, 0xd6, 0xd9, 0x31, 0x0e, 0x00, 0x10, 0x00,
+  0x00, 0x00, 0x02, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x07, 0x00, 0x00, 0x00, 0x66, 0x00, 0x31, 0x00, 0x2e, 0x00, 0x74, 0x00,
+  0x65, 0x00, 0x73, 0x00, 0x74, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x00, 0x00,
+  0x0e, 0x00, 0x10, 0x00, 0x04, 0x00, 0x02, 0x00, 0x04, 0x00, 0x06, 0x00,
+  0x08, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x02, 0x00, 0x03, 0x00, 0x00, 0x00,
+  0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x44, 0x02, 0x00, 0x00, 0x10, 0x00, 0x02, 0x00, 0x08, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x66, 0x00, 0x31, 0x00,
+  0x2e, 0x00, 0x74, 0x00, 0x65, 0x00, 0x73, 0x00, 0x74, 0x00, 0x00, 0x00,
+  0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
+  0x46, 0x00, 0x31, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x04, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x05, 0x15, 0x00, 0x00, 0x00, 0x60, 0xcc, 0x85, 0x53,
+  0x92, 0x64, 0x11, 0x5e, 0x37, 0xa1, 0x11, 0x65, 0x44, 0x02, 0x00, 0x00,
+  0x25, 0xf5, 0x9e, 0xfc, 0x2c, 0x36, 0x8e, 0x0d, 0xd8, 0x6b, 0x98, 0x14,
+  0xb6, 0x78, 0xcc, 0xca, 0xb2, 0xbd, 0xa0, 0x8d, 0x59, 0xd9, 0x51, 0x90,
+  0x14, 0x0e, 0x0c, 0x3f, 0xac, 0xed, 0x67, 0x98, 0xd9, 0x44, 0xe7, 0xec,
+  0x72, 0xd7, 0x83, 0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+  0x4c, 0xb9, 0xbc, 0x46
+};
+
+static bool lsasettrusteddomaininfobyname_in_check(struct torture_context 
*tctx,
+                                                   struct 
lsa_SetTrustedDomainInfoByName *r)
+{
+       /* FIXME: Handle */
+       torture_assert_str_equal(tctx, r->in.trusted_domain->string, "f1.test", 
"trusted domain");
+       torture_assert_int_equal(tctx, r->in.level, 
LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL, "level");
+       torture_assert(tctx, r->in.info != NULL, "trust info");
+       torture_assert_str_equal(tctx, 
r->in.info->full_info_internal.info_ex.domain_name.string, "f1.test", "domain 
name");
+       torture_assert_str_equal(tctx, 
r->in.info->full_info_internal.info_ex.netbios_name.string, "F1", "netbios 
name");
+       torture_assert(tctx, r->in.info->full_info_internal.info_ex.sid != 
NULL, "domain sid ptr");
+       torture_assert_sid_equal(tctx, 
r->in.info->full_info_internal.info_ex.sid, dom_sid_parse_talloc(tctx, 
"S-1-5-21-1401277536-1578198162-1695654199"), "domain sid");
+       torture_assert_int_equal(tctx, 
r->in.info->full_info_internal.info_ex.trust_direction, 3, "trust direction");
+       torture_assert_int_equal(tctx, 
r->in.info->full_info_internal.info_ex.trust_type, LSA_TRUST_TYPE_UPLEVEL, 
"trust type");
+       torture_assert_int_equal(tctx, 
r->in.info->full_info_internal.info_ex.trust_attributes, 8, "trust attributes");
+       torture_assert_int_equal(tctx, 
r->in.info->full_info_internal.posix_offset.posix_offset, 0, "posix offset");
+       torture_assert_int_equal(tctx, 
r->in.info->full_info_internal.auth_info.auth_blob.size, 580, "auth blob size");
+
+       torture_assert_ntstatus_ok(tctx, r->out.result, "return code");
+
+       return true;
+}
 
 struct torture_suite *ndr_lsa_suite(TALLOC_CTX *ctx)
 {
@@ -2087,6 +2186,7 @@ struct torture_suite *ndr_lsa_suite(TALLOC_CTX *ctx)
 
        torture_suite_add_ndr_pull_fn_test(suite, 
lsa_lsaRSetForestTrustInformation, lsarsetforesttrustsinformation_in_data, 
NDR_IN, lsarsetforesttrustsinformation_in_check);
 
+       torture_suite_add_ndr_pull_fn_test(suite, 
lsa_SetTrustedDomainInfoByName, lsasettrusteddomaininfobyname_in_data, NDR_IN, 
lsasettrusteddomaininfobyname_in_check);
+
        return suite;
 }
-


-- 
Samba Shared Repository

Reply via email to