[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha8-767-g720b7ea

mdw at samba.org mdw at samba.org
Mon Aug 3 01:47:09 MDT 2009


The branch, master has been updated
       via  720b7ea0ee77ffc8a3d59d3185cb0edd999b1c84 (commit)
       via  c688d374971cbd2de8e4be229422d00d383937f6 (commit)
       via  721402b8de9a94c4a7ca6ed2f039d0fe42f53351 (commit)
       via  e14b2ed8df12c1dadf907b96c5d6eb9192daa844 (commit)
      from  c50dff4ccea48de81815e0b92066b89b2bf3ddec (commit)

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


- Log -----------------------------------------------------------------
commit 720b7ea0ee77ffc8a3d59d3185cb0edd999b1c84
Author: Matthias Dieter Wallnöfer <mwallnoefer at yahoo.de>
Date:   Thu Jul 23 13:05:34 2009 +0200

    s4: Torture test for enhancements in "netr_LogonGetDomainInformations" call
    
    This corrects and enhances the torture test of the mentioned call.

commit c688d374971cbd2de8e4be229422d00d383937f6
Author: Matthias Dieter Wallnöfer <mwallnoefer at yahoo.de>
Date:   Wed Jul 22 22:11:12 2009 +0200

    s4: Enhancements in the "netr_LogonGetDomainInformations" call
    
    This addresses bug #4888 and #6596 in SAMBA 4 Bugzilla
    - It implements the call in the complete form as specified in the MSPP/WSPP docs
      and on the discussion on the "cifs-protocol" list
    - Therefore client informations (OS name, OS version, "servicePrincipalName"...)
      are now saved in the AD each time the client invokes the call

commit 721402b8de9a94c4a7ca6ed2f039d0fe42f53351
Author: Matthias Dieter Wallnöfer <mwallnoefer at yahoo.de>
Date:   Wed Jul 22 21:01:52 2009 +0200

    netlogon.idl: Prework to enhance the "netr_LogonGetDomainInformation" call correctly
    
    This enhances the "netlogon.idl" file to allow enhancements on the mentioned call.
    Therefore this is also the base for fixing up bug #4888.

commit e14b2ed8df12c1dadf907b96c5d6eb9192daa844
Author: Matthias Dieter Wallnöfer <mwallnoefer at yahoo.de>
Date:   Wed Jul 22 20:03:21 2009 +0200

    netlogon.idl: Removes the form "str[]" for string declarations
    
    In this file two different forms are used to explain the same datatype ("str[]" and "*str").
    I didn't find this very nice and unified the occurrences to always use "*str".
    
    This patch is of cosmetic nature.

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

Summary of changes:
 librpc/idl/netlogon.idl                       |  242 +++++++++++++-------
 source4/rpc_server/netlogon/dcerpc_netlogon.c |  259 ++++++++++++++++------
 source4/torture/rpc/netlogon.c                |  301 ++++++++++++++++++++++---
 3 files changed, 623 insertions(+), 179 deletions(-)


Changeset truncated at 500 lines:

diff --git a/librpc/idl/netlogon.idl b/librpc/idl/netlogon.idl
index 4a90c2c..1b3ef45 100644
--- a/librpc/idl/netlogon.idl
+++ b/librpc/idl/netlogon.idl
@@ -50,8 +50,8 @@ interface netlogon
 
 	WERROR netr_LogonUasLogon(
 		[in,unique] [string,charset(UTF16)] uint16 *server_name,
-		[in]   [string,charset(UTF16)] uint16 account_name[],
-		[in]   [string,charset(UTF16)] uint16 workstation[],
+		[in]   [string,charset(UTF16)] uint16 *account_name,
+		[in]   [string,charset(UTF16)] uint16 *workstation,
 		[out,ref]  netr_UasInfo **info
 		);
 
@@ -66,8 +66,8 @@ interface netlogon
 
 	WERROR netr_LogonUasLogoff(
 		[in,unique] [string,charset(UTF16)] uint16 *server_name,
-		[in] [string,charset(UTF16)] uint16 account_name[],
-		[in] [string,charset(UTF16)] uint16 workstation[],
+		[in] [string,charset(UTF16)] uint16 *account_name,
+		[in] [string,charset(UTF16)] uint16 *workstation,
 		[out,ref] netr_UasLogoffInfo *info
 		);
 
@@ -290,15 +290,15 @@ interface netlogon
 	} netr_Authenticator;
 
 	NTSTATUS netr_LogonSamLogon(
-		[in,unique] [string,charset(UTF16)] uint16         *server_name,
-		[in,unique] [string,charset(UTF16)] uint16         *computer_name,
-		[in,unique] netr_Authenticator                     *credential,
-		[in,out,unique] netr_Authenticator                 *return_authenticator,
-		[in]  netr_LogonInfoClass                           logon_level,
-		[in,ref]  [switch_is(logon_level)] netr_LogonLevel *logon,
-		[in]  uint16                                        validation_level,
+		[in,unique] [string,charset(UTF16)] uint16 *server_name,
+		[in,unique] [string,charset(UTF16)] uint16 *computer_name,
+		[in,unique] netr_Authenticator *credential,
+		[in,out,unique] netr_Authenticator *return_authenticator,
+		[in] netr_LogonInfoClass logon_level,
+		[in,ref] [switch_is(logon_level)] netr_LogonLevel *logon,
+		[in] uint16 validation_level,
 		[out,ref] [switch_is(validation_level)] netr_Validation *validation,
-		[out,ref] uint8                                    *authoritative
+		[out,ref] uint8 *authoritative
 		);
 
 
