[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-test-2335-gead1f11

Günther Deschner gd at samba.org
Sun Feb 17 01:53:43 GMT 2008


The branch, v3-2-test has been updated
       via  ead1f11dd21b1df9a595295b3513c5f6088397c9 (commit)
       via  7bbd64c16f8dda85275ddca0fd00849f890c6e4f (commit)
       via  51a664cd5fc1cecc21a8a515bb959cac87296bcb (commit)
      from  eefc6bb86fb9196818da9d5c6384c85355794981 (commit)

http://gitweb.samba.org/?samba.git;a=shortlog;h=v3-2-test


- Log -----------------------------------------------------------------
commit ead1f11dd21b1df9a595295b3513c5f6088397c9
Author: Günther Deschner <gd at samba.org>
Date:   Sun Feb 17 02:50:11 2008 +0100

    Remove unused marshalling for NET_SAM_LOGON_EX and finally NET_USER_INFO_3.
    
    Guenther

commit 7bbd64c16f8dda85275ddca0fd00849f890c6e4f
Author: Günther Deschner <gd at samba.org>
Date:   Sun Feb 17 02:39:36 2008 +0100

    Remove unused marshalling for NET_AUTH. This must have been forgotten.
    
    Guenther

commit 51a664cd5fc1cecc21a8a515bb959cac87296bcb
Author: Günther Deschner <gd at samba.org>
Date:   Sun Feb 17 02:37:12 2008 +0100

    Use rpccli_netr_LogonSamLogonEx in rpccli wrapping function.
    
    Guenther

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

Summary of changes:
 source/include/authdata.h         |  134 +-------
 source/include/rpc_netlogon.h     |  258 --------------
 source/rpc_client/cli_netlogon.c  |   96 +++--
 source/rpc_client/init_netlogon.c |   11 +
 source/rpc_parse/parse_net.c      |  711 -------------------------------------
 5 files changed, 69 insertions(+), 1141 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/include/authdata.h b/source/include/authdata.h
index 8125f05..59f07fb 100644
--- a/source/include/authdata.h
+++ b/source/include/authdata.h
@@ -19,7 +19,7 @@
 */
 
 #ifndef _AUTHDATA_H
-#define _AUTHDATA_H 
+#define _AUTHDATA_H
 
 #include "rpc_misc.h"
 #include "rpc_netlogon.h"
@@ -37,136 +37,4 @@
 #define KRB5_AUTHDATA_IF_RELEVANT 1
 #endif
 
-
-typedef struct pac_logon_name {
-	NTTIME logon_time;
-	uint16 len;
-	uint8 *username; /* Actually always little-endian. might not be null terminated, so not UNISTR */
-} PAC_LOGON_NAME;
-
-typedef struct pac_signature_data {
-	uint32 type;
-	RPC_DATA_BLOB signature; /* this not the on-wire-format (!) */
-} PAC_SIGNATURE_DATA;
-
-typedef struct group_membership {
-	uint32 rid;
-	uint32 attrs;
-} GROUP_MEMBERSHIP;
-
-typedef struct group_membership_array {
-	uint32 count;
-	GROUP_MEMBERSHIP *group_membership;
-} GROUP_MEMBERSHIP_ARRAY;
-
-#if 0 /* Unused, replaced by NET_USER_INFO_3 - Guenther */
-
-typedef struct krb_sid_and_attrs {
-	uint32 sid_ptr;
-	uint32 attrs;
-	DOM_SID2 *sid;
-} KRB_SID_AND_ATTRS;
-
-typedef struct krb_sid_and_attr_array {
-	uint32 count;
-	KRB_SID_AND_ATTRS *krb_sid_and_attrs;
-} KRB_SID_AND_ATTR_ARRAY;
-	
-
-/* This is awfully similar to a samr_user_info_23, but not identical.
-   Many of the field names have been swiped from there, because it is
-   so similar that they are likely the same, but many have been verified.
-   Some are in a different order, though... */
-typedef struct pac_logon_info {	
-	NTTIME logon_time;            /* logon time */
-	NTTIME logoff_time;           /* logoff time */
-	NTTIME kickoff_time;          /* kickoff time */
-	NTTIME pass_last_set_time;    /* password last set time */
-	NTTIME pass_can_change_time;  /* password can change time */
-	NTTIME pass_must_change_time; /* password must change time */
-
-	UNIHDR hdr_user_name;    /* user name unicode string header */
-	UNIHDR hdr_full_name;    /* user's full name unicode string header */
-	UNIHDR hdr_logon_script; /* these last 4 appear to be in a different */
-	UNIHDR hdr_profile_path; /* order than in the info23 */
-	UNIHDR hdr_home_dir;    
-	UNIHDR hdr_dir_drive;   
-
-	uint16 logon_count; /* number of times user has logged onto domain */
-	uint16 bad_password_count;	/* samba4 idl */
-
-	uint32 user_rid;
-	uint32 group_rid;
-	uint32 group_count;
-	uint32 group_membership_ptr;
-	uint32 user_flags;
-
-	uint8 session_key[16];		/* samba4 idl */
-	UNIHDR hdr_dom_controller;
-	UNIHDR hdr_dom_name;
-
-	uint32 ptr_dom_sid;
-
-	uint8 lm_session_key[8];	/* samba4 idl */
-	uint32 acct_flags;		/* samba4 idl */
-	uint32 unknown[7];
-
-	uint32 sid_count;
-	uint32 ptr_extra_sids;
-
-	uint32 ptr_res_group_dom_sid;
-	uint32 res_group_count;
-	uint32 ptr_res_groups;
-
-	UNISTR2 uni_user_name;    /* user name unicode string header */
-	UNISTR2 uni_full_name;    /* user's full name unicode string header */
-	UNISTR2 uni_logon_script; /* these last 4 appear to be in a different*/
-	UNISTR2 uni_profile_path; /* order than in the info23 */
-	UNISTR2 uni_home_dir;    
-	UNISTR2 uni_dir_drive;   
-	UNISTR2 uni_dom_controller;
-	UNISTR2 uni_dom_name;
-	DOM_SID2 dom_sid;
-	GROUP_MEMBERSHIP_ARRAY groups;
-	KRB_SID_AND_ATTR_ARRAY extra_sids;
-	DOM_SID2 res_group_dom_sid;
-	GROUP_MEMBERSHIP_ARRAY res_groups;
-
-} PAC_LOGON_INFO;
-#endif
-
-typedef struct pac_logon_info {	
-	NET_USER_INFO_3 info3;
-	DOM_SID2 res_group_dom_sid;
-	GROUP_MEMBERSHIP_ARRAY res_groups;
-
-} PAC_LOGON_INFO;
-
-typedef struct pac_info_ctr
-{
-	union
-	{
-		PAC_LOGON_INFO *logon_info;
-		PAC_SIGNATURE_DATA *srv_cksum;
-		PAC_SIGNATURE_DATA *privsrv_cksum;
-		PAC_LOGON_NAME *logon_name;
-	} pac;
-} PAC_INFO_CTR;
-
-typedef struct pac_buffer {
-	uint32 type;
-	uint32 size;
-	uint32 offset;
-	uint32 offsethi;
-	PAC_INFO_CTR *ctr;
-	uint32 pad;
-} PAC_BUFFER;
-
-typedef struct pac_data {
-	uint32 num_buffers;
-	uint32 version;
-	PAC_BUFFER *pac_buffer;
-} PAC_DATA;
-
-
 #endif
diff --git a/source/include/rpc_netlogon.h b/source/include/rpc_netlogon.h
index ed69cf7..8058b71 100644
--- a/source/include/rpc_netlogon.h
+++ b/source/include/rpc_netlogon.h
@@ -81,200 +81,11 @@
 #define MSV1_0_RETURN_PROFILE_PATH		0x00000200
 #endif
 
-#if 0
-/* I think this is correct - it's what gets parsed on the wire. JRA. */
-/* NET_USER_INFO_2 */
-typedef struct net_user_info_2 {
-	uint32 ptr_user_info;
-
-	NTTIME logon_time;            /* logon time */
-	NTTIME logoff_time;           /* logoff time */
-	NTTIME kickoff_time;          /* kickoff time */
-	NTTIME pass_last_set_time;    /* password last set time */
-	NTTIME pass_can_change_time;  /* password can change time */
-	NTTIME pass_must_change_time; /* password must change time */
-
-	UNIHDR hdr_user_name;    /* username unicode string header */
-	UNIHDR hdr_full_name;    /* user's full name unicode string header */
-	UNIHDR hdr_logon_script; /* logon script unicode string header */
-	UNIHDR hdr_profile_path; /* profile path unicode string header */
-	UNIHDR hdr_home_dir;     /* home directory unicode string header */
-	UNIHDR hdr_dir_drive;    /* home directory drive unicode string header */
-
-	uint16 logon_count;  /* logon count */
-	uint16 bad_pw_count; /* bad password count */
-
-	uint32 user_id;       /* User ID */
-	uint32 group_id;      /* Group ID */
-	uint32 num_groups;    /* num groups */
-	uint32 buffer_groups; /* undocumented buffer pointer to groups. */
-	uint32 user_flgs;     /* user flags */
-
-	uint8 user_sess_key[16]; /* unused user session key */
-
-	UNIHDR hdr_logon_srv; /* logon server unicode string header */
-	UNIHDR hdr_logon_dom; /* logon domain unicode string header */
-
-	uint32 buffer_dom_id; /* undocumented logon domain id pointer */
-	uint8 padding[40];    /* unused padding bytes.  expansion room */
-
-	UNISTR2 uni_user_name;    /* username unicode string */
-	UNISTR2 uni_full_name;    /* user's full name unicode string */
-	UNISTR2 uni_logon_script; /* logon script unicode string */
-	UNISTR2 uni_profile_path; /* profile path unicode string */
-	UNISTR2 uni_home_dir;     /* home directory unicode string */
-	UNISTR2 uni_dir_drive;    /* home directory drive unicode string */
-
-	uint32 num_groups2;        /* num groups */
-	DOM_GID *gids; /* group info */
-
-	UNISTR2 uni_logon_srv; /* logon server unicode string */
-	UNISTR2 uni_logon_dom; /* logon domain unicode string */
-
-	DOM_SID2 dom_sid;           /* domain SID */
-
-	uint32 num_other_groups;        /* other groups */
-	DOM_GID *other_gids; /* group info */
-	DOM_SID2 *other_sids; /* undocumented - domain SIDs */
-
-} NET_USER_INFO_2;
-#endif
-
-/* NET_USER_INFO_2 */
-typedef struct net_user_info_2 {
-	uint32 ptr_user_info;
-
-	NTTIME logon_time;            /* logon time */
-	NTTIME logoff_time;           /* logoff time */
-	NTTIME kickoff_time;          /* kickoff time */
-	NTTIME pass_last_set_time;    /* password last set time */
-	NTTIME pass_can_change_time;  /* password can change time */
-	NTTIME pass_must_change_time; /* password must change time */
-
-	UNIHDR hdr_user_name;    /* username unicode string header */
-	UNIHDR hdr_full_name;    /* user's full name unicode string header */
-	UNIHDR hdr_logon_script; /* logon script unicode string header */
-	UNIHDR hdr_profile_path; /* profile path unicode string header */
-	UNIHDR hdr_home_dir;     /* home directory unicode string header */
-	UNIHDR hdr_dir_drive;    /* home directory drive unicode string header */
-
-	uint16 logon_count;  /* logon count */
-	uint16 bad_pw_count; /* bad password count */
-
-	uint32 user_rid;       /* User RID */
-	uint32 group_rid;      /* Group RID */
-
-	uint32 num_groups;    /* num groups */
-	uint32 buffer_groups; /* undocumented buffer pointer to groups. */
-	uint32 user_flgs;     /* user flags */
-
-	uint8 user_sess_key[16]; /* user session key */
-
-	UNIHDR hdr_logon_srv; /* logon server unicode string header */
-	UNIHDR hdr_logon_dom; /* logon domain unicode string header */
-
-	uint32 buffer_dom_id; /* undocumented logon domain id pointer */
-	uint8 lm_sess_key[8];	/* lm session key */
-	uint32 acct_flags;	/* account flags */
-	uint32 unknown[7];	/* unknown */
-
-	UNISTR2 uni_user_name;    /* username unicode string */
-	UNISTR2 uni_full_name;    /* user's full name unicode string */
-	UNISTR2 uni_logon_script; /* logon script unicode string */
-	UNISTR2 uni_profile_path; /* profile path unicode string */
-	UNISTR2 uni_home_dir;     /* home directory unicode string */
-	UNISTR2 uni_dir_drive;    /* home directory drive unicode string */
-
-	UNISTR2 uni_logon_srv; /* logon server unicode string */
-	UNISTR2 uni_logon_dom; /* logon domain unicode string */
-
-	DOM_SID2 dom_sid;           /* domain SID */
-} NET_USER_INFO_2;
-
-/* NET_USER_INFO_3 */
-typedef struct net_user_info_3 {
-	uint32 ptr_user_info;
-
-	NTTIME logon_time;            /* logon time */
-	NTTIME logoff_time;           /* logoff time */
-	NTTIME kickoff_time;          /* kickoff time */
-	NTTIME pass_last_set_time;    /* password last set time */
-	NTTIME pass_can_change_time;  /* password can change time */
-	NTTIME pass_must_change_time; /* password must change time */
-
-	UNIHDR hdr_user_name;    /* username unicode string header */
-	UNIHDR hdr_full_name;    /* user's full name unicode string header */
-	UNIHDR hdr_logon_script; /* logon script unicode string header */
-	UNIHDR hdr_profile_path; /* profile path unicode string header */
-	UNIHDR hdr_home_dir;     /* home directory unicode string header */
-	UNIHDR hdr_dir_drive;    /* home directory drive unicode string header */
-
-	uint16 logon_count;  /* logon count */
-	uint16 bad_pw_count; /* bad password count */
-
-	uint32 user_rid;       /* User RID */
-	uint32 group_rid;      /* Group RID */
-
-	uint32 num_groups;    /* num groups */
-	uint32 buffer_groups; /* undocumented buffer pointer to groups. */
-	uint32 user_flgs;     /* user flags */
-
-	uint8 user_sess_key[16]; /* user session key */
-
-	UNIHDR hdr_logon_srv; /* logon server unicode string header */
-	UNIHDR hdr_logon_dom; /* logon domain unicode string header */
-
-	uint32 buffer_dom_id; /* undocumented logon domain id pointer */
-	uint8 lm_sess_key[8];	/* lm session key */
-	uint32 acct_flags;	/* account flags */
-	uint32 unknown[7];	/* unknown */
-
-	uint32 num_other_sids; /* number of foreign/trusted domain sids */
-	uint32 buffer_other_sids;
-	
-	/* The next three uint32 are not really part of user_info_3 but here
-	 * for parsing convenience.  They are only valid in Kerberos PAC
-	 * parsing - Guenther */
-	uint32 ptr_res_group_dom_sid;
-	uint32 res_group_count;
-	uint32 ptr_res_groups;
-
-	UNISTR2 uni_user_name;    /* username unicode string */
-	UNISTR2 uni_full_name;    /* user's full name unicode string */
-	UNISTR2 uni_logon_script; /* logon script unicode string */
-	UNISTR2 uni_profile_path; /* profile path unicode string */
-	UNISTR2 uni_home_dir;     /* home directory unicode string */
-	UNISTR2 uni_dir_drive;    /* home directory drive unicode string */
-
-	uint32 num_groups2;        /* num groups */
-	DOM_GID *gids; /* group info */
-
-	UNISTR2 uni_logon_srv; /* logon server unicode string */
-	UNISTR2 uni_logon_dom; /* logon domain unicode string */
-
-	DOM_SID2 dom_sid;           /* domain SID */
-
-	DOM_SID2 *other_sids; /* foreign/trusted domain SIDs */
-	uint32 *other_sids_attrib;
-} NET_USER_INFO_3;
-
 /* NEG_FLAGS */
 typedef struct neg_flags_info {
 	uint32 neg_flags; /* negotiated flags */
 } NEG_FLAGS;
 
-/* NET_Q_AUTH */
-typedef struct net_q_auth_info {
-	DOM_LOG_INFO clnt_id; /* client identification info */
-	DOM_CHAL clnt_chal;     /* client-calculated credentials */
-} NET_Q_AUTH;
-
-/* NET_R_AUTH */
-typedef struct net_r_auth_info {
-	DOM_CHAL srv_chal;     /* server-calculated credentials */
-	NTSTATUS status; /* return code */
-} NET_R_AUTH;
-
 /* NET_Q_AUTH_3 */
 typedef struct net_q_auth3_info {
 	DOM_LOG_INFO clnt_id;	/* client identification info */
@@ -291,78 +102,9 @@ typedef struct net_r_auth3_info {
 } NET_R_AUTH_3;
 
 
-/* NET_ID_INFO_2 */
-typedef struct net_network_info_2 {
-	uint32            ptr_id_info2;        /* pointer to id_info_2 */
-	UNIHDR            hdr_domain_name;     /* domain name unicode header */
-	uint32            param_ctrl;          /* param control (0x2) */
-	DOM_LOGON_ID      logon_id;            /* logon ID */
-	UNIHDR            hdr_user_name;       /* user name unicode header */
-	UNIHDR            hdr_wksta_name;      /* workstation name unicode header */
-	uint8             lm_chal[8];          /* lan manager 8 byte challenge */
-	STRHDR            hdr_nt_chal_resp;    /* nt challenge response */
-	STRHDR            hdr_lm_chal_resp;    /* lm challenge response */
-
-	UNISTR2           uni_domain_name;     /* domain name unicode string */
-	UNISTR2           uni_user_name;       /* user name unicode string */
-	UNISTR2           uni_wksta_name;      /* workgroup name unicode string */
-	STRING2           nt_chal_resp;        /* nt challenge response */
-	STRING2           lm_chal_resp;        /* lm challenge response */
-} NET_ID_INFO_2;
-
-/* NET_ID_INFO_1 */
-typedef struct id_info_1 {
-	uint32            ptr_id_info1;        /* pointer to id_info_1 */
-	UNIHDR            hdr_domain_name;     /* domain name unicode header */
-	uint32            param_ctrl;          /* param control */
-	DOM_LOGON_ID      logon_id;            /* logon ID */
-	UNIHDR            hdr_user_name;       /* user name unicode header */
-	UNIHDR            hdr_wksta_name;      /* workstation name unicode header */
-	OWF_INFO          lm_owf;              /* LM OWF Password */
-	OWF_INFO          nt_owf;              /* NT OWF Password */
-	UNISTR2           uni_domain_name;     /* domain name unicode string */
-	UNISTR2           uni_user_name;       /* user name unicode string */
-	UNISTR2           uni_wksta_name;      /* workgroup name unicode string */
-} NET_ID_INFO_1;
-
 #define INTERACTIVE_LOGON_TYPE 1
 #define NET_LOGON_TYPE 2
 
-/* NET_ID_INFO_CTR */
-typedef struct net_id_info_ctr_info {
-	uint16         switch_value;
-  
-	union {
-		NET_ID_INFO_1 id1; /* auth-level 1 - interactive user login */
-		NET_ID_INFO_2 id2; /* auth-level 2 - workstation referred login */
-	} auth;
-} NET_ID_INFO_CTR;
-
-/* SAM_INFO - sam logon/off id structure - no creds */
-typedef struct sam_info_ex {
-	DOM_CLNT_SRV	client;
-	uint16          logon_level;
-	NET_ID_INFO_CTR *ctr;
-} DOM_SAM_INFO_EX;
-
-/* NET_Q_SAM_LOGON_EX */
-typedef struct net_q_sam_logon_info_ex {
-	DOM_SAM_INFO_EX sam_id;
-	uint16          validation_level;
-	uint32 flags;
-} NET_Q_SAM_LOGON_EX;
-
-/* NET_R_SAM_LOGON_EX */
-typedef struct net_r_sam_logon_info_ex {
-	uint16 switch_value; /* 3 - indicates type of USER INFO */
-	NET_USER_INFO_3 *user;
-
-	uint32 auth_resp; /* 1 - Authoritative response; 0 - Non-Auth? */
-	uint32 flags;
-
-	NTSTATUS status; /* return code */
-} NET_R_SAM_LOGON_EX;
-
 /* LOCKOUT_STRING */
 typedef struct account_lockout_string {
 	uint32 array_size;
diff --git a/source/rpc_client/cli_netlogon.c b/source/rpc_client/cli_netlogon.c
index c3d1360..064de5e 100644
--- a/source/rpc_client/cli_netlogon.c
+++ b/source/rpc_client/cli_netlogon.c
@@ -568,22 +568,36 @@ NTSTATUS rpccli_netlogon_sam_network_logon_ex(struct rpc_pipe_client *cli,
 					      const uint8 chal[8],
 					      DATA_BLOB lm_response,
 					      DATA_BLOB nt_response,
-					      NET_USER_INFO_3 *info3)
+					      struct netr_SamInfo3 **info3)
 {
-	prs_struct qbuf, rbuf;
-	NET_Q_SAM_LOGON_EX q;
-	NET_R_SAM_LOGON_EX r;
 	NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
-	NET_ID_INFO_CTR ctr;
 	int validation_level = 3;
 	const char *workstation_name_slash;
 	const char *server_name_slash;
 	uint8 zeros[16];
-	int i;
+	union netr_LogonLevel *logon = NULL;
+	struct netr_NetworkInfo *network_info;
+	uint8_t authoritative;
+	union netr_Validation validation;
+	struct netr_ChallengeResponse lm;
+	struct netr_ChallengeResponse nt;
+	struct netr_UserSessionKey user_session_key;
+	struct netr_LMSessionKey lmsesskey;
+	uint32_t flags = 0;
+
+	*info3 = NULL;
 
 	ZERO_STRUCT(zeros);
-	ZERO_STRUCT(q);
-	ZERO_STRUCT(r);
+
+	logon = TALLOC_ZERO_P(mem_ctx, union netr_LogonLevel);
+	if (!logon) {
+		return NT_STATUS_NO_MEMORY;
+	}
+
+	network_info = TALLOC_ZERO_P(mem_ctx, struct netr_NetworkInfo);
+	if (!network_info) {
+		return NT_STATUS_NO_MEMORY;
+	}
 
 	if (server[0] != '\\' && server[1] != '\\') {
 		server_name_slash = talloc_asprintf(mem_ctx, "\\\\%s", server);
@@ -604,49 +618,53 @@ NTSTATUS rpccli_netlogon_sam_network_logon_ex(struct rpc_pipe_client *cli,
 
 	/* Initialise input parameters */
 
-	q.validation_level = validation_level;
-
-        ctr.switch_value = NET_LOGON_TYPE;
-
-	init_id_info2(&ctr.auth.id2, domain,
-		      logon_parameters, /* param_ctrl */
-		      0xdead, 0xbeef, /* LUID? */
-		      username, workstation_name_slash, (const uchar*)chal,
-		      lm_response.data, lm_response.length, nt_response.data,
-		      nt_response.length);
+	lm.data = lm_response.data;
+	lm.length = lm_response.length;
+	nt.data = nt_response.data;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list