[SCM] Samba Shared Repository - branch master updated - d04131c8ec9d327f7376ad85d8d1dba0f2bccea6

Günther Deschner gd at samba.org
Mon Oct 27 18:34:03 GMT 2008


The branch, master has been updated
       via  d04131c8ec9d327f7376ad85d8d1dba0f2bccea6 (commit)
       via  95231eae39d3373dbb2003d6c01f0c46c40cdc04 (commit)
       via  92f1c0d1565f0b3d60c7235d6760926739a55426 (commit)
       via  992c03a1926cfbf6fb814583e4e2c1db810dd966 (commit)
       via  8e622f57e705e92095d0f1079618366fd82f80f8 (commit)
       via  ea886864190e7d3bb9f58260ec854489c4642c86 (commit)
       via  36725ec0b4b5fae83404d9b8d97252d0606989fc (commit)
       via  7c3d1dd8a978d0cdde74e054e6b3658323b09649 (commit)
       via  8bcc939a8c2762abaa31029411e5f2d3e1c385f4 (commit)
       via  ea6b4865ea292e36f7c8b2b645c08886ed50fe2b (commit)
       via  95c69caef6d4e1a680b88f07f14a62475e720059 (commit)
       via  6a2dabe1a7faae47dce359b77d886a9489b66fcb (commit)
       via  6131c0d8888c8bc1923794b9b93c1cb44bb071e3 (commit)
       via  7e19dd6a0ac5610c48fe1b86984e65f7b9d55ce6 (commit)
       via  fb38705e425a697db4ebd5c7cf03f08b81284e9c (commit)
       via  4ee7b58e0ab53921c9d16a18a58f04d70410924f (commit)
      from  b881d2ee78f685aea7ae8b67b3e0fb3c4f5205ed (commit)

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


- Log -----------------------------------------------------------------
commit d04131c8ec9d327f7376ad85d8d1dba0f2bccea6
Author: Günther Deschner <gd at samba.org>
Date:   Fri Oct 24 15:17:49 2008 +0200

    idl: share lsa.idl between s3 and s4.
    
    Guenther

commit 95231eae39d3373dbb2003d6c01f0c46c40cdc04
Author: Günther Deschner <gd at samba.org>
Date:   Fri Oct 24 15:05:57 2008 +0200

    s4-lsa: merge lsa_QueryInfoPolicy/{2} from s3 lsa idl.
    
    Guenther

commit 92f1c0d1565f0b3d60c7235d6760926739a55426
Author: Günther Deschner <gd at samba.org>
Date:   Fri Oct 24 13:43:21 2008 +0200

    s4-lsa: merge lsa_LookupNames/{2,3,4} from s3 lsa idl.
    
    Guenther

commit 992c03a1926cfbf6fb814583e4e2c1db810dd966
Author: Günther Deschner <gd at samba.org>
Date:   Fri Oct 24 02:01:16 2008 +0200

    s4-lsa: merge lsa_LookupSids/{2,3} from s3 lsa idl.
    
    Guenther

commit 8e622f57e705e92095d0f1079618366fd82f80f8
Author: Günther Deschner <gd at samba.org>
Date:   Tue Oct 21 13:03:49 2008 +0200

    s4-lsa: merge lsa_QueryDomainInformationPolicy from s3 lsa idl.
    
    Guenther

commit ea886864190e7d3bb9f58260ec854489c4642c86
Author: Günther Deschner <gd at samba.org>
Date:   Tue Oct 21 10:23:14 2008 +0200

    s4-lsa: merge lsa_QueryTrustedDomainInfoByName from s3 lsa idl.
    
    Guenther

commit 36725ec0b4b5fae83404d9b8d97252d0606989fc
Author: Günther Deschner <gd at samba.org>
Date:   Tue Oct 21 10:33:27 2008 +0200

    s4-lsa: merge lsa_QueryTrustedDomainInfo from s3 idl.
    
    Guenther

commit 7c3d1dd8a978d0cdde74e054e6b3658323b09649
Author: Günther Deschner <gd at samba.org>
Date:   Tue Oct 21 02:34:45 2008 +0200

    s4-lsa: merge lsa_QueryTrustedDomainInfoBySid from s3 lsa idl.
    
    Guenther

