diff options
author | Tim Potter <tpot@samba.org> | 2002-03-14 01:48:59 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2002-03-14 01:48:59 +0000 |
commit | 8975d3ef70916bc13c8186c92e66260abc91aaaa (patch) | |
tree | f97b08745ae568cc29956ab8b7ed5c05af23b8e6 /source3 | |
parent | d6d9e385cc6ce61de9fec572209134be728cf1b0 (diff) | |
download | samba-8975d3ef70916bc13c8186c92e66260abc91aaaa.tar.gz samba-8975d3ef70916bc13c8186c92e66260abc91aaaa.tar.bz2 samba-8975d3ef70916bc13c8186c92e66260abc91aaaa.zip |
Backed out enumprinters stuff - leave it for another day.
(This used to be commit d7efc5dd3dd712e7138b5c79eea9756125757175)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/printing/nt_printing.c | 4 | ||||
-rw-r--r-- | source3/rpc_server/srv_spoolss_nt.c | 34 |
2 files changed, 13 insertions, 25 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index 7826212ae9..43667a674d 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -2607,7 +2607,9 @@ static WERROR get_a_printer_2(NT_PRINTER_INFO_LEVEL_2 **info_ptr, fstring sharen /* Restore the stripped strings. */ slprintf(info.servername, sizeof(info.servername)-1, "\\\\%s", get_called_name()); - strupper(info.servername); + slprintf(printername, sizeof(printername)-1, "\\\\%s\\%s", get_called_name(), + info.printername); + fstrcpy(info.printername, printername); len += unpack_devicemode(&info.devmode,dbuf.dptr+len, dbuf.dsize-len); diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index f0ea088dc3..3479e47f76 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -2618,13 +2618,9 @@ static BOOL construct_printer_info_0(PRINTER_INFO_0 *printer, int snum) /******************************************************************** * construct_printer_info_1 * fill a printer_info_1 struct - * - * The is_enum parameter says whether the PRINTER_INFO_1 returned is - * to be used in an enumprinters call. This affects whether the netbios - * name of the server is prefixed to the printer and server names. ********************************************************************/ -static BOOL construct_printer_info_1(uint32 flags, PRINTER_INFO_1 *printer, - int snum, BOOL is_enum) + +static BOOL construct_printer_info_1(uint32 flags, PRINTER_INFO_1 *printer, int snum) { pstring chaine; pstring chaine2; @@ -2637,23 +2633,13 @@ static BOOL construct_printer_info_1(uint32 flags, PRINTER_INFO_1 *printer, if (*ntprinter->info_2->comment == '\0') { init_unistr(&printer->comment, lp_comment(snum)); - if (is_enum) { - char *p; - - p = strchr(ntprinter->info_2->printername + 2, '\\'); - - if (p) - fstrcpy(ntprinter->info_2->printername, p + 1); - } - slprintf(chaine,sizeof(chaine)-1,"%s,%s,%s", - ntprinter->info_2->printername, - ntprinter->info_2->drivername, lp_comment(snum)); - } else { + slprintf(chaine,sizeof(chaine)-1,"%s%s,%s,%s",get_called_name(), ntprinter->info_2->printername, + ntprinter->info_2->drivername, lp_comment(snum)); + } + else { init_unistr(&printer->comment, ntprinter->info_2->comment); /* saved comment. */ - slprintf(chaine,sizeof(chaine)-1,"%s,%s,%s", - ntprinter->info_2->printername, - ntprinter->info_2->drivername, - ntprinter->info_2->comment); + slprintf(chaine,sizeof(chaine)-1,"%s%s,%s,%s",get_called_name(), ntprinter->info_2->printername, + ntprinter->info_2->drivername, ntprinter->info_2->comment); } slprintf(chaine2,sizeof(chaine)-1,"%s", ntprinter->info_2->printername); @@ -2942,7 +2928,7 @@ static WERROR enum_all_printers_info_1(uint32 flags, NEW_BUFFER *buffer, uint32 if (lp_browseable(snum) && lp_snum_ok(snum) && lp_print_ok(snum) ) { DEBUG(4,("Found a printer in smb.conf: %s[%x]\n", lp_servicename(snum), snum)); - if (construct_printer_info_1(flags, ¤t_prt, snum, True)) { + if (construct_printer_info_1(flags, ¤t_prt, snum)) { if((tp=Realloc(printers, (*returned +1)*sizeof(PRINTER_INFO_1))) == NULL) { DEBUG(2,("enum_all_printers_info_1: failed to enlarge printers buffer!\n")); SAFE_FREE(printers); @@ -3306,7 +3292,7 @@ static WERROR getprinter_level_1(int snum, NEW_BUFFER *buffer, uint32 offered, u if((printer=(PRINTER_INFO_1*)malloc(sizeof(PRINTER_INFO_1))) == NULL) return WERR_NOMEM; - construct_printer_info_1(PRINTER_ENUM_ICON8, printer, snum, False); + construct_printer_info_1(PRINTER_ENUM_ICON8, printer, snum); /* check the required size. */ *needed += spoolss_size_printer_info_1(printer); |