The Samba-Bugzilla – Attachment 3242 Details for
Bug 5372
Printers and Faxes shows up empty in 3.2 from an XP client
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
look (text/plain), 5.07 KB, created by
Jeremy Allison
on 2008-04-04 13:12:48 UTC
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2008-04-04 13:12:48 UTC
Size:
5.07 KB
patch
obsolete
>diff --git a/source/printing/nt_printing.c b/source/printing/nt_printing.c >index 68b0359..7b03a32 100644 >--- a/source/printing/nt_printing.c >+++ b/source/printing/nt_printing.c >@@ -3973,7 +3973,11 @@ static void map_to_os2_driver(fstring drivername) > /**************************************************************************** > Get a default printer info 2 struct. > ****************************************************************************/ >-static WERROR get_a_printer_2_default(NT_PRINTER_INFO_LEVEL_2 *info, const char *servername, const char* sharename) >+ >+static WERROR get_a_printer_2_default(NT_PRINTER_INFO_LEVEL_2 *info, >+ const char *servername, >+ const char* sharename, >+ bool get_loc_com) > { > int snum = lp_servicenumber(sharename); > >@@ -4000,7 +4004,7 @@ static WERROR get_a_printer_2_default(NT_PRINTER_INFO_LEVEL_2 *info, const char > fstrcpy(info->datatype, "RAW"); > > #ifdef HAVE_CUPS >- if ( (enum printing_types)lp_printing(snum) == PRINT_CUPS ) { >+ if (get_loc_com && (enum printing_types)lp_printing(snum) == PRINT_CUPS ) { > /* Pull the location and comment strings from cups if we don't > already have one */ > if ( !strlen(info->location) || !strlen(info->comment) ) >@@ -4049,7 +4053,11 @@ fail: > > /**************************************************************************** > ****************************************************************************/ >-static WERROR get_a_printer_2(NT_PRINTER_INFO_LEVEL_2 *info, const char *servername, const char *sharename) >+ >+static WERROR get_a_printer_2(NT_PRINTER_INFO_LEVEL_2 *info, >+ const char *servername, >+ const char *sharename, >+ bool get_loc_com) > { > int len = 0; > int snum = lp_servicenumber(sharename); >@@ -4062,7 +4070,8 @@ static WERROR get_a_printer_2(NT_PRINTER_INFO_LEVEL_2 *info, const char *servern > > dbuf = tdb_fetch(tdb_printers, kbuf); > if (!dbuf.dptr) { >- return get_a_printer_2_default(info, servername, sharename); >+ return get_a_printer_2_default(info, servername, >+ sharename, get_loc_com); > } > > len += tdb_unpack(dbuf.dptr+len, dbuf.dsize-len, "dddddddddddfffffPfffff", >@@ -4110,7 +4119,7 @@ static WERROR get_a_printer_2(NT_PRINTER_INFO_LEVEL_2 *info, const char *servern > fstrcpy(info->printername, printername); > > #ifdef HAVE_CUPS >- if ( (enum printing_types)lp_printing(snum) == PRINT_CUPS ) { >+ if (get_loc_com && (enum printing_types)lp_printing(snum) == PRINT_CUPS ) { > /* Pull the location and comment strings from cups if we don't > already have one */ > if ( !strlen(info->location) || !strlen(info->comment) ) >@@ -4694,8 +4703,8 @@ WERROR save_driver_init(NT_PRINTER_INFO_LEVEL *printer, uint32 level, uint8 *dat > > ****************************************************************************/ > >-WERROR get_a_printer( Printer_entry *print_hnd, NT_PRINTER_INFO_LEVEL **pp_printer, uint32 level, >- const char *sharename) >+static WERROR get_a_printer_internal( Printer_entry *print_hnd, NT_PRINTER_INFO_LEVEL **pp_printer, uint32 level, >+ const char *sharename, bool get_loc_com) > { > WERROR result; > fstring servername; >@@ -4723,11 +4732,11 @@ WERROR get_a_printer( Printer_entry *print_hnd, NT_PRINTER_INFO_LEVEL **pp_print > sizeof(servername)-1 ); > } > >- result = get_a_printer_2( (*pp_printer)->info_2, servername, sharename ); >- >- >+ result = get_a_printer_2( (*pp_printer)->info_2, >+ servername, sharename, get_loc_com); >+ > /* we have a new printer now. Save it with this handle */ >- >+ > if ( !W_ERROR_IS_OK(result) ) { > TALLOC_FREE( *pp_printer ); > DEBUG(10,("get_a_printer: [%s] level %u returning %s\n", >@@ -4747,6 +4756,24 @@ WERROR get_a_printer( Printer_entry *print_hnd, NT_PRINTER_INFO_LEVEL **pp_print > return WERR_OK; > } > >+WERROR get_a_printer( Printer_entry *print_hnd, >+ NT_PRINTER_INFO_LEVEL **pp_printer, >+ uint32 level, >+ const char *sharename) >+{ >+ return get_a_printer_internal(print_hnd, pp_printer, level, >+ sharename, true); >+} >+ >+WERROR get_a_printer_search( Printer_entry *print_hnd, >+ NT_PRINTER_INFO_LEVEL **pp_printer, >+ uint32 level, >+ const char *sharename) >+{ >+ return get_a_printer_internal(print_hnd, pp_printer, level, >+ sharename, false); >+} >+ > /**************************************************************************** > Deletes a NT_PRINTER_INFO_LEVEL struct. > ****************************************************************************/ >diff --git a/source/rpc_server/srv_spoolss_nt.c b/source/rpc_server/srv_spoolss_nt.c >index 403beb6..7788e76 100644 >--- a/source/rpc_server/srv_spoolss_nt.c >+++ b/source/rpc_server/srv_spoolss_nt.c >@@ -521,7 +521,13 @@ static bool set_printer_hnd_name(Printer_entry *Printer, char *handlename) > fstrcpy(sname, lp_servicename(snum)); > > printer = NULL; >- result = get_a_printer( NULL, &printer, 2, sname ); >+ >+ /* This call doesn't fill in the location or comment from >+ * a CUPS server for efficiency with large numbers of printers. >+ * JRA. >+ */ >+ >+ result = get_a_printer_search( NULL, &printer, 2, sname ); > if ( !W_ERROR_IS_OK(result) ) { > DEBUG(0,("set_printer_hnd_name: failed to lookup printer [%s] -- result [%s]\n", > sname, dos_errstr(result)));
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 5372
: 3242