svn commit: samba r12916 - branches/SAMBA_3_0/source/rpc_server branches/SAMBA_3_0/source/smbd trunk/source/rpc_server

jerry at samba.org jerry at samba.org
Fri Jan 13 21:22:26 GMT 2006


Author: jerry
Date: 2006-01-13 21:22:25 +0000 (Fri, 13 Jan 2006)
New Revision: 12916

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=12916

Log:
use rpcstr_pull() instead of unistr_to_ascii() when validating share names
Modified:
   branches/SAMBA_3_0/source/rpc_server/srv_srvsvc_nt.c
   branches/SAMBA_3_0/source/smbd/uid.c
   trunk/source/rpc_server/srv_srvsvc_nt.c


Changeset:
Modified: branches/SAMBA_3_0/source/rpc_server/srv_srvsvc_nt.c
===================================================================
--- branches/SAMBA_3_0/source/rpc_server/srv_srvsvc_nt.c	2006-01-13 20:26:59 UTC (rev 12915)
+++ branches/SAMBA_3_0/source/rpc_server/srv_srvsvc_nt.c	2006-01-13 21:22:25 UTC (rev 12916)
@@ -1,5 +1,5 @@
- /* 
-  *  Unix SMB/CIFS implementation.
+/* 
+ *  Unix SMB/CIFS implementation.
  *  RPC Pipe client / server routines
  *  Copyright (C) Andrew Tridgell              1992-1997,
  *  Copyright (C) Jeremy Allison					2001.
@@ -2312,11 +2312,7 @@
 
 	switch ( q_u->type ) {
 	case 0x9:
-		/* Run the name through alpha_strcpy() to remove any unsafe 
-		   shell characters.  Compare the copied string with the original
-		   and fail if the strings don't match */
-
-		unistr2_to_ascii(sharename, &q_u->uni_name, sizeof(sharename));
+		rpcstr_pull(sharename, q_u->uni_name.buffer, sizeof(sharename), q_u->uni_name.uni_str_len*2, 0);
 		if ( !validate_net_name( sharename, INVALID_SHARENAME_CHARS, sizeof(sharename) ) ) {
 			DEBUG(5,("_srv_net_name_validate: Bad sharename \"%s\"\n", sharename));
 			return WERR_INVALID_NAME;

Modified: branches/SAMBA_3_0/source/smbd/uid.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/uid.c	2006-01-13 20:26:59 UTC (rev 12915)
+++ branches/SAMBA_3_0/source/smbd/uid.c	2006-01-13 21:22:25 UTC (rev 12916)
@@ -190,7 +190,7 @@
 
 /****************************************************************************
  Become the user of a connection number without changing the security context
- stack, but modify the currnet_user entries.
+ stack, but modify the current_user entries.
 ****************************************************************************/
 
 BOOL change_to_user(connection_struct *conn, uint16 vuid)

Modified: trunk/source/rpc_server/srv_srvsvc_nt.c
===================================================================
--- trunk/source/rpc_server/srv_srvsvc_nt.c	2006-01-13 20:26:59 UTC (rev 12915)
+++ trunk/source/rpc_server/srv_srvsvc_nt.c	2006-01-13 21:22:25 UTC (rev 12916)
@@ -2118,11 +2118,7 @@
 
 	switch ( q_u->type ) {
 	case 0x9:
-		/* Run the name through alpha_strcpy() to remove any unsafe 
-		   shell characters.  Compare the copied string with the original
-		   and fail if the strings don't match */
-
-		unistr2_to_ascii(sharename, &q_u->uni_name, sizeof(sharename));
+		rpcstr_pull(sharename, q_u->uni_name.buffer, sizeof(sharename), q_u->uni_name.uni_str_len*2, 0);
 		if ( !validate_net_name( sharename, INVALID_SHARENAME_CHARS, sizeof(sharename) ) ) {
 			DEBUG(5,("_srv_net_name_validate: Bad sharename \"%s\"\n", sharename));
 			return WERR_INVALID_NAME;



More information about the samba-cvs mailing list