From a169b950c778f066b189de770d0690dcc2fdbe91 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Mon, 11 Oct 2004 20:01:01 +0000 Subject: 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) --- source3/rpc_server/srv_spoolss_nt.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'source3/rpc_server') 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)); -- cgit