summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2001-12-10 05:03:17 +0000
committerTim Potter <tpot@samba.org>2001-12-10 05:03:17 +0000
commit4f53486d78102d8080293eeafd7b4ed701d81a2e (patch)
tree2aaca817b8f8dbbb1fb09abff6ad482398b7dd1d /source3/rpcclient
parentce654f5e557544451fb198b32af89152a2aeed60 (diff)
downloadsamba-4f53486d78102d8080293eeafd7b4ed701d81a2e.tar.gz
samba-4f53486d78102d8080293eeafd7b4ed701d81a2e.tar.bz2
samba-4f53486d78102d8080293eeafd7b4ed701d81a2e.zip
Added client and server code for the GetPrintProcessorDirectory SPOOLSS
rpc. This was supposed to fix a printer driver download bug but it didn't but it seemed a shame to trash all this code so I'm commiting it #ifdef'ed out in case someone needs it one day. (This used to be commit bef43656471741c6c10b12e7516c15de9ae76394)
Diffstat (limited to 'source3/rpcclient')
-rw-r--r--source3/rpcclient/cmd_spoolss.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c
index bc003284da..2f80295a53 100644
--- a/source3/rpcclient/cmd_spoolss.c
+++ b/source3/rpcclient/cmd_spoolss.c
@@ -1149,6 +1149,37 @@ static NTSTATUS cmd_spoolss_deletedriver(struct cli_state *cli,
return NT_STATUS_OK;
}
+static NTSTATUS cmd_spoolss_getprintprocdir(struct cli_state *cli,
+ TALLOC_CTX *mem_ctx,
+ int argc, char **argv)
+{
+ NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
+ char *servername = NULL, *environment = NULL;
+ fstring procdir;
+
+ /* parse the command arguements */
+ if (argc < 2 || argc > 3) {
+ printf ("Usage: %s <server> [environment]\n", argv[0]);
+ return NT_STATUS_OK;
+ }
+
+ asprintf(&servername, "\\\\%s", cli->desthost);
+ strupper(servername);
+
+ asprintf(&environment, "%s", (argc == 3) ? argv[2] :
+ PRINTER_DRIVER_ARCHITECTURE);
+
+ result = cli_spoolss_getprintprocessordirectory(
+ cli, mem_ctx, servername, environment, procdir);
+
+ if (NT_STATUS_IS_OK(result))
+ printf("%s", procdir);
+
+ SAFE_FREE(servername);
+ SAFE_FREE(environment);
+
+ return result;
+}
/* List of commands exported by this module */
struct cmd_set spoolss_commands[] = {
@@ -1169,6 +1200,7 @@ struct cmd_set spoolss_commands[] = {
{ "getprinter", cmd_spoolss_getprinter, PIPE_SPOOLSS, "Get printer info", "" },
{ "openprinter", cmd_spoolss_open_printer_ex, PIPE_SPOOLSS, "Open printer handle", "" },
{ "setdriver", cmd_spoolss_setdriver, PIPE_SPOOLSS, "Set printer driver", "" },
+ { "getprintprocdir", cmd_spoolss_getprintprocdir, PIPE_SPOOLSS, "Get print processor directory", "" },
{ NULL }
};