commit 8bcc939a8c2762abaa31029411e5f2d3e1c385f4
Author: Günther Deschner <gd at samba.org>
Date:   Tue Oct 21 02:24:07 2008 +0200

    s4-lsa: merge lsa_LookupPrivName from s3 lsa idl.
    
    Guenther

commit ea6b4865ea292e36f7c8b2b645c08886ed50fe2b
Author: Günther Deschner <gd at samba.org>
Date:   Tue Oct 21 02:11:54 2008 +0200

    s4-lsa: merge lsa_EnumPrivsAccount from s3 lsa idl.
    
    Guenther

commit 95c69caef6d4e1a680b88f07f14a62475e720059
Author: Günther Deschner <gd at samba.org>
Date:   Tue Oct 21 01:53:32 2008 +0200

    s4-lsa: merge lsa_LookupPrivDisplayName from s3 lsa idl.
    
    Guenther

commit 6a2dabe1a7faae47dce359b77d886a9489b66fcb
Author: Günther Deschner <gd at samba.org>
Date:   Tue Oct 21 01:20:53 2008 +0200

    s4-lsa: merge lsa_GetUserName from s3 lsa idl.
    
    Guenther

commit 6131c0d8888c8bc1923794b9b93c1cb44bb071e3
Author: Günther Deschner <gd at samba.org>
Date:   Mon Oct 20 23:12:04 2008 +0200

    s4-lsa: merge lsa_EnumTrustDom from s3 lsa idl.
    
    Guenther

commit 7e19dd6a0ac5610c48fe1b86984e65f7b9d55ce6
Author: Günther Deschner <gd at samba.org>
Date:   Mon Oct 20 23:04:40 2008 +0200

    s4-lsa: merge lsa_EnumAccounts from s3 lsa idl.
    
    Guenther

commit fb38705e425a697db4ebd5c7cf03f08b81284e9c
Author: Günther Deschner <gd at samba.org>
Date:   Mon Oct 20 22:54:05 2008 +0200

    s4-lsa: merge lsa_EnumPrivs from s3 lsa idl.
    
    Guenther

commit 4ee7b58e0ab53921c9d16a18a58f04d70410924f
Author: Günther Deschner <gd at samba.org>
Date:   Mon Oct 20 22:39:06 2008 +0200

    s4-lsa: merge lsa_QuerySecurity from s3 lsa idl.
    
    Guenther

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

Summary of changes:
 {source3/librpc => librpc}/idl/lsa.idl |   62 +-
 source3/Makefile.in                    |    2 +-
 source3/librpc/gen_ndr/lsa.h           |    2 -
 source3/passdb/lookup_sid.c            |    8 +-
 source3/rpc_server/srv_lsa_nt.c        |    8 +-
 source4/libcli/util/clilsa.c           |    8 +-
 source4/libnet/libnet_group.c          |    6 +-
 source4/libnet/libnet_lookup.c         |    4 +-
 source4/libnet/libnet_rpc.c            |   12 +-
 source4/libnet/libnet_user.c           |    8 +-
 source4/librpc/idl/lsa.idl             | 1222 --------------------------------
 source4/rpc_server/lsa/dcesrv_lsa.c    |  186 +++--
 source4/rpc_server/lsa/lsa_lookup.c    |   36 +-
 source4/torture/ndr/lsa.c              |   34 +-
 source4/torture/rpc/handles.c          |    2 +
 source4/torture/rpc/lsa.c              |  165 +++--
 source4/torture/rpc/lsa_lookup.c       |   11 +-
 source4/torture/rpc/object_uuid.c      |    8 +-
 source4/torture/rpc/samba3rpc.c        |   23 +-
 source4/torture/rpc/samsync.c          |   26 +-
 source4/torture/rpc/schannel.c         |   21 +-
 source4/winbind/wb_async_helpers.c     |   21 +-
 source4/winbind/wb_init_domain.c       |    7 +-
 23 files changed, 410 insertions(+), 1472 deletions(-)
 rename {source3/librpc => librpc}/idl/lsa.idl (98%)
 delete mode 100644 source4/librpc/idl/lsa.idl


