1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

Backed out enumprinters stuff - leave it for another day.

This commit is contained in:
Tim Potter 0001-01-01 00:00:00 +00:00
parent 8587dd95f8
commit d7efc5dd3d
2 changed files with 13 additions and 25 deletions

View File

@ -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);

View File

@ -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);