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

Don't try to convert enumprinters name to a unc name.

This commit is contained in:
Tim Potter 0001-01-01 00:00:00 +00:00
parent 55f891016c
commit e09007dd5d
2 changed files with 7 additions and 13 deletions

View File

@ -401,20 +401,10 @@ WERROR cli_spoolss_enum_printers(struct cli_state *cli, TALLOC_CTX *mem_ctx,
SPOOL_R_ENUMPRINTERS r;
NEW_BUFFER buffer;
WERROR result = W_ERROR(ERRgeneral);
fstring server;
ZERO_STRUCT(q);
ZERO_STRUCT(r);
/* Use server name if no object name specified */
if (name)
slprintf(server, sizeof(fstring) - 1, "\\\\%s", name);
else
slprintf(server, sizeof(fstring) - 1, "\\\\%s", cli->desthost);
strupper (server);
/* Initialise input parameters */
init_buffer(&buffer, offered, mem_ctx);
@ -422,7 +412,7 @@ WERROR cli_spoolss_enum_printers(struct cli_state *cli, TALLOC_CTX *mem_ctx,
prs_init(&qbuf, MAX_PDU_FRAG_LEN, mem_ctx, MARSHALL);
prs_init(&rbuf, 0, mem_ctx, UNMARSHALL);
make_spoolss_q_enumprinters(&q, flags, server, level, &buffer,
make_spoolss_q_enumprinters(&q, flags, name, level, &buffer,
offered);
/* Marshall data and send request */

View File

@ -313,7 +313,7 @@ static NTSTATUS cmd_spoolss_enum_printers(struct cli_state *cli,
uint32 info_level = 1;
PRINTER_INFO_CTR ctr;
uint32 i = 0, num_printers, needed;
char *name = NULL;
fstring name;
if (argc > 3)
{
@ -325,7 +325,11 @@ static NTSTATUS cmd_spoolss_enum_printers(struct cli_state *cli,
info_level = atoi(argv[1]);
if (argc == 3)
name = argv[2];
fstrcpy(name, argv[2]);
else {
slprintf(name, "\\\\%s", cli->desthost);
strupper(name);
}
/* Enumerate printers -- Should we enumerate types other
than PRINTER_ENUM_LOCAL? Maybe accept as a parameter? --jerry */