summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2001-05-18 04:11:17 +0000
committerGerald Carter <jerry@samba.org>2001-05-18 04:11:17 +0000
commit43000d8d0662d4979ae2aa574c10aef0952cd49a (patch)
treefc03da961f875444afb0751df048c13b34551031 /source3/rpcclient
parentc912d04389e9bd38ac4e5ef8b29fae1faaf86e7b (diff)
downloadsamba-43000d8d0662d4979ae2aa574c10aef0952cd49a.tar.gz
samba-43000d8d0662d4979ae2aa574c10aef0952cd49a.tar.bz2
samba-43000d8d0662d4979ae2aa574c10aef0952cd49a.zip
merge from 2.2 (deleteprinterdriver RPC)
(This used to be commit 515caaf7b448e55206433a9ca04fb5078f91cde2)
Diffstat (limited to 'source3/rpcclient')
-rw-r--r--source3/rpcclient/cmd_spoolss.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c
index fc1ac49430..32131ad780 100644
--- a/source3/rpcclient/cmd_spoolss.c
+++ b/source3/rpcclient/cmd_spoolss.c
@@ -1315,11 +1315,12 @@ static uint32 cmd_spoolss_deletedriver (struct cli_state *cli, int argc, char **
uint32 result = NT_STATUS_UNSUCCESSFUL;
fstring servername;
TALLOC_CTX *mem_ctx = NULL;
+ int i;
/* parse the command arguements */
- if (argc != 3)
+ if (argc != 2)
{
- printf ("Usage: %s <arch> <driver>\n", argv[0]);
+ printf ("Usage: %s <driver>\n", argv[0]);
return NT_STATUS_NOPROBLEMO;
}
@@ -1339,13 +1340,19 @@ static uint32 cmd_spoolss_deletedriver (struct cli_state *cli, int argc, char **
return NT_STATUS_UNSUCCESSFUL;
}
- /* make the call to remove the driver */
- if ((result = cli_spoolss_deleteprinterdriver(cli, mem_ctx, argv[1], argv[2])) != NT_STATUS_NO_PROBLEMO)
+ /* delete the driver for all architectures */
+ for (i=0; archi_table[i].long_archi; i++)
{
- printf ("Failed to remove %s driver %s!\n", argv[1], argv[2]);
- goto done;;
+ /* make the call to remove the driver */
+ if ((result = cli_spoolss_deleteprinterdriver(cli, mem_ctx,
+ archi_table[i].long_archi, argv[1])) != NT_STATUS_NO_PROBLEMO)
+ {
+ printf ("Failed to remove driver %s for arch [%s] - error %s!\n",
+ argv[1], archi_table[i].long_archi, get_nt_error_msg(result));
+ }
+ else
+ printf ("Driver %s removed for arch [%s].\n", argv[1], archi_table[i].long_archi);
}
- printf ("%s driver %s removed.\n", argv[1], argv[2]);
done:
@@ -1353,7 +1360,7 @@ done:
cli_nt_session_close (cli);
talloc_destroy(mem_ctx);
- return result;
+ return NT_STATUS_NO_PROBLEMO;
}