Changeset truncated at 500 lines:

diff --git a/source3/librpc/idl/lsa.idl b/librpc/idl/lsa.idl
similarity index 98%
rename from source3/librpc/idl/lsa.idl
rename to librpc/idl/lsa.idl
index a443448..003641d 100644
--- a/source3/librpc/idl/lsa.idl
+++ b/librpc/idl/lsa.idl
@@ -56,7 +56,7 @@ import "misc.idl", "security.idl";
 	NTSTATUS lsa_Close (
 		[in,out]     policy_handle *handle
 		);
-	
+
 
 	/******************/
 	/* Function: 0x01 */
@@ -71,7 +71,7 @@ import "misc.idl", "security.idl";
 		uint32 low;
 		uint32 high;
 	} lsa_LUID;
-	
+
 	typedef struct {
 		lsa_StringLarge name;
 		lsa_LUID luid;
@@ -83,22 +83,20 @@ import "misc.idl", "security.idl";
 	} lsa_PrivArray;
 
 	[public] NTSTATUS lsa_EnumPrivs (
-		[in]     policy_handle *handle,
-		[in,out,ref] uint32 *resume_handle,
-		[out,ref] lsa_PrivArray *privs,
-		[in]         uint32 max_count
+		[in]		policy_handle *handle,
+		[in,out,ref]	uint32 *resume_handle,
+		[out,ref]	lsa_PrivArray *privs,
+		[in]		uint32 max_count
 		);
 
 	/******************/
 	/* Function: 0x03 */
-
 	NTSTATUS lsa_QuerySecurity (
-		[in]     policy_handle *handle,
-		[in]         security_secinfo sec_info,
-		[out,ref]    sec_desc_buf **sdbuf
+		[in]		policy_handle *handle,
+		[in]		security_secinfo sec_info,
+		[out,ref]	sec_desc_buf **sdbuf
 		);
 
-
 	/******************/
 	/* Function: 0x04 */
 	NTSTATUS lsa_SetSecObj(
@@ -120,7 +118,7 @@ import "misc.idl", "security.idl";
 		uint8   context_mode;
 		uint8   effective_only;
 	} lsa_QosInfo;
-	
+
 	typedef struct {
 		uint32 len; /* ignored */
 		uint8 *root_dir;
@@ -153,7 +151,7 @@ import "misc.idl", "security.idl";
 		[in]   lsa_PolicyAccessMask access_mask,
 		[out]  policy_handle *handle
 		);
-	
+
 
 
 	/******************/
@@ -317,26 +315,25 @@ import "misc.idl", "security.idl";
 
 	/******************/
 	/* NOTE: This only returns accounts that have at least
-	   one privilege set 
+	   one privilege set
 	*/
 	/* Function: 0x0b */
 	typedef struct {
 		dom_sid2 *sid;
 	} lsa_SidPtr;
-	
+
 	typedef [public] struct {
 		[range(0,1000)] uint32 num_sids;
 		[size_is(num_sids)] lsa_SidPtr *sids;
 	} lsa_SidArray;
 
-	[public] NTSTATUS lsa_EnumAccounts (
+	[public] NTSTATUS lsa_EnumAccounts(
 		[in]         policy_handle *handle,
 		[in,out,ref] uint32 *resume_handle,
 		[out,ref]    lsa_SidArray *sids,
 		[in,range(0,8192)] uint32 num_entries
 		);
 
-
 	/*************************************************/
 	/* Function: 0x0c                                */
 
@@ -359,7 +356,7 @@ import "misc.idl", "security.idl";
 		[size_is(count)] lsa_DomainInfo *domains;
 	} lsa_DomainList;
 
