summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2004-10-11 20:01:01 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:52:56 -0500
commita169b950c778f066b189de770d0690dcc2fdbe91 (patch)
tree54fece6e401ad47c099bba664293fb8e0cefa173
parent86228705c00a1996cd86d1b026eb24b5d59fad4b (diff)
downloadsamba-a169b950c778f066b189de770d0690dcc2fdbe91.tar.gz
samba-a169b950c778f066b189de770d0690dcc2fdbe91.tar.bz2
samba-a169b950c778f066b189de770d0690dcc2fdbe91.zip
r2918: BUG 1907: fix getprinterdriverdir_1(). have to make sure we don't add unnecessary double slashes to the servername
(This used to be commit 859599dbcaa9e39a7902cc959955fcea2dad334b)
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index fb498e73ad..a1db4c3854 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -7700,13 +7700,22 @@ static WERROR getprinterdriverdir_level_1(UNISTR2 *name, UNISTR2 *uni_environmen
pstring path;
pstring long_archi;
fstring servername;
+ char *pservername;
const char *short_archi;
DRIVER_DIRECTORY_1 *info=NULL;
unistr2_to_ascii(servername, name, sizeof(servername)-1);
unistr2_to_ascii(long_archi, uni_environment, sizeof(long_archi)-1);
+
+ /* check for beginning double '\'s and that the server
+ long enough */
+
+ pservername = servername;
+ if ( *pservername == '\\' && strlen(servername)>2 ) {
+ pservername += 2;
+ }
- if ( !is_myname_or_ipaddr( servername ) )
+ if ( !is_myname_or_ipaddr( pservername ) )
return WERR_INVALID_PARAM;
if (!(short_archi = get_short_archi(long_archi)))
@@ -7715,7 +7724,7 @@ static WERROR getprinterdriverdir_level_1(UNISTR2 *name, UNISTR2 *uni_environmen
if((info=(DRIVER_DIRECTORY_1 *)malloc(sizeof(DRIVER_DIRECTORY_1))) == NULL)
return WERR_NOMEM;
- slprintf(path, sizeof(path)-1, "\\\\%s\\print$\\%s", servername, short_archi);
+ slprintf(path, sizeof(path)-1, "\\\\%s\\print$\\%s", pservername, short_archi);
DEBUG(4,("printer driver directory: [%s]\n", path));