summaryrefslogtreecommitdiffstats
path: root/source/rpc_server
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2002-03-14 01:48:59 +0000
committerTim Potter <tpot@samba.org>2002-03-14 01:48:59 +0000
commitd7efc5dd3dd712e7138b5c79eea9756125757175 (patch)
treec3c5a723284ec05ecb0ceb4a83321d6a43e5d321 /source/rpc_server
parent8587dd95f850b4c6d2f015fe97ef98759ee8c236 (diff)
downloadsamba-d7efc5dd3dd712e7138b5c79eea9756125757175.tar.gz
samba-d7efc5dd3dd712e7138b5c79eea9756125757175.tar.xz
samba-d7efc5dd3dd712e7138b5c79eea9756125757175.zip
Backed out enumprinters stuff - leave it for another day.
Diffstat (limited to 'source/rpc_server')
-rw-r--r--source/rpc_server/srv_spoolss_nt.c34
1 files changed, 10 insertions, 24 deletions
diff --git a/source/rpc_server/srv_spoolss_nt.c b/source/rpc_server/srv_spoolss_nt.c
index f0ea088dc3a..3479e47f769 100644
--- a/source/rpc_server/srv_spoolss_nt.c
+++ b/source/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, &current_prt, snum, True)) {
+ if (construct_printer_info_1(flags, &current_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);