summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2002-08-27 00:38:55 +0000
committerTim Potter <tpot@samba.org>2002-08-27 00:38:55 +0000
commit83c598588017c2d0d71ab44cb3f319d11a7f600e (patch)
tree9267b0ba3fd79e5f49d170016f9ae3b2f2c452c5 /source3/rpcclient
parentdc40c5fb2dd21adc4939d30679e68ef845c633c1 (diff)
downloadsamba-83c598588017c2d0d71ab44cb3f319d11a7f600e.tar.gz
samba-83c598588017c2d0d71ab44cb3f319d11a7f600e.tar.bz2
samba-83c598588017c2d0d71ab44cb3f319d11a7f600e.zip
Pass the object name down to the enum_printers rpc. By default this is the
server name and everything works as advertised. See the MSDN doco for details. (This used to be commit d6b10fe9691bfc96d5933c029990c60fd292bdc9)
Diffstat (limited to 'source3/rpcclient')
-rw-r--r--source3/rpcclient/cmd_spoolss.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c
index 22e2db41f3..8ea5ec6837 100644
--- a/source3/rpcclient/cmd_spoolss.c
+++ b/source3/rpcclient/cmd_spoolss.c
@@ -313,16 +313,19 @@ 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;
- if (argc > 2)
+ if (argc > 3)
{
- printf("Usage: %s [level]\n", argv[0]);
+ printf("Usage: %s [level] [name]\n", argv[0]);
return NT_STATUS_OK;
}
- if (argc == 2) {
+ if (argc == 2)
info_level = atoi(argv[1]);
- }
+
+ if (argc == 3)
+ name = argv[2];
/* Enumerate printers -- Should we enumerate types other
than PRINTER_ENUM_LOCAL? Maybe accept as a parameter? --jerry */
@@ -330,12 +333,12 @@ static NTSTATUS cmd_spoolss_enum_printers(struct cli_state *cli,
ZERO_STRUCT(ctr);
result = cli_spoolss_enum_printers(
- cli, mem_ctx, 0, &needed, PRINTER_ENUM_LOCAL,
+ cli, mem_ctx, 0, &needed, name, PRINTER_ENUM_LOCAL,
info_level, &num_printers, &ctr);
if (W_ERROR_V(result) == ERRinsufficientbuffer)
result = cli_spoolss_enum_printers(
- cli, mem_ctx, needed, NULL, PRINTER_ENUM_LOCAL,
+ cli, mem_ctx, needed, NULL, name, PRINTER_ENUM_LOCAL,
info_level, &num_printers, &ctr);
if (W_ERROR_IS_OK(result)) {