r12916: use rpcstr_pull() instead of unistr_to_ascii() when validating share names
authorGerald Carter <jerry@samba.org>
Fri, 13 Jan 2006 21:22:25 +0000 (21:22 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:06:07 +0000 (11:06 -0500)
source/rpc_server/srv_srvsvc_nt.c
source/smbd/uid.c

index 090aa4c9ff284a2d9d06dc867261b3ccaeae1461..230f0626628e4e45fa3647ee86820510ca59f45d 100644 (file)
@@ -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 @@ WERROR _srv_net_name_validate(pipes_struct *p, SRV_Q_NET_NAME_VALIDATE *q_u, SRV
 
        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;
index 458eb3a2c86a7b1e4846374eb045ca393f888bff..9db3d97ab2dcf0ddff1787621a6f2f06e41e7e96 100644 (file)
@@ -190,7 +190,7 @@ static BOOL check_user_ok(connection_struct *conn, user_struct *vuser,int snum)
 
 /****************************************************************************
  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)