summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-06-04 16:55:07 +0200
committerGünther Deschner <gd@samba.org>2010-06-05 00:35:09 +0200
commitb3ebebd3b18e4d9ebfc50012e02f7011f8d067be (patch)
tree0600587ee3bdd666837a7744ab19d075174ddddf
parent8b3059de977eeeae69ebff7d33119bd6b565b637 (diff)
downloadsamba-b3ebebd3b18e4d9ebfc50012e02f7011f8d067be.tar.gz
samba-b3ebebd3b18e4d9ebfc50012e02f7011f8d067be.tar.bz2
samba-b3ebebd3b18e4d9ebfc50012e02f7011f8d067be.zip
s3-rpcclient: allow to add access_mask in cmd_spoolss_open_printer_ex().
Guenther
-rw-r--r--source3/rpcclient/cmd_spoolss.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c
index d5a7ce7a7a..39c581c65c 100644
--- a/source3/rpcclient/cmd_spoolss.c
+++ b/source3/rpcclient/cmd_spoolss.c
@@ -105,20 +105,22 @@ static WERROR cmd_spoolss_open_printer_ex(struct rpc_pipe_client *cli,
{
WERROR werror;
struct policy_handle hnd;
+ uint32_t access_mask = PRINTER_ALL_ACCESS;
- if (argc != 2) {
- printf("Usage: %s <printername>\n", argv[0]);
+ if (argc < 2) {
+ printf("Usage: %s <printername> [access_mask]\n", argv[0]);
return WERR_OK;
}
- if (!cli)
- return WERR_GENERAL_FAILURE;
+ if (argc >= 3) {
+ sscanf(argv[2], "%x", &access_mask);
+ }
/* Open the printer handle */
werror = rpccli_spoolss_openprinter_ex(cli, mem_ctx,
argv[1],
- PRINTER_ALL_ACCESS,
+ access_mask,
&hnd);
if (W_ERROR_IS_OK(werror)) {
printf("Printer %s opened successfully\n", argv[1]);