@@ -321,7 +321,7 @@ interface netlogon
 
 	[public] NTSTATUS netr_ServerReqChallenge(
 		[in,unique,string,charset(UTF16)] uint16 *server_name,
-		[in,string,charset(UTF16)] uint16 computer_name[],
+		[in,string,charset(UTF16)] uint16 *computer_name,
 		[in,ref] netr_Credential *credentials,
 		[out,ref] netr_Credential *return_credentials
 		);
@@ -334,9 +334,9 @@ interface netlogon
 
 	NTSTATUS netr_ServerAuthenticate(
 		[in,unique,string,charset(UTF16)] uint16 *server_name,
-		[in,string,charset(UTF16)] uint16 account_name[],
-		[in]                       netr_SchannelType secure_channel_type,
-		[in,string,charset(UTF16)] uint16 computer_name[],
+		[in,string,charset(UTF16)] uint16 *account_name,
+		[in] netr_SchannelType secure_channel_type,
+		[in,string,charset(UTF16)] uint16 *computer_name,
 		[in,ref] netr_Credential *credentials,
 		[out,ref] netr_Credential *return_credentials
 		);
@@ -347,9 +347,9 @@ interface netlogon
 
 	NTSTATUS netr_ServerPasswordSet(
 		[in,unique] [string,charset(UTF16)] uint16 *server_name,
-		[in]  [string,charset(UTF16)] uint16 account_name[],
+		[in]  [string,charset(UTF16)] uint16 *account_name,
 		[in]  netr_SchannelType secure_channel_type,
-		[in]  [string,charset(UTF16)] uint16 computer_name[],
+		[in]  [string,charset(UTF16)] uint16 *computer_name,
 		[in,ref]  netr_Authenticator *credential,
 		[out,ref] netr_Authenticator *return_authenticator,
 		[in,ref] samr_Password *new_password
@@ -729,8 +729,8 @@ interface netlogon
 	} netr_DELTA_ENUM_ARRAY;
 
 	NTSTATUS netr_DatabaseDeltas(
-		[in]      [string,charset(UTF16)] uint16 logon_server[],
-		[in]      [string,charset(UTF16)] uint16 computername[],
+		[in]      [string,charset(UTF16)] uint16 *logon_server,
+		[in]      [string,charset(UTF16)] uint16 *computername,
 		[in,ref]  netr_Authenticator *credential,
 		[in,out,ref]  netr_Authenticator *return_authenticator,
 		[in]      netr_SamDatabaseID database_id,
@@ -744,8 +744,8 @@ interface netlogon
 	/* Function 0x08 */
 
 	NTSTATUS netr_DatabaseSync(
-		[in]     [string,charset(UTF16)] uint16 logon_server[],
-		[in]     [string,charset(UTF16)] uint16 computername[],
+		[in]     [string,charset(UTF16)] uint16 *logon_server,
+		[in]     [string,charset(UTF16)] uint16 *computername,
 		[in,ref] netr_Authenticator *credential,
 		[in,out,ref] netr_Authenticator *return_authenticator,
 		[in]     netr_SamDatabaseID database_id,
@@ -772,7 +772,7 @@ interface netlogon
 
 	NTSTATUS netr_AccountDeltas(
 		[in,unique] [string,charset(UTF16)] uint16 *logon_server,
-		[in]     [string,charset(UTF16)] uint16 computername[],
+		[in]     [string,charset(UTF16)] uint16 *computername,
 		[in]     netr_Authenticator credential,
 		[in,out,ref] netr_Authenticator *return_authenticator,
 		[in]     netr_UAS_INFO_0 uas,
@@ -791,7 +791,7 @@ interface netlogon
 
 	NTSTATUS netr_AccountSync(
 		[in,unique] [string,charset(UTF16)] uint16 *logon_server,
-		[in]      [string,charset(UTF16)] uint16 computername[],
+		[in]      [string,charset(UTF16)] uint16 *computername,
 		[in]      netr_Authenticator credential,
 		[in,out,ref]  netr_Authenticator *return_authenticator,
 		[in]      uint32 reference,
@@ -809,7 +809,7 @@ interface netlogon
 	/* Function 0x0B */
 
 	WERROR netr_GetDcName(
-		[in]  [string,charset(UTF16)] uint16 logon_server[],
+		[in]  [string,charset(UTF16)] uint16 *logon_server,
 		[in,unique] [string,charset(UTF16)] uint16 *domainname,
 		[out,ref] [string,charset(UTF16)] uint16 **dcname
 		);
@@ -881,7 +881,7 @@ interface netlogon
 		[in,unique] [string,charset(UTF16)] uint16 *logon_server,
 		[in]   netr_LogonControlCode function_code,
 		[in]   uint32 level,
-		[out,ref,switch_is(level)]  netr_CONTROL_QUERY_INFORMATION *query
+		[out,ref,switch_is(level)] netr_CONTROL_QUERY_INFORMATION *query
 		);
 
 
@@ -957,9 +957,9 @@ interface netlogon
 
 	NTSTATUS netr_ServerAuthenticate2(
 		[in,unique]  [string,charset(UTF16)] uint16 *server_name,
-		[in]         [string,charset(UTF16)] uint16 account_name[],
+		[in]         [string,charset(UTF16)] uint16 *account_name,
 		[in]         netr_SchannelType secure_channel_type,
-		[in]         [string,charset(UTF16)] uint16 computer_name[],
+		[in]         [string,charset(UTF16)] uint16 *computer_name,
 		[in,ref]     netr_Credential *credentials,
 		[out,ref]    netr_Credential *return_credentials,
 		[in,out,ref] netr_NegotiateFlags *negotiate_flags
@@ -982,8 +982,8 @@ interface netlogon
 	} SyncStateEnum;
 
 	NTSTATUS netr_DatabaseSync2(
-		[in]     [string,charset(UTF16)] uint16 logon_server[],
-		[in]     [string,charset(UTF16)] uint16 computername[],
+		[in]     [string,charset(UTF16)] uint16 *logon_server,
+		[in]     [string,charset(UTF16)] uint16 *computername,
 		[in,ref] netr_Authenticator *credential,
 		[in,out,ref] netr_Authenticator *return_authenticator,
 		[in]     netr_SamDatabaseID database_id,
@@ -1024,8 +1024,8 @@ interface netlogon
 	} netr_ChangeLogEntry;
 
 	NTSTATUS netr_DatabaseRedo(
-		[in]     [string,charset(UTF16)] uint16 logon_server[],
-		[in]     [string,charset(UTF16)] uint16 computername[],
+		[in]     [string,charset(UTF16)] uint16 *logon_server,
+		[in]     [string,charset(UTF16)] uint16 *computername,
 		[in]     netr_Authenticator *credential,
 		[in,out,ref] netr_Authenticator *return_authenticator,
 		[in]     [subcontext(4),subcontext_size(change_log_entry_size)] netr_ChangeLogEntry change_log_entry,
@@ -1042,7 +1042,7 @@ interface netlogon
 		[in]   netr_LogonControlCode function_code,
 		[in]   uint32 level,
 		[in,ref][switch_is(function_code)] netr_CONTROL_DATA_INFORMATION  *data,
-		[out,ref][switch_is(level)]	netr_CONTROL_QUERY_INFORMATION *query
+		[out,ref][switch_is(level)] netr_CONTROL_QUERY_INFORMATION *query
 		);
 
 	/*****************/
@@ -1153,7 +1153,7 @@ interface netlogon
 	} netr_Capabilities;
 
 	NTSTATUS netr_LogonGetCapabilities(
-		[in]         [string,charset(UTF16)] uint16 server_name[],
+		[in]         [string,charset(UTF16)] uint16 *server_name,
 		[in,unique]  [string,charset(UTF16)] uint16 *computer_name,
 		[in,ref]     netr_Authenticator *credential,
 		[in,out,ref] netr_Authenticator *return_authenticator,
@@ -1185,9 +1185,9 @@ interface netlogon
 	/* Function 0x1a */
 	[public] NTSTATUS netr_ServerAuthenticate3(
 		[in,unique]  [string,charset(UTF16)] uint16 *server_name,
-		[in]         [string,charset(UTF16)] uint16 account_name[],
+		[in]         [string,charset(UTF16)] uint16 *account_name,
 		[in]         netr_SchannelType secure_channel_type,
-		[in]         [string,charset(UTF16)] uint16 computer_name[],
+		[in]         [string,charset(UTF16)] uint16 *computer_name,
 		[in,ref]     netr_Credential *credentials,
 		[out,ref]    netr_Credential *return_credentials,
 		[in,out,ref] netr_NegotiateFlags *negotiate_flags,
@@ -1227,25 +1227,93 @@ interface netlogon
 		NETR_TRUST_FLAG_AES       = 0x00000100
 	} netr_TrustFlags;
 
+	typedef [bitmap32bit] bitmap {
+		NETR_WS_FLAG_HANDLES_INBOUND_TRUSTS = 0x00000001,
+		NETR_WS_FLAG_HANDLES_SPN_UPDATE     = 0x00000002
+	} netr_WorkstationFlags;
+
+	typedef [bitmap16bit] bitmap {
+		NETR_VER_SUITE_BACKOFFICE		= 0x0004,
+		NETR_VER_SUITE_BLADE			= 0x0400,
+		NETR_VER_SUITE_COMPUTE_SERVER		= 0x4000,
+		NETR_VER_SUITE_DATACENTER		= 0x0080,
+		NETR_VER_SUITE_ENTERPRISE		= 0x0002,
+		NETR_VER_SUITE_EMBEDDEDNT		= 0x0040,
+		NETR_VER_SUITE_PERSONAL			= 0x0200,
+		NETR_VER_SUITE_SINGLEUSERTS		= 0x0100,
+		NETR_VER_SUITE_SMALLBUSINESS		= 0x0001,
+		NETR_VER_SUITE_SMALLBUSINESS_RESTRICTED	= 0x0020,
+		NETR_VER_SUITE_STORAGE_SERVER		= 0x2000,
+		NETR_VER_SUITE_TERMINAL			= 0x0010,
+		NETR_VER_SUITE_WH_SERVER		= 0x8000
+	} netr_SuiteMask;
+
+	typedef [bitmap8bit] bitmap {
+		NETR_VER_NT_DOMAIN_CONTROLLER	= 0x02,
+		NETR_VER_NT_SERVER		= 0x03,
+		NETR_VER_NT_WORKSTATION		= 0x01
+	} netr_ProductType;
+
+	typedef struct {
+		uint32 policy_size;
+		[size_is(policy_size)] uint8 *policy;
+	} netr_LsaPolicyInformation;
+
 	typedef struct {
-		netr_Blob blob;
-		[string,charset(UTF16)] uint16 *workstation_domain;
-		[string,charset(UTF16)] uint16 *workstation_site;
-		[string,charset(UTF16)] uint16 *unknown1;
-		[string,charset(UTF16)] uint16 *unknown2;
-		[string,charset(UTF16)] uint16 *unknown3;
-		[string,charset(UTF16)] uint16 *unknown4;
-		lsa_BinaryString blob2;
-		lsa_String product;
-		lsa_String unknown5;
-		lsa_String unknown6;
-		uint32 unknown7[4];
-	} netr_DomainQuery1;
+		[value(284)] uint32 OSVersionInfoSize;
+		uint32 MajorVersion;
+		uint32 MinorVersion;
+		uint32 BuildNumber;
+		uint32 PlatformId;
+		[charset(UTF16)] uint16 CSDVersion[128];
+		uint16 ServicePackMajor;
+		uint16 ServicePackMinor;
+		netr_SuiteMask SuiteMask;
+		netr_ProductType ProductType;
+		uint8 Reserved;
+	} netr_OsVersionInfoEx;
+
+	typedef struct {
+		/* these first 3 values come from the fact windows
+		   actually encodes this structure as a UNICODE_STRING
+		   - see MS-NRPC section 2.2.1.3.9 */
+		/* 142 * 2 = 284 (length of structure "netr_OsVersionInfoEx") */
+		[value(142)] uint32 length;
+		[value(0)] uint32 dummy;
+		[value(142)] uint32 size;
+		netr_OsVersionInfoEx os;
+	} netr_OsVersion;
+
+	typedef struct {
+		/* value is 284 when info != os, otherwise 0 (for length and
+		   size) */
+		[value(os == NULL ? 0 : 284)] uint16 length;
+		[value(os == NULL ? 0 : 284)] uint16 size;
+		netr_OsVersion *os;
+	} netr_OsVersionContainer;
+
+	typedef struct {
+		netr_LsaPolicyInformation lsa_policy;
+		[string,charset(UTF16)] uint16 *dns_hostname;
+		[string,charset(UTF16)] uint16 *sitename;
+		[string,charset(UTF16)] uint16 *dummy1;
+		[string,charset(UTF16)] uint16 *dummy2;
+		[string,charset(UTF16)] uint16 *dummy3;
+		[string,charset(UTF16)] uint16 *dummy4;
+		netr_OsVersionContainer os_version;
+		lsa_String os_name;
+		lsa_String dummy_string3;
+		lsa_String dummy_string4;
+		netr_WorkstationFlags workstation_flags;
+		uint32 dummy_long2;
+		uint32 dummy_long3;
+		uint32 dummy_long4;
+	} netr_WorkstationInformation;
 
 	typedef union {
-		[case(1)] netr_DomainQuery1 *query1;
-		[case(2)] netr_DomainQuery1 *query1;
-	} netr_DomainQuery;
+		[case(1)] netr_WorkstationInformation *workstation_info;
+		[case(2)] netr_WorkstationInformation *lsa_policy_info;
+	} netr_WorkstationInfo;
 
 	typedef struct {
 		/* these first 3 values come from the fact windows
@@ -1268,64 +1336,62 @@ interface netlogon
 
 	typedef struct {
 		lsa_String domainname;
-		lsa_String fulldomainname;
-		lsa_String forest;
-		GUID        guid;
-		dom_sid2    *sid;
+		lsa_String dns_domainname;
+		lsa_String dns_forestname;
+		GUID domain_guid;
+		dom_sid2 *domain_sid;
 		netr_trust_extension_container trust_extension;
-		lsa_String dummystring[3];
-		uint32     dummy[4];
-	} netr_DomainTrustInfo;
-
-	typedef struct {
-		uint32 policy_size;
-		[size_is(policy_size)] uint8 *policy;
-	} netr_LsaPolicyInfo;
-
-	typedef [public,bitmap32bit] bitmap {
-		NETR_WS_FLAG_HANDLES_INBOUND_TRUSTS = 0x00000001,
-		NETR_WS_FLAG_HANDLES_SPN_UPDATE     = 0x00000002
-	} netr_WorkstationFlags;
+		lsa_String dummy_string2;
+		lsa_String dummy_string3;
+		lsa_String dummy_string4;
+		uint32 dummy_long1;
+		uint32 dummy_long2;
+		uint32 dummy_long3;
+		uint32 dummy_long4;
+	} netr_OneDomainInfo;
 
 	typedef struct {
-		netr_DomainTrustInfo domaininfo;
-		uint32 num_trusts;
-		[size_is(num_trusts)] netr_DomainTrustInfo *trusts;
-		netr_LsaPolicyInfo lsa_policy;
+		netr_OneDomainInfo primary_domain;
+		uint32 trusted_domain_count;
+		[size_is(trusted_domain_count)] netr_OneDomainInfo *trusted_domains;
+		netr_LsaPolicyInformation lsa_policy;
 		lsa_String dns_hostname;
-		lsa_String dummystring[3];
+		lsa_String dummy_string2;
+		lsa_String dummy_string3;
+		lsa_String dummy_string4;
 		netr_WorkstationFlags workstation_flags;
 		uint32 supported_enc_types;
-		uint32 dummy[2];
-	} netr_DomainInfo1;
+		uint32 dummy_long3;
+		uint32 dummy_long4;
+	} netr_DomainInformation;
 
 	typedef union {
-		[case(1)] netr_DomainInfo1 *info1;
-		[case(2)] netr_DomainInfo1 *info2;
+		[case(1)] netr_DomainInformation *domain_info;
+		[case(2)] netr_LsaPolicyInformation *lsa_policy_info;
 	} netr_DomainInfo;
 	
 	NTSTATUS netr_LogonGetDomainInfo(
-		[in]         [string,charset(UTF16)] uint16 server_name[],
+		[in]         [string,charset(UTF16)] uint16 *server_name,
 		[in,unique]  [string,charset(UTF16)] uint16 *computer_name,
 		[in,ref]     netr_Authenticator *credential,
 		[in,out,ref] netr_Authenticator *return_authenticator,
 		[in]	     uint32 level,
-		[in,switch_is(level)] netr_DomainQuery query,
+		[in,ref,switch_is(level)] netr_WorkstationInfo *query,
 		[out,ref,switch_is(level)] netr_DomainInfo *info
 		);
 
+	/*****************/
+	/* Function 0x1e */
 	typedef [flag(NDR_PAHEX)] struct {
 		uint8 data[512];
 		uint32 length;
 	} netr_CryptPassword;
 
-	/*****************/
-	/* Function 0x1e */
 	NTSTATUS netr_ServerPasswordSet2(
 		[in,unique] [string,charset(UTF16)] uint16 *server_name,
-		[in]  [string,charset(UTF16)] uint16 account_name[],
+		[in]  [string,charset(UTF16)] uint16 *account_name,
 		[in]  netr_SchannelType secure_channel_type,
-		[in]  [string,charset(UTF16)] uint16 computer_name[],
+		[in]  [string,charset(UTF16)] uint16 *computer_name,
 		[in,ref] netr_Authenticator *credential,
 		[out,ref] netr_Authenticator *return_authenticator,
 		[in,ref] netr_CryptPassword *new_password
@@ -1335,9 +1401,9 @@ interface netlogon
 	/* Function 0x1f */
 	WERROR netr_ServerPasswordGet(
 		[in,unique] [string,charset(UTF16)] uint16 *server_name,
-		[in]  [string,charset(UTF16)] uint16 account_name[],
+		[in]  [string,charset(UTF16)] uint16 *account_name,
 		[in]  netr_SchannelType secure_channel_type,
-		[in]  [string,charset(UTF16)] uint16 computer_name[],
+		[in]  [string,charset(UTF16)] uint16 *computer_name,
 		[in,ref] netr_Authenticator *credential,
 		[out,ref] netr_Authenticator *return_authenticator,
 		[out,ref] samr_Password *password
@@ -1489,9 +1555,9 @@ interface netlogon
 	/* Function 0x2a */
 	NTSTATUS netr_ServerTrustPasswordsGet(
 		[in,unique] [string,charset(UTF16)] uint16 *server_name,
-		[in]  [string,charset(UTF16)] uint16 account_name[],
+		[in]  [string,charset(UTF16)] uint16 *account_name,
 		[in]  netr_SchannelType secure_channel_type,
-		[in]  [string,charset(UTF16)] uint16 computer_name[],
+		[in]  [string,charset(UTF16)] uint16 *computer_name,
 		[in,ref] netr_Authenticator *credential,
 		[out,ref] netr_Authenticator *return_authenticator,
 		[out,ref] samr_Password *password,
diff --git a/source4/rpc_server/netlogon/dcerpc_netlogon.c b/source4/rpc_server/netlogon/dcerpc_netlogon.c
index 30c7ccd..4fedf54 100644
--- a/source4/rpc_server/netlogon/dcerpc_netlogon.c
+++ b/source4/rpc_server/netlogon/dcerpc_netlogon.c
@@ -5,6 +5,7 @@
 
    Copyright (C) Andrew Bartlett <abartlet at samba.org> 2004-2008
    Copyright (C) Stefan Metzmacher <metze at samba.org>  2005
+   Copyright (C) Matthias Dieter Wallnöfer            2009
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -1053,14 +1054,14 @@ static WERROR dcesrv_netr_DsRGetSiteName(struct dcesrv_call_state *dce_call, TAL
 
 
 /*
-  fill in a netr_DomainTrustInfo from a ldb search result
+  fill in a netr_OneDomainInfo from a ldb search result
 */
-static NTSTATUS fill_domain_trust_info(TALLOC_CTX *mem_ctx,
-				       struct loadparm_context *lp_ctx,
-				       struct ldb_context *sam_ctx,
-				       struct ldb_message *res,
-				       struct netr_DomainTrustInfo *info, 
-				       bool is_local, bool is_trust_list)
+static NTSTATUS fill_one_domain_info(TALLOC_CTX *mem_ctx,
+				     struct loadparm_context *lp_ctx,
+				     struct ldb_context *sam_ctx,
+				     struct ldb_message *res,
+				     struct netr_OneDomainInfo *info,
+				     bool is_local, bool is_trust_list)
 {
 	ZERO_STRUCTP(info);
 
@@ -1078,15 +1079,15 @@ static NTSTATUS fill_domain_trust_info(TALLOC_CTX *mem_ctx,
 
 	if (is_trust_list) {
 		/* MS-NRPC 3.5.4.3.9 - must be set to NULL for trust list */
-		info->forest.string = NULL;
+		info->dns_forestname.string = NULL;
 	} else {
 		char *p;
 		/* TODO: we need a common function for pulling the forest */
-		info->forest.string = ldb_dn_canonical_string(info, ldb_get_root_basedn(sam_ctx));
-		if (!info->forest.string) {
+		info->dns_forestname.string = ldb_dn_canonical_string(info, ldb_get_root_basedn(sam_ctx));
+		if (!info->dns_forestname.string) {
 			return NT_STATUS_NO_SUCH_DOMAIN;		
 		}
-		p = strchr(info->forest.string, '/');
+		p = strchr(info->dns_forestname.string, '/');
 		if (p) {
 			*p = '\0';
 		}
@@ -1094,14 +1095,14 @@ static NTSTATUS fill_domain_trust_info(TALLOC_CTX *mem_ctx,
 
 	if (is_local) {
 		info->domainname.string = lp_sam_name(lp_ctx);
-		info->fulldomainname.string = lp_realm(lp_ctx);
-		info->guid = samdb_result_guid(res, "objectGUID");
-		info->sid = samdb_result_dom_sid(mem_ctx, res, "objectSid");
+		info->dns_domainname.string = lp_realm(lp_ctx);
+		info->domain_guid = samdb_result_guid(res, "objectGUID");
+		info->domain_sid = samdb_result_dom_sid(mem_ctx, res, "objectSid");
 	} else {


-- 
Samba Shared Repository


More information about the samba-cvs mailing list