[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha6-480-ge28a806

Günther Deschner gd at samba.org
Wed Feb 4 23:49:43 GMT 2009


The branch, master has been updated
       via  e28a806a6b65320e5727a4237da57f879c509d26 (commit)
      from  542251f7ae56ea7ac54ff8807d5f04b3598b96f2 (commit)

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


- Log -----------------------------------------------------------------
commit e28a806a6b65320e5727a4237da57f879c509d26
Author: Günther Deschner <gd at samba.org>
Date:   Wed Feb 4 23:49:43 2009 +0100

    s3-parsing: remove a lot of unused structures and their hand marshalling.
    
    Guenther

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

Summary of changes:
 source3/include/proto.h        |   62 ---
 source3/include/rpc_misc.h     |  201 -------
 source3/rpc_parse/parse_misc.c | 1137 ----------------------------------------
 source3/rpc_parse/parse_prs.c  |   50 --
 4 files changed, 0 insertions(+), 1450 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/proto.h b/source3/include/proto.h
index 88742c4..5378156 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -5679,86 +5679,25 @@ uint32 size_of_relative_string(UNISTR *string);
 
 bool smb_io_time(const char *desc, NTTIME *nttime, prs_struct *ps, int depth);
 bool smb_io_nttime(const char *desc, prs_struct *ps, int depth, NTTIME *nttime);
-uint32 get_enum_hnd(ENUM_HND *enh);
-void init_enum_hnd(ENUM_HND *enh, uint32 hnd);
-bool smb_io_enum_hnd(const char *desc, ENUM_HND *hnd, prs_struct *ps, int depth);
 bool smb_io_dom_sid(const char *desc, DOM_SID *sid, prs_struct *ps, int depth);
-void init_dom_sid2(DOM_SID2 *sid2, const DOM_SID *sid);
-bool smb_io_dom_sid2_p(const char *desc, prs_struct *ps, int depth, DOM_SID2 **sid2);
-bool smb_io_dom_sid2(const char *desc, DOM_SID2 *sid, prs_struct *ps, int depth);
 bool smb_io_uuid(const char *desc, struct GUID *uuid, 
 		 prs_struct *ps, int depth);
-void init_str_hdr(STRHDR *hdr, int max_len, int len, uint32 buffer);
-bool smb_io_strhdr(const char *desc,  STRHDR *hdr, prs_struct *ps, int depth);
-void init_uni_hdr(UNIHDR *hdr, UNISTR2 *str2);
-bool smb_io_unihdr(const char *desc, UNIHDR *hdr, prs_struct *ps, int depth);
-void init_buf_hdr(BUFHDR *hdr, int max_len, int len);
-bool smb_io_hdrbuf_pre(const char *desc, BUFHDR *hdr, prs_struct *ps, int depth, uint32 *offset);
-bool smb_io_hdrbuf_post(const char *desc, BUFHDR *hdr, prs_struct *ps, int depth, 
-				uint32 ptr_hdrbuf, uint32 max_len, uint32 len);
-bool smb_io_hdrbuf(const char *desc, BUFHDR *hdr, prs_struct *ps, int depth);
 void init_unistr(UNISTR *str, const char *buf);
 bool smb_io_unistr(const char *desc, UNISTR *uni, prs_struct *ps, int depth);
-void init_rpc_blob_uint32(RPC_DATA_BLOB *str, uint32 val);
-void init_rpc_blob_str(RPC_DATA_BLOB *str, const char *buf, int len);
-void init_rpc_blob_hex(RPC_DATA_BLOB *str, const char *buf);
-void init_rpc_blob_bytes(RPC_DATA_BLOB *str, uint8 *buf, size_t len);
 bool smb_io_buffer5(const char *desc, BUFFER5 *buf5, prs_struct *ps, int depth);
 void init_buf_unistr2(UNISTR2 *str, uint32 *ptr, const char *buf);
 void copy_unistr2(UNISTR2 *str, const UNISTR2 *from);
-void init_string2(STRING2 *str, const char *buf, size_t max_len, size_t str_len);
-bool smb_io_string2(const char *desc, STRING2 *str2, uint32 buffer, prs_struct *ps, int depth);
 void init_unistr2(UNISTR2 *str, const char *buf, enum unistr2_term_codes flags);
-void init_unistr4(UNISTR4 *uni4, const char *buf, enum unistr2_term_codes flags);
-void init_unistr4_w( TALLOC_CTX *ctx, UNISTR4 *uni4, const smb_ucs2_t *buf );
 void init_unistr2_w(TALLOC_CTX *ctx, UNISTR2 *str, const smb_ucs2_t *buf);
 void init_unistr2_from_unistr(TALLOC_CTX *ctx, UNISTR2 *to, const UNISTR *from);
 void init_unistr2_from_datablob(UNISTR2 *str, DATA_BLOB *blob) ;
 bool prs_io_unistr2_p(const char *desc, prs_struct *ps, int depth, UNISTR2 **uni2);
 bool prs_io_unistr2(const char *desc, prs_struct *ps, int depth, UNISTR2 *uni2 );
 bool smb_io_unistr2(const char *desc, UNISTR2 *uni2, uint32 buffer, prs_struct *ps, int depth);
-bool prs_unistr4(const char *desc, prs_struct *ps, int depth, UNISTR4 *uni4);
-bool prs_unistr4_hdr(const char *desc, prs_struct *ps, int depth, UNISTR4 *uni4);
-bool prs_unistr4_str(const char *desc, prs_struct *ps, int depth, UNISTR4 *uni4);
-bool prs_unistr4_array(const char *desc, prs_struct *ps, int depth, UNISTR4_ARRAY *array );
-bool init_unistr4_array( UNISTR4_ARRAY *array, uint32 count, const char **strings );
-void init_dom_rid(DOM_RID *prid, uint32 rid, uint16 type, uint32 idx);
-bool smb_io_dom_rid(const char *desc, DOM_RID *rid, prs_struct *ps, int depth);
-bool smb_io_dom_rid2(const char *desc, DOM_RID2 *rid, prs_struct *ps, int depth);
-void init_dom_rid3(DOM_RID3 *rid3, uint32 rid, uint8 type);
-bool smb_io_dom_rid3(const char *desc, DOM_RID3 *rid3, prs_struct *ps, int depth);
-void init_dom_rid4(DOM_RID4 *rid4, uint16 unknown, uint16 attr, uint32 rid);
-void init_clnt_srv(DOM_CLNT_SRV *logcln, const char *logon_srv,
-		   const char *comp_name);
-bool smb_io_clnt_srv(const char *desc, DOM_CLNT_SRV *logcln, prs_struct *ps, int depth);
-void init_log_info(DOM_LOG_INFO *loginfo, const char *logon_srv, const char *acct_name,
-		uint16 sec_chan, const char *comp_name);
-bool smb_io_log_info(const char *desc, DOM_LOG_INFO *loginfo, prs_struct *ps, int depth);
-bool smb_io_chal(const char *desc, DOM_CHAL *chal, prs_struct *ps, int depth);
-bool smb_io_cred(const char *desc,  DOM_CRED *cred, prs_struct *ps, int depth);
-void init_clnt_info2(DOM_CLNT_INFO2 *clnt,
-				const char *logon_srv, const char *comp_name,
-				const DOM_CRED *clnt_cred);
-bool smb_io_clnt_info2(const char *desc, DOM_CLNT_INFO2 *clnt, prs_struct *ps, int depth);
-void init_clnt_info(DOM_CLNT_INFO *clnt,
-		const char *logon_srv, const char *acct_name,
-		uint16 sec_chan, const char *comp_name,
-		const DOM_CRED *cred);
-bool smb_io_clnt_info(const char *desc,  DOM_CLNT_INFO *clnt, prs_struct *ps, int depth);
-void init_logon_id(DOM_LOGON_ID *logonid, uint32 log_id_low, uint32 log_id_high);
-bool smb_io_logon_id(const char *desc, DOM_LOGON_ID *logonid, prs_struct *ps, int depth);
-void init_owf_info(OWF_INFO *hash, const uint8 data[16]);
-bool smb_io_owf_info(const char *desc, OWF_INFO *hash, prs_struct *ps, int depth);
-bool smb_io_gid(const char *desc,  DOM_GID *gid, prs_struct *ps, int depth);
 bool smb_io_pol_hnd(const char *desc, POLICY_HND *pol, prs_struct *ps, int depth);
 void init_unistr3(UNISTR3 *str, const char *buf);
 bool smb_io_unistr3(const char *desc, UNISTR3 *name, prs_struct *ps, int depth);
 bool prs_uint64(const char *name, prs_struct *ps, int depth, uint64 *data64);
-bool smb_io_bufhdr2(const char *desc, BUFHDR2 *hdr, prs_struct *ps, int depth);
-bool smb_io_bufhdr4(const char *desc, BUFHDR4 *hdr, prs_struct *ps, int depth);
-bool smb_io_rpc_blob(const char *desc, RPC_DATA_BLOB *blob, prs_struct *ps, int depth);
-bool make_uni_hdr(UNIHDR *hdr, int len);
-bool make_bufhdr2(BUFHDR2 *hdr, uint32 info_level, uint32 length, uint32 buffer);
 uint32 str_len_uni(UNISTR *source);
 bool policy_handle_is_valid(const POLICY_HND *hnd);
 
@@ -5816,7 +5755,6 @@ bool prs_uint16s(bool charmode, const char *name, prs_struct *ps, int depth, uin
 bool prs_uint16uni(bool charmode, const char *name, prs_struct *ps, int depth, uint16 *data16s, int len);
 bool prs_uint32s(bool charmode, const char *name, prs_struct *ps, int depth, uint32 *data32s, int len);
 bool prs_buffer5(bool charmode, const char *name, prs_struct *ps, int depth, BUFFER5 *str);
-bool prs_string2(bool charmode, const char *name, prs_struct *ps, int depth, STRING2 *str);
 bool prs_unistr2(bool charmode, const char *name, prs_struct *ps, int depth, UNISTR2 *str);
 bool prs_unistr3(bool charmode, const char *name, UNISTR3 *str, prs_struct *ps, int depth);
 bool prs_unistr(const char *name, prs_struct *ps, int depth, UNISTR *str);
diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h
index 3a3c61e..1e9d43b 100644
--- a/source3/include/rpc_misc.h
+++ b/source3/include/rpc_misc.h
@@ -92,10 +92,6 @@ enum unistr2_term_codes { UNI_FLAGS_NONE = 0, UNI_STR_TERMINATE = 1, UNI_MAXLEN_
  **********************************************************************/
  
 typedef struct policy_handle POLICY_HND;
-typedef struct {
-	uint32 ptr_hnd;          /* pointer to enumeration handle */
-	uint32 handle;           /* enumeration handle */
-} ENUM_HND;
 
 #define OUR_HANDLE(hnd) (((hnd)==NULL) ? "NULL" :\
 	( IVAL((hnd)->uuid.node,2) == (uint32)sys_getpid() ? "OURS" : \
@@ -104,53 +100,6 @@ typedef struct {
 
 
 /********************************************************************** 
- * Buffer Headers -- use by SEC_DESC_BUF in winreg and netlogon code
- **********************************************************************/
- 
-/* TODO: replace this with an encompassing buffer structure */
-typedef struct {
-	uint32 buf_max_len;
-	uint32 buf_len;
-} BUFHDR;
-
-/* this is a BUFHDR + a pointer to a buffer */
-typedef struct {
-	uint32 info_level;
-	uint32 length;		/* uint8 chars */
-	uint32 buffer;
-} BUFHDR2;
-
-/* generic buffer ?  wrapped around void*? */
-typedef struct {
-	uint32 size;
-	uint32 buffer;
-} BUFHDR4;
-
-
-/********************************************************************** 
- * Buffers 
- **********************************************************************/
-
-/* buffer used by \winreg\ calls to fill in arbitrary REG_XXX values.
-   It *may* look like a UNISTR2 but it is *not*.  This is not a goof
-   by the winreg developers.  It is a generic buffer.  buffer length
-   is stored in bytes (not # of uint16's) */
-
-typedef struct {
-	uint32 buf_max_len;
-	uint32 offset;
-	uint32 buf_len;
-	uint16 *buffer;
-} REGVAL_BUFFER;
-
-/* generic rpc version of the DATA_BLOB.  Just a length and uint8 array */
-
-typedef struct {
-	uint32 buf_len;
-	uint8 *buffer;
-} RPC_DATA_BLOB;
-
-/********************************************************************** 
  * Buffers use by spoolss (i might be able to replace it with
  * an RPC_DATA_BLOB)
  **********************************************************************/
@@ -162,22 +111,6 @@ typedef struct {
 
 
 /********************************************************************** 
- * Unicode and basic string headers 
- **********************************************************************/
- 
-typedef struct {
-	uint16 str_str_len;
-	uint16 str_max_len;
-	uint32 buffer; /* non-zero */
-} STRHDR;
-
-typedef struct {
-	uint16 uni_str_len;
-	uint16 uni_max_len;
-	uint32 buffer; 
-} UNIHDR;
-
-/********************************************************************** 
  * UNICODE string variations
  **********************************************************************/
 
@@ -205,138 +138,4 @@ typedef struct {		/* UNISTR3 - XXXX not sure about this structure */
 	UNISTR str;
 } UNISTR3;
 
-typedef struct {		/* Buffer wrapped around a UNISTR2 */
-	uint16 length;		/* number of bytes not counting NULL terminatation */
-	uint16 size;		/* number of bytes including NULL terminatation */
-	UNISTR2 *string;
-} UNISTR4;
-
-typedef struct {
-	uint32 count;
-	UNISTR4 *strings;
-} UNISTR4_ARRAY;
-
-
-/********************************************************************** 
- * String variations
- **********************************************************************/
-
-typedef struct {		/* STRING2 - string size (in uint8 chars) and buffer */
-	uint32 str_max_len;
-	uint32 offset;
-	uint32 str_str_len;
-	uint8  *buffer; 	/* uint8 characters. **NOT** necessarily null-terminated */
-} STRING2;
-
-
-
-
-/********************************************************************** 
- * Domain SID structures
- **********************************************************************/
-
-typedef struct {
-	uint32 num_auths; /* length, bytes, including length of len :-) */
-	DOM_SID sid;
-} DOM_SID2;
-
-
-/********************************************************************** 
- * Domain SID structures
- **********************************************************************/
-
-/* DOM_RID - domain RID structure for ntlsa pipe */
-typedef struct {
-	uint16 type; /* value is SID_NAME_USE enum */
-	uint32 rid;
-	uint32 rid_idx; /* referenced domain index */
-} DOM_RID;
-
-/* DOM_RID2 - second domain RID structure for ntlsa pipe */
-typedef struct {
-	uint16 type; /* value is SID_NAME_USE enum */
-	uint32 rid;
-	uint32 rid_idx; /* referenced domain index */
-	uint32 unknown;
-} DOM_RID2;
-
-typedef struct {		/* DOM_RID3 - domain RID structure for samr pipe */
-	uint32 rid;        /* domain-relative (to a SID) id */
-	uint32 type1;      /* value is 0x1 */
-	uint32 ptr_type;   /* undocumented pointer */
-	uint32 type2;      /* value is 0x1 */
-	uint32 unk; /* value is 0x2 */
-} DOM_RID3;
-
-/* DOM_RID4 - rid + user attributes */
-typedef struct domrid4_info
-{
-	uint32 unknown;
-	uint16 attr;
-	uint32 rid;  /* user RID */
-} DOM_RID4;
-
-/* DOM_GID - group id + user attributes */
-typedef struct {
-	uint32 g_rid;  /* a group RID */
-	uint32 attr;
-} DOM_GID;
-
-/********************************************************************** 
- * ????
- **********************************************************************/
-
-/* DOM_CLNT_SRV - client / server names */
-typedef struct clnt_srv_info {
-	uint32  undoc_buffer; /* undocumented 32 bit buffer pointer */
-	UNISTR2 uni_logon_srv; /* logon server name */
-	uint32  undoc_buffer2; /* undocumented 32 bit buffer pointer */
-	UNISTR2 uni_comp_name; /* client machine name */
-} DOM_CLNT_SRV;
-
-/* DOM_LOG_INFO - login info */
-typedef struct log_info {
-	uint32  undoc_buffer; /* undocumented 32 bit buffer pointer */
-	UNISTR2 uni_logon_srv; /* logon server name */
-	UNISTR2 uni_acct_name; /* account name */
-	uint16  sec_chan;      /* secure channel type */
-	UNISTR2 uni_comp_name; /* client machine name */
-} DOM_LOG_INFO;
-
-/* DOM_CHAL - challenge info */
-typedef struct chal_info {
-	unsigned char data[8]; /* credentials */
-} DOM_CHAL;
- 
-/* DOM_CREDs - timestamped client or server credentials */
-typedef struct cred_info {
-	DOM_CHAL challenge; /* credentials */
-	UTIME timestamp;    /* credential time-stamp */
-} DOM_CRED;
-
-/* DOM_CLNT_INFO - client info */
-typedef struct clnt_info {
-	DOM_LOG_INFO login;
-	DOM_CRED     cred;
-} DOM_CLNT_INFO;
-
-/* DOM_CLNT_INFO2 - client info */
-typedef struct clnt_info2 {
-	DOM_CLNT_SRV login;
-	uint32        ptr_cred;
-	DOM_CRED      cred;
-} DOM_CLNT_INFO2;
-
-/* DOM_LOGON_ID - logon id */
-typedef struct logon_info {
-	uint32 low;
-	uint32 high;
-} DOM_LOGON_ID;
-
-/* OWF INFO */
-typedef struct owf_info {
-	uint8 data[16];
-} OWF_INFO;
-
-
 #endif /* _RPC_MISC_H */
diff --git a/source3/rpc_parse/parse_misc.c b/source3/rpc_parse/parse_misc.c
index 7d1d00a..38d5b95 100644
--- a/source3/rpc_parse/parse_misc.c
+++ b/source3/rpc_parse/parse_misc.c
@@ -26,27 +26,6 @@
 #define DBGC_CLASS DBGC_RPC_PARSE
 
 /*******************************************************************
- Reads or writes a UTIME type.
-********************************************************************/
-
-static bool smb_io_utime(const char *desc, UTIME *t, prs_struct *ps, int depth)
-{
-	if (t == NULL)
-		return False;
-
-	prs_debug(ps, depth, desc, "smb_io_utime");
-	depth++;
-
-	if(!prs_align(ps))
-		return False;
-	
-	if(!prs_uint32 ("time", ps, depth, &t->time))
-		return False;
-
-	return True;
-}
-
-/*******************************************************************
  Reads or writes an NTTIME structure.
 ********************************************************************/
 
@@ -89,53 +68,6 @@ bool smb_io_nttime(const char *desc, prs_struct *ps, int depth, NTTIME *nttime)
 }
 
 /*******************************************************************
- Gets an enumeration handle from an ENUM_HND structure.
-********************************************************************/
-
-uint32 get_enum_hnd(ENUM_HND *enh)
-{
-	return (enh && enh->ptr_hnd != 0) ? enh->handle : 0;
-}
-
-/*******************************************************************
- Inits an ENUM_HND structure.
-********************************************************************/
-
-void init_enum_hnd(ENUM_HND *enh, uint32 hnd)
-{
-	DEBUG(5,("smb_io_enum_hnd\n"));
-
-	enh->ptr_hnd = (hnd != 0) ? 1 : 0;
-	enh->handle = hnd;
-}
-
-/*******************************************************************
- Reads or writes an ENUM_HND structure.
-********************************************************************/
-
-bool smb_io_enum_hnd(const char *desc, ENUM_HND *hnd, prs_struct *ps, int depth)
-{
-	if (hnd == NULL)
-		return False;
-
-	prs_debug(ps, depth, desc, "smb_io_enum_hnd");
-	depth++;
-
-	if(!prs_align(ps))
-		return False;
-	
-	if(!prs_uint32("ptr_hnd", ps, depth, &hnd->ptr_hnd)) /* pointer */
-		return False;
-
-	if (hnd->ptr_hnd != 0) {
-		if(!prs_uint32("handle ", ps, depth, &hnd->handle )) /* enum handle */
-			return False;
-	}
-
-	return True;
-}
-
-/*******************************************************************
  Reads or writes a DOM_SID structure.
 ********************************************************************/
 
@@ -174,67 +106,6 @@ bool smb_io_dom_sid(const char *desc, DOM_SID *sid, prs_struct *ps, int depth)
 }
 
 /*******************************************************************
- Inits a DOM_SID2 structure.
-********************************************************************/
-
-void init_dom_sid2(DOM_SID2 *sid2, const DOM_SID *sid)
-{
-	sid2->sid = *sid;
-	sid2->num_auths = sid2->sid.num_auths;
-}
-
-/*******************************************************************
- Reads or writes a DOM_SID2 structure.
-********************************************************************/
-
-bool smb_io_dom_sid2_p(const char *desc, prs_struct *ps, int depth, DOM_SID2 **sid2)
-{
-	uint32 data_p;
-
-	/* caputure the pointer value to stream */
-
-	data_p = *sid2 ? 0xf000baaa : 0;
-
-	if ( !prs_uint32("dom_sid2_p", ps, depth, &data_p ))
-		return False;
-
-	/* we're done if there is no data */
-
-	if ( !data_p )
-		return True;
-
-	if (UNMARSHALLING(ps)) {
-		if ( !(*sid2 = PRS_ALLOC_MEM(ps, DOM_SID2, 1)) )
-			return False;
-	}
-
-	return True;
-}
-/*******************************************************************
- Reads or writes a DOM_SID2 structure.
-********************************************************************/
-
-bool smb_io_dom_sid2(const char *desc, DOM_SID2 *sid, prs_struct *ps, int depth)
-{
-	if (sid == NULL)
-		return False;
-
-	prs_debug(ps, depth, desc, "smb_io_dom_sid2");
-	depth++;
-
-	if(!prs_align(ps))
-		return False;
-	
-	if(!prs_uint32("num_auths", ps, depth, &sid->num_auths))
-		return False;
-
-	if(!smb_io_dom_sid("sid", &sid->sid, ps, depth))
-		return False;
-
-	return True;
-}
-
-/*******************************************************************
  Reads or writes a struct GUID
 ********************************************************************/
 
@@ -263,163 +134,6 @@ bool smb_io_uuid(const char *desc, struct GUID *uuid,
 }
 
 /*******************************************************************
-creates a STRHDR structure.
-********************************************************************/
-
-void init_str_hdr(STRHDR *hdr, int max_len, int len, uint32 buffer)
-{
-	hdr->str_max_len = max_len;
-	hdr->str_str_len = len;
-	hdr->buffer      = buffer;
-}
-
-/*******************************************************************
- Reads or writes a STRHDR structure.


-- 
Samba Shared Repository


More information about the samba-cvs mailing list