diff options
author | Tim Potter <tpot@samba.org> | 2002-08-27 01:48:00 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2002-08-27 01:48:00 +0000 |
commit | dbbb157b2ed951336af1db4c2584cca5af234620 (patch) | |
tree | 282b19d83c191f1559521dc87e3f56086bcc9c1b | |
parent | b1037bffcf07ee6d4b978faf6906e276d09c06d2 (diff) | |
download | samba-dbbb157b2ed951336af1db4c2584cca5af234620.tar.gz samba-dbbb157b2ed951336af1db4c2584cca5af234620.tar.bz2 samba-dbbb157b2ed951336af1db4c2584cca5af234620.zip |
Don't try to convert enumprinters name to a unc name.
(This used to be commit e09007dd5d17d5f84aea3c2fed16ce79ba7be1f2)
-rw-r--r-- | source3/rpc_client/cli_spoolss.c | 12 | ||||
-rw-r--r-- | source3/rpcclient/cmd_spoolss.c | 8 |
2 files changed, 7 insertions, 13 deletions
diff --git a/source3/rpc_client/cli_spoolss.c b/source3/rpc_client/cli_spoolss.c index 0a869e45a2..7369e5008a 100644 --- a/source3/rpc_client/cli_spoolss.c +++ b/source3/rpc_client/cli_spoolss.c @@ -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 */ diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c index 8ea5ec6837..337c176b0a 100644 --- a/source3/rpcclient/cmd_spoolss.c +++ b/source3/rpcclient/cmd_spoolss.c @@ -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 */ |