[SCM] Samba Shared Repository - branch master updated

Günther Deschner gd at samba.org
Wed Jul 7 07:36:04 MDT 2010


The branch, master has been updated
       via  519d17e... s3-rpc_misc: remove unused UNISTR.
       via  7e1fa8d... s3-rpc_parse: remove finally unused prs_unistr().
      from  8def236... s3-libgpo: remove handmarshalled PReg parser from registry CSE.

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


- Log -----------------------------------------------------------------
commit 519d17e451399f09f154dc581a22e74162ff7807
Author: Günther Deschner <gd at samba.org>
Date:   Wed Jul 7 12:40:41 2010 +0200

    s3-rpc_misc: remove unused UNISTR.
    
    Guenther

commit 7e1fa8d06774de4fa103118006309b2d1d63069b
Author: Günther Deschner <gd at samba.org>
Date:   Wed Jul 7 12:39:46 2010 +0200

    s3-rpc_parse: remove finally unused prs_unistr().
    
    Guenther

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

Summary of changes:
 source3/include/proto.h       |    1 -
 source3/include/rpc_misc.h    |   11 ----
 source3/rpc_parse/parse_prs.c |  124 -----------------------------------------
 3 files changed, 0 insertions(+), 136 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/proto.h b/source3/include/proto.h
index a74373f..ee6f446 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -5051,7 +5051,6 @@ bool prs_dcerpc_status(const char *name, prs_struct *ps, int depth, NTSTATUS *st
 bool prs_uint8s(bool charmode, const char *name, prs_struct *ps, int depth, uint8 *data8s, int len);
 bool prs_uint16s(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_unistr(const char *name, prs_struct *ps, int depth, UNISTR *str);
 bool prs_init_data_blob(prs_struct *prs, DATA_BLOB *blob, TALLOC_CTX *mem_ctx);
 bool prs_data_blob(prs_struct *prs, DATA_BLOB *blob, TALLOC_CTX *mem_ctx);
 
diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h
index 85dd1ce..08ee5de 100644
--- a/source3/include/rpc_misc.h
+++ b/source3/include/rpc_misc.h
@@ -34,15 +34,4 @@
 		"OTHER")), ((unsigned int)IVAL((hnd)->uuid.node,2)),\
 		((unsigned int)sys_getpid() )
 
-
-/********************************************************************** 
- * UNICODE string variations
- **********************************************************************/
-
-
-typedef struct {		/* UNISTR - unicode string size and buffer */
-	uint16 *buffer;		/* unicode characters. ***MUST*** be 
-				   little-endian. ***MUST*** be null-terminated */
-} UNISTR;
-
 #endif /* _RPC_MISC_H */
diff --git a/source3/rpc_parse/parse_prs.c b/source3/rpc_parse/parse_prs.c
index c460f1f..ec5bc9c 100644
--- a/source3/rpc_parse/parse_prs.c
+++ b/source3/rpc_parse/parse_prs.c
@@ -886,130 +886,6 @@ bool prs_uint32s(bool charmode, const char *name, prs_struct *ps, int depth, uin
 }
 
 /*******************************************************************
- Stream a unicode  null-terminated string. As the string is already
- in little-endian format then do it as a stream of bytes.
- ********************************************************************/
-
-bool prs_unistr(const char *name, prs_struct *ps, int depth, UNISTR *str)
-{
-	unsigned int len = 0;
-	unsigned char *p = (unsigned char *)str->buffer;
-	uint8 *start;
-	char *q;
-	uint32 max_len;
-	uint16* ptr;
-
-	if (MARSHALLING(ps)) {
-
-		for(len = 0; str->buffer[len] != 0; len++)
-			;
-
-		q = prs_mem_get(ps, (len+1)*2);
-		if (q == NULL)
-			return False;
-
-		start = (uint8*)q;
-
-		for(len = 0; str->buffer[len] != 0; len++) {
-			if(ps->bigendian_data) {
-				/* swap bytes - p is little endian, q is big endian. */
-				q[0] = (char)p[1];
-				q[1] = (char)p[0];
-				p += 2;
-				q += 2;
-			} 
-			else 
-			{
-				q[0] = (char)p[0];
-				q[1] = (char)p[1];
-				p += 2;
-				q += 2;
-			}
-		}
-
-		/*
-		 * even if the string is 'empty' (only an \0 char)
-		 * at this point the leading \0 hasn't been parsed.
-		 * so parse it now
-		 */
-
-		q[0] = 0;
-		q[1] = 0;
-		q += 2;
-
-		len++;
-
-		DEBUGADD(5,("%s%04x %s: ", tab_depth(5,depth), ps->data_offset, name));
-		print_asc(5, (unsigned char*)start, 2*len);	
-		DEBUGADD(5, ("\n"));
-	}
-	else { /* unmarshalling */
-	
-		uint32 alloc_len = 0;
-		q = ps->data_p + prs_offset(ps);
-
-		/*
-		 * Work out how much space we need and talloc it.
-		 */
-		max_len = (ps->buffer_size - ps->data_offset)/sizeof(uint16);
-
-		/* the test of the value of *ptr helps to catch the circumstance
-		   where we have an emtpty (non-existent) string in the buffer */
-		for ( ptr = (uint16 *)q; *ptr++ && (alloc_len <= max_len); alloc_len++)
-			/* do nothing */ 
-			;
-
-		if (alloc_len < max_len)
-			alloc_len += 1;
-
-		/* should we allocate anything at all? */
-		str->buffer = PRS_ALLOC_MEM(ps,uint16,alloc_len);
-		if ((str->buffer == NULL) && (alloc_len > 0))
-			return False;
-
-		p = (unsigned char *)str->buffer;
-
-		len = 0;
-		/* the (len < alloc_len) test is to prevent us from overwriting
-		   memory that is not ours...if we get that far, we have a non-null
-		   terminated string in the buffer and have messed up somewhere */
-		while ((len < alloc_len) && (*(uint16 *)q != 0)) {
-			if(ps->bigendian_data) 
-			{
-				/* swap bytes - q is big endian, p is little endian. */
-				p[0] = (unsigned char)q[1];
-				p[1] = (unsigned char)q[0];
-				p += 2;
-				q += 2;
-			} else {
-
-				p[0] = (unsigned char)q[0];
-				p[1] = (unsigned char)q[1];
-				p += 2;
-				q += 2;
-			}
-
-			len++;
-		} 
-		if (len < alloc_len) {
-			/* NULL terminate the UNISTR */
-			str->buffer[len++] = '\0';
-		}
-
-		DEBUGADD(5,("%s%04x %s: ", tab_depth(5,depth), ps->data_offset, name));
-		print_asc(5, (unsigned char*)str->buffer, 2*len);	
-		DEBUGADD(5, ("\n"));
-	}
-
-	/* set the offset in the prs_struct; 'len' points to the
-	   terminiating NULL in the UNISTR so we need to go one more
-	   uint16 */
-	ps->data_offset += (len)*2;
-	
-	return True;
-}
-
-/*******************************************************************
 creates a new prs_struct containing a DATA_BLOB
 ********************************************************************/
 bool prs_init_data_blob(prs_struct *prs, DATA_BLOB *blob, TALLOC_CTX *mem_ctx)


-- 
Samba Shared Repository


More information about the samba-cvs mailing list