From b3ebebd3b18e4d9ebfc50012e02f7011f8d067be Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 4 Jun 2010 16:55:07 +0200 Subject: s3-rpcclient: allow to add access_mask in cmd_spoolss_open_printer_ex(). Guenther --- source3/rpcclient/cmd_spoolss.c | 12 +++++++----- 1 file 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 \n", argv[0]); + if (argc < 2) { + printf("Usage: %s [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]); -- cgit