diff options
author | Günther Deschner <gd@samba.org> | 2013-01-16 13:41:28 +0100 |
---|---|---|
committer | David Disseldorp <ddiss@samba.org> | 2013-01-17 17:11:37 +0100 |
commit | 3b94b64481a811482dbd01fd55c145a89f2c8c96 (patch) | |
tree | cd2aba510a225de50ce440848625ea6ff8b8f175 /source3 | |
parent | 8304fe73f69ea7de57bd2d331038c4664553a9bd (diff) | |
download | samba-3b94b64481a811482dbd01fd55c145a89f2c8c96.tar.gz samba-3b94b64481a811482dbd01fd55c145a89f2c8c96.tar.bz2 samba-3b94b64481a811482dbd01fd55c145a89f2c8c96.zip |
spoolss: make spoolss deal with ndr64 SetForm by using proper container object.
Guenther
Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Diffstat (limited to 'source3')
-rw-r--r-- | source3/rpc_server/spoolss/srv_spoolss_nt.c | 11 | ||||
-rw-r--r-- | source3/rpcclient/cmd_spoolss.c | 8 |
2 files changed, 14 insertions, 5 deletions
diff --git a/source3/rpc_server/spoolss/srv_spoolss_nt.c b/source3/rpc_server/spoolss/srv_spoolss_nt.c index b4f1bec15e..6d756bdf36 100644 --- a/source3/rpc_server/spoolss/srv_spoolss_nt.c +++ b/source3/rpc_server/spoolss/srv_spoolss_nt.c @@ -8799,7 +8799,7 @@ done: WERROR _spoolss_SetForm(struct pipes_struct *p, struct spoolss_SetForm *r) { - struct spoolss_AddFormInfo1 *form = r->in.info.info1; + struct spoolss_AddFormInfo1 *form; const char *form_name = r->in.form_name; int snum = -1; WERROR status = WERR_OK; @@ -8826,6 +8826,15 @@ WERROR _spoolss_SetForm(struct pipes_struct *p, return WERR_ACCESS_DENIED; } + if (r->in.info_ctr->level != 1) { + return WERR_INVALID_LEVEL; + } + + form = r->in.info_ctr->info.info1; + if (!form) { + return WERR_INVALID_PARAM; + } + tmp_ctx = talloc_new(p->mem_ctx); if (!tmp_ctx) { return WERR_NOMEM; diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c index 4e5da2a3ae..ced224b4d7 100644 --- a/source3/rpcclient/cmd_spoolss.c +++ b/source3/rpcclient/cmd_spoolss.c @@ -2203,7 +2203,7 @@ static WERROR cmd_spoolss_setform(struct rpc_pipe_client *cli, TALLOC_CTX *mem_c WERROR werror; NTSTATUS status; const char *printername; - union spoolss_AddFormInfo info; + struct spoolss_AddFormInfoCtr info_ctr; struct spoolss_AddFormInfo1 info1; struct dcerpc_binding_handle *b = cli->binding_handle; @@ -2236,15 +2236,15 @@ static WERROR cmd_spoolss_setform(struct rpc_pipe_client *cli, TALLOC_CTX *mem_c info1.area.bottom = 3000; info1.form_name = argv[2]; - info.info1 = &info1; + info_ctr.info.info1 = &info1; + info_ctr.level = 1; /* Set the form */ status = dcerpc_spoolss_SetForm(b, mem_ctx, &handle, argv[2], - 1, - info, + &info_ctr, &werror); if (!NT_STATUS_IS_OK(status)) { werror = ntstatus_to_werror(status); |