summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2013-01-14 17:26:31 +0100
committerAndreas Schneider <asn@samba.org>2013-01-16 11:42:13 +0100
commita4dcf7b94d8f2d8180bb5b390f49e89e2c956a88 (patch)
tree28136af45498a9d5f94527baf6fa52854af4770a /source3
parent6bb7bf9ebb0671be19419ba54955dd929494c8e8 (diff)
downloadsamba-a4dcf7b94d8f2d8180bb5b390f49e89e2c956a88.tar.gz
samba-a4dcf7b94d8f2d8180bb5b390f49e89e2c956a88.tar.bz2
samba-a4dcf7b94d8f2d8180bb5b390f49e89e2c956a88.zip
spoolss: Make OpenPrinterEx work with NDR64 by using UserInfo Container.
Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_client/cli_spoolss.c8
-rw-r--r--source3/rpc_server/spoolss/srv_spoolss_nt.c14
2 files changed, 12 insertions, 10 deletions
diff --git a/source3/rpc_client/cli_spoolss.c b/source3/rpc_client/cli_spoolss.c
index 5c8448b29b..1a8903d82a 100644
--- a/source3/rpc_client/cli_spoolss.c
+++ b/source3/rpc_client/cli_spoolss.c
@@ -40,7 +40,7 @@ WERROR rpccli_spoolss_openprinter_ex(struct rpc_pipe_client *cli,
NTSTATUS status;
WERROR werror;
struct spoolss_DevmodeContainer devmode_ctr;
- union spoolss_UserLevel userlevel;
+ struct spoolss_UserLevelCtr userlevel_ctr;
struct spoolss_UserLevel1 level1;
struct dcerpc_binding_handle *b = cli->binding_handle;
@@ -55,15 +55,15 @@ WERROR rpccli_spoolss_openprinter_ex(struct rpc_pipe_client *cli,
level1.minor = 0;
level1.processor = 0;
- userlevel.level1 = &level1;
+ userlevel_ctr.level = 1;
+ userlevel_ctr.user_info.level1 = &level1;
status = dcerpc_spoolss_OpenPrinterEx(b, mem_ctx,
printername,
NULL,
devmode_ctr,
access_desired,
- 1, /* level */
- userlevel,
+ userlevel_ctr,
handle,
&werror);
diff --git a/source3/rpc_server/spoolss/srv_spoolss_nt.c b/source3/rpc_server/spoolss/srv_spoolss_nt.c
index 28ef836b41..48a2981986 100644
--- a/source3/rpc_server/spoolss/srv_spoolss_nt.c
+++ b/source3/rpc_server/spoolss/srv_spoolss_nt.c
@@ -1632,15 +1632,17 @@ WERROR _spoolss_OpenPrinter(struct pipes_struct *p,
struct spoolss_OpenPrinter *r)
{
struct spoolss_OpenPrinterEx e;
+ struct spoolss_UserLevel1 level1;
WERROR werr;
- ZERO_STRUCT(e.in.userlevel);
+ ZERO_STRUCT(level1);
e.in.printername = r->in.printername;
e.in.datatype = r->in.datatype;
e.in.devmode_ctr = r->in.devmode_ctr;
e.in.access_mask = r->in.access_mask;
- e.in.level = 0;
+ e.in.userlevel_ctr.level = 1;
+ e.in.userlevel_ctr.user_info.level1 = &level1;
e.out.handle = r->out.handle;
@@ -1714,12 +1716,12 @@ WERROR _spoolss_OpenPrinterEx(struct pipes_struct *p,
return WERR_INVALID_PARAM;
}
- if (r->in.level > 3) {
+ if (r->in.userlevel_ctr.level > 3) {
return WERR_INVALID_PARAM;
}
- if ((r->in.level == 1 && !r->in.userlevel.level1) ||
- (r->in.level == 2 && !r->in.userlevel.level2) ||
- (r->in.level == 3 && !r->in.userlevel.level3)) {
+ if ((r->in.userlevel_ctr.level == 1 && !r->in.userlevel_ctr.user_info.level1) ||
+ (r->in.userlevel_ctr.level == 2 && !r->in.userlevel_ctr.user_info.level2) ||
+ (r->in.userlevel_ctr.level == 3 && !r->in.userlevel_ctr.user_info.level3)) {
return WERR_INVALID_PARAM;
}