-	NTSTATUS lsa_EnumTrustDom (
+	NTSTATUS lsa_EnumTrustDom(
 		[in]               policy_handle *handle,
 		[in,out,ref]       uint32 *resume_handle,
 		[out,ref]          lsa_DomainList *domains,
@@ -394,8 +391,6 @@ import "misc.idl", "security.idl";
 	} lsa_TransSidArray;
 
 	const int LSA_REF_DOMAIN_LIST_MULTIPLIER = 32;
-	const int MAX_REF_DOMAINS = LSA_REF_DOMAIN_LIST_MULTIPLIER;
-
 	typedef struct {
 		[range(0,1000)] uint32 count;
 		[size_is(count)] lsa_DomainInfo *domains;
@@ -445,10 +440,7 @@ import "misc.idl", "security.idl";
 		[size_is(count)] lsa_TranslatedName *names;
 	} lsa_TransNameArray;
 
-	/* This number is based on Win2k and later maximum response allowed */
-	const int MAX_LOOKUP_SIDS = 0x5000; /* 20480 */
-
-	[public] NTSTATUS lsa_LookupSids (
+	[public] NTSTATUS lsa_LookupSids(
 		[in]         policy_handle *handle,
 		[in,ref]     lsa_SidArray *sids,
 		[out,ref]    lsa_RefDomainList **domains,
@@ -484,14 +476,14 @@ import "misc.idl", "security.idl";
 		lsa_LUID luid;
 		uint32 attribute;
 	} lsa_LUIDAttribute;
-	
+
 	typedef struct {
 		[range(0,1000)] uint32 count;
 		uint32 unknown;
 		[size_is(count)] lsa_LUIDAttribute set[*];
 	} lsa_PrivilegeSet;
-	
-	NTSTATUS lsa_EnumPrivsAccount (
+
+	NTSTATUS lsa_EnumPrivsAccount(
 		[in]         policy_handle *handle,
 		[out,ref] lsa_PrivilegeSet **privs
 		);
@@ -503,7 +495,7 @@ import "misc.idl", "security.idl";
 		[in]         policy_handle *handle,
 		[in,ref]     lsa_PrivilegeSet *privs
 		);
-	
+
 
 	/****************************************/
 	/* Function:         0x14 */
@@ -515,10 +507,10 @@ import "misc.idl", "security.idl";
 
 	/* Function:           0x15 */
 	[todo] NTSTATUS lsa_GetQuotasForAccount();
-	
+
 	/* Function:           0x16 */
 	[todo] NTSTATUS lsa_SetQuotasForAccount();
-	
+
 	typedef [bitmap32bit] bitmap {
 		LSA_POLICY_MODE_INTERACTIVE             = 0x00000001,
 		LSA_POLICY_MODE_NETWORK                 = 0x00000002,
@@ -772,7 +764,7 @@ import "misc.idl", "security.idl";
 
 
 	/* Function:      0x20 */
-	NTSTATUS lsa_LookupPrivName (
+	NTSTATUS lsa_LookupPrivName(
 		[in]     policy_handle *handle,
 		[in,ref] lsa_LUID *luid,
 		[out,ref] lsa_StringLarge **name
@@ -781,7 +773,7 @@ import "misc.idl", "security.idl";
 
 	/*******************/
 	/* Function:  0x21 */
-	NTSTATUS lsa_LookupPrivDisplayName (
+	NTSTATUS lsa_LookupPrivDisplayName(
 		[in] policy_handle *handle,
 		[in,ref] lsa_String *name,
 		[in] uint16 language_id,
@@ -810,12 +802,12 @@ import "misc.idl", "security.idl";
 	typedef struct {
 		[string,charset(UTF16)] uint16 *name;
 	} lsa_RightAttribute;
-	
+
 	typedef struct {
 		[range(0,256)] uint32 count;
 		[size_is(count)] lsa_StringLarge *names;
 	} lsa_RightSet;
-	
+
 	NTSTATUS lsa_EnumAccountRights (
 		[in]     policy_handle *handle,
 		[in,ref] dom_sid2 *sid,
@@ -953,7 +945,7 @@ import "misc.idl", "security.idl";
 
 	/* Function 0x35 */
 
-	/* w2k3 returns either 0x000bbbd000000000 or 0x000a48e800000000 
+	/* w2k3 returns either 0x000bbbd000000000 or 0x000a48e800000000
 	   for unknown6 - gd */
 	typedef struct {
 		uint32 enforce_restrictions;
diff --git a/source3/Makefile.in b/source3/Makefile.in
index 60832c8..babd4f9 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -1214,7 +1214,7 @@ modules:: SHOWFLAGS $(MODULES)
 ## Perl IDL Compiler
 samba3-idl::
 	@PIDL_ARGS="$(PIDL_ARGS)" CPP="$(CPP)" PIDL="../pidl/pidl" \
-	 srcdir="$(srcdir)" $(srcdir)/script/build_idl.sh librpc/idl/lsa.idl \
+	 srcdir="$(srcdir)" $(srcdir)/script/build_idl.sh ../librpc/idl/lsa.idl \
 	 	../librpc/idl/dfs.idl ../librpc/idl/echo.idl ../librpc/idl/winreg.idl \
 		../librpc/idl/initshutdown.idl librpc/idl/srvsvc.idl ../librpc/idl/svcctl.idl \
 		../librpc/idl/eventlog.idl ../librpc/idl/wkssvc.idl librpc/idl/netlogon.idl \
diff --git a/source3/librpc/gen_ndr/lsa.h b/source3/librpc/gen_ndr/lsa.h
index d91cf4b..0ccbcdf 100644
--- a/source3/librpc/gen_ndr/lsa.h
+++ b/source3/librpc/gen_ndr/lsa.h
@@ -9,8 +9,6 @@
 
 #define LSA_ENUM_TRUST_DOMAIN_MULTIPLIER	( 60 )
 #define LSA_REF_DOMAIN_LIST_MULTIPLIER	( 32 )
-#define MAX_REF_DOMAINS	( LSA_REF_DOMAIN_LIST_MULTIPLIER )
-#define MAX_LOOKUP_SIDS	( 0x5000 )
 #define LSA_ENUM_TRUST_DOMAIN_EX_MULTIPLIER	( 82 )
 #define LSA_CLIENT_REVISION_NO_DNS	( 0x00000001 )
 #define LSA_CLIENT_REVISION_DNS	( 0x00000002 )
diff --git a/source3/passdb/lookup_sid.c b/source3/passdb/lookup_sid.c
index 3861c8e..b9a67f2 100644
--- a/source3/passdb/lookup_sid.c
+++ b/source3/passdb/lookup_sid.c
@@ -746,7 +746,7 @@ NTSTATUS lookup_sids(TALLOC_CTX *mem_ctx, int num_sids,
 	}
 
 	dom_infos = TALLOC_ZERO_ARRAY(mem_ctx, struct lsa_dom_info,
-				      MAX_REF_DOMAINS);
+				      LSA_REF_DOMAIN_LIST_MULTIPLIER);
 	if (dom_infos == NULL) {
 		result = NT_STATUS_NO_MEMORY;
 		goto fail;
@@ -816,7 +816,7 @@ NTSTATUS lookup_sids(TALLOC_CTX *mem_ctx, int num_sids,
 			continue;
 		}
 
-		for (j=0; j<MAX_REF_DOMAINS; j++) {
+		for (j=0; j<LSA_REF_DOMAIN_LIST_MULTIPLIER; j++) {
 			if (!dom_infos[j].valid) {
 				break;
 			}
@@ -825,7 +825,7 @@ NTSTATUS lookup_sids(TALLOC_CTX *mem_ctx, int num_sids,
 			}
 		}
 
-		if (j == MAX_REF_DOMAINS) {
+		if (j == LSA_REF_DOMAIN_LIST_MULTIPLIER) {
 			/* TODO: What's the right error message here? */
 			result = NT_STATUS_NONE_MAPPED;
 			goto fail;
@@ -869,7 +869,7 @@ NTSTATUS lookup_sids(TALLOC_CTX *mem_ctx, int num_sids,
 
 	/* Iterate over the domains found */
 
-	for (i=0; i<MAX_REF_DOMAINS; i++) {
+	for (i=0; i<LSA_REF_DOMAIN_LIST_MULTIPLIER; i++) {
 		uint32_t *rids;
 		const char *domain_name = NULL;
 		const char **names;
diff --git a/source3/rpc_server/srv_lsa_nt.c b/source3/rpc_server/srv_lsa_nt.c
index 2fa705d..3addf91 100644
--- a/source3/rpc_server/srv_lsa_nt.c
+++ b/source3/rpc_server/srv_lsa_nt.c
@@ -33,6 +33,8 @@
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_RPC_SRV
 
+#define MAX_LOOKUP_SIDS 0x5000 /* 20480 */
+
 extern PRIVS privs[];
 
 struct lsa_info {
@@ -68,13 +70,13 @@ static int init_lsa_ref_domain_list(TALLOC_CTX *mem_ctx,
 		num = ref->count;
 	}
 
-	if (num >= MAX_REF_DOMAINS) {
+	if (num >= LSA_REF_DOMAIN_LIST_MULTIPLIER) {
 		/* index not found, already at maximum domain limit */
 		return -1;
 	}
 
 	ref->count = num + 1;
-	ref->max_size = MAX_REF_DOMAINS;
+	ref->max_size = LSA_REF_DOMAIN_LIST_MULTIPLIER;
 
 	ref->domains = TALLOC_REALLOC_ARRAY(mem_ctx, ref->domains,
 					    struct lsa_DomainInfo, ref->count);
@@ -725,7 +727,7 @@ static NTSTATUS _lsa_lookup_sids_internal(pipes_struct *p,
 		return NT_STATUS_NO_MEMORY;
 	}
 
-	for (i=0; i<MAX_REF_DOMAINS; i++) {
+	for (i=0; i<LSA_REF_DOMAIN_LIST_MULTIPLIER; i++) {
 
 		if (!dom_infos[i].valid) {
 			break;
diff --git a/source4/libcli/util/clilsa.c b/source4/libcli/util/clilsa.c
index 43f6418..16967d7 100644
--- a/source4/libcli/util/clilsa.c
+++ b/source4/libcli/util/clilsa.c
@@ -202,6 +202,7 @@ NTSTATUS smblsa_lookup_sid(struct smbcli_state *cli,
 	struct lsa_LookupSids r;
 	struct lsa_TransNameArray names;
 	struct lsa_SidArray sids;
+	struct lsa_RefDomainList *domains = NULL;
 	uint32_t count = 1;
 	NTSTATUS status;
 	struct dom_sid *sid;
@@ -231,6 +232,7 @@ NTSTATUS smblsa_lookup_sid(struct smbcli_state *cli,
 	r.in.count = &count;
 	r.out.count = &count;
 	r.out.names = &names;
+	r.out.domains = &domains;
 
 	status = dcerpc_lsa_LookupSids(cli->lsa->pipe, mem_ctx2, &r);
 	if (!NT_STATUS_IS_OK(status)) {
@@ -243,7 +245,7 @@ NTSTATUS smblsa_lookup_sid(struct smbcli_state *cli,
 	}
 
 	(*name) = talloc_asprintf(mem_ctx, "%s\\%s", 
-				  r.out.domains->domains[0].name.string,
+				  domains->domains[0].name.string,
 				  names.names[0].name.string);
 
 	talloc_free(mem_ctx2);
@@ -262,6 +264,7 @@ NTSTATUS smblsa_lookup_name(struct smbcli_state *cli,
 	struct lsa_LookupNames r;
 	struct lsa_TransSidArray sids;
 	struct lsa_String names;
+	struct lsa_RefDomainList *domains = NULL;
 	uint32_t count = 1;
 	NTSTATUS status;
 	struct dom_sid *sid;
@@ -286,6 +289,7 @@ NTSTATUS smblsa_lookup_name(struct smbcli_state *cli,
 	r.in.count = &count;
 	r.out.count = &count;
 	r.out.sids = &sids;
+	r.out.domains = &domains;
 
 	status = dcerpc_lsa_LookupNames(cli->lsa->pipe, mem_ctx2, &r);
 	if (!NT_STATUS_IS_OK(status)) {
@@ -297,7 +301,7 @@ NTSTATUS smblsa_lookup_name(struct smbcli_state *cli,
 		return NT_STATUS_UNSUCCESSFUL;
 	}
 
-	sid = r.out.domains->domains[0].sid;
+	sid = domains->domains[0].sid;
 	rid = sids.sids[0].rid;
 	
 	(*sid_str) = talloc_asprintf(mem_ctx, "%s-%u", 
diff --git a/source4/libnet/libnet_group.c b/source4/libnet/libnet_group.c
index 50ba079..cae6d6d 100644
--- a/source4/libnet/libnet_group.c
+++ b/source4/libnet/libnet_group.c
@@ -444,6 +444,8 @@ struct composite_context *libnet_GroupList_send(struct libnet_context *ctx,
 	/* prepare arguments of QueryDomainInfo call */
 	s->query_domain.in.handle = &ctx->lsa.handle;
 	s->query_domain.in.level  = LSA_POLICY_INFO_DOMAIN;
+	s->query_domain.out.info  = talloc_zero(c, union lsa_PolicyInformation *);
+	if (composite_nomem(s->query_domain.out.info, c)) return c;
 
 	/* send the request */
 	query_req = dcerpc_lsa_QueryInfoPolicy_send(ctx->lsa.pipe, c, &s->query_domain);
@@ -502,7 +504,7 @@ static void continue_domain_queried(struct rpc_request *req)
 	if (!composite_is_ok(c)) return;
 
 	/* get the returned domain info */
-	s->dominfo = s->query_domain.out.info->domain;
+	s->dominfo = (*s->query_domain.out.info)->domain;
 
 	/* make sure we have samr domain handle before continuing */
 	prereq_met = samr_domain_opened(s->ctx, s->domain_name, &c, &s->domain_open,
@@ -592,7 +594,7 @@ static void continue_groups_enumerated(struct rpc_request *req)
 		for (i = 0; i < s->group_list.out.sam->count; i++) {
 			struct dom_sid *group_sid;
 			struct samr_SamEntry *entry = &s->group_list.out.sam->entries[i];
-			struct dom_sid *domain_sid = s->query_domain.out.info->domain.sid;
+			struct dom_sid *domain_sid = (*s->query_domain.out.info)->domain.sid;
 			
 			/* construct group sid from returned rid and queried domain sid */
 			group_sid = dom_sid_add_rid(c, domain_sid, entry->idx);
diff --git a/source4/libnet/libnet_lookup.c b/source4/libnet/libnet_lookup.c
index dc54ec3..fc30782 100644
--- a/source4/libnet/libnet_lookup.c
+++ b/source4/libnet/libnet_lookup.c
@@ -312,6 +312,8 @@ static bool prepare_lookup_params(struct libnet_context *ctx,
 	s->lookup.in.count     = &s->count;
 	s->lookup.out.count    = &s->count;
 	s->lookup.out.sids     = &s->sids;
+	s->lookup.out.domains  = talloc_zero(ctx, struct lsa_RefDomainList *);
+	if (composite_nomem(s->lookup.out.domains, c)) return false;
 	
 	return true;
 }
@@ -372,7 +374,7 @@ NTSTATUS libnet_LookupName_recv(struct composite_context *c, TALLOC_CTX *mem_ctx
 		io->out.sidstr = NULL;
 
 		if (*s->lookup.out.count > 0) {
-			struct lsa_RefDomainList *domains = s->lookup.out.domains;
+			struct lsa_RefDomainList *domains = *s->lookup.out.domains;
 			struct lsa_TransSidArray *sids = s->lookup.out.sids;
 
 			if (domains == NULL || sids == NULL) {
diff --git a/source4/libnet/libnet_rpc.c b/source4/libnet/libnet_rpc.c
index 28cbba2..a0d9328 100644
--- a/source4/libnet/libnet_rpc.c
+++ b/source4/libnet/libnet_rpc.c
@@ -607,6 +607,8 @@ static void continue_lsa_policy(struct rpc_request *req)
 	/* query lsa info for dns domain name and guid */
 	s->lsa_query_info2.in.handle = &s->lsa_handle;
 	s->lsa_query_info2.in.level  = LSA_POLICY_INFO_DNS;
+	s->lsa_query_info2.out.info  = talloc_zero(c, union lsa_PolicyInformation *);
+	if (composite_nomem(s->lsa_query_info2.out.info, c)) return;
 
 	query_info_req = dcerpc_lsa_QueryInfoPolicy2_send(s->lsa_pipe, c, &s->lsa_query_info2);
 	if (composite_nomem(query_info_req, c)) return;
@@ -658,13 +660,13 @@ static void continue_lsa_query_info2(struct rpc_request *req)
 		/* Copy the dns domain name and guid from the query result */
 
 		/* this should actually be a conversion from lsa_StringLarge */
-		s->r.out.realm = s->lsa_query_info2.out.info->dns.dns_domain.string;
+		s->r.out.realm = (*s->lsa_query_info2.out.info)->dns.dns_domain.string;
 		s->r.out.guid  = talloc(c, struct GUID);
 		if (composite_nomem(s->r.out.guid, c)) {
 			s->r.out.error_string = NULL;
 			return;
 		}
-		*s->r.out.guid = s->lsa_query_info2.out.info->dns.domain_guid;
+		*s->r.out.guid = (*s->lsa_query_info2.out.info)->dns.domain_guid;
 	}
 
 	/* post monitor message */
@@ -680,6 +682,8 @@ static void continue_lsa_query_info2(struct rpc_request *req)
 	/* query lsa info for domain name and sid */
 	s->lsa_query_info.in.handle = &s->lsa_handle;
 	s->lsa_query_info.in.level  = LSA_POLICY_INFO_DOMAIN;
+	s->lsa_query_info.out.info  = talloc_zero(c, union lsa_PolicyInformation *);
+	if (composite_nomem(s->lsa_query_info.out.info, c)) return;
 
 	query_info_req = dcerpc_lsa_QueryInfoPolicy_send(s->lsa_pipe, c, &s->lsa_query_info);
 	if (composite_nomem(query_info_req, c)) return;
@@ -719,8 +723,8 @@ static void continue_lsa_query_info(struct rpc_request *req)
 	}
 
 	/* Copy the domain name and sid from the query result */
-	s->r.out.domain_sid  = s->lsa_query_info.out.info->domain.sid;
-	s->r.out.domain_name = s->lsa_query_info.out.info->domain.name.string;
+	s->r.out.domain_sid  = (*s->lsa_query_info.out.info)->domain.sid;
+	s->r.out.domain_name = (*s->lsa_query_info.out.info)->domain.name.string;
 
 	continue_epm_map_binding_send(c);
 }
diff --git a/source4/libnet/libnet_user.c b/source4/libnet/libnet_user.c
index dce7320..35b2432 100644
--- a/source4/libnet/libnet_user.c
+++ b/source4/libnet/libnet_user.c
@@ -957,7 +957,9 @@ struct composite_context* libnet_UserList_send(struct libnet_context *ctx,
 	/* prepare arguments of QueryDomainInfo call */
 	s->query_domain.in.handle = &ctx->lsa.handle;
 	s->query_domain.in.level  = LSA_POLICY_INFO_DOMAIN;
-	
+	s->query_domain.out.info  = talloc_zero(c, union lsa_PolicyInformation *);
+	if (composite_nomem(s->query_domain.out.info, c)) return c;
+
 	/* send the request */
 	query_req = dcerpc_lsa_QueryInfoPolicy_send(ctx->lsa.pipe, c, &s->query_domain);
 	if (composite_nomem(query_req, c)) return c;
@@ -1015,7 +1017,7 @@ static void continue_domain_queried(struct rpc_request *req)
 	if (!composite_is_ok(c)) return;
 
 	/* get the returned domain info */
-	s->dominfo = s->query_domain.out.info->domain;
+	s->dominfo = (*s->query_domain.out.info)->domain;
 
 	/* make sure we have samr domain handle before continuing */
 	prereq_met = samr_domain_opened(s->ctx, s->domain_name, &c, &s->domain_open,
@@ -1107,7 +1109,7 @@ static void continue_users_enumerated(struct rpc_request *req)


-- 
Samba Shared Repository


More information about the samba-cvs mailing list