summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-10-11 11:33:23 +0200
committerGünther Deschner <gd@samba.org>2010-10-11 14:31:06 +0000
commit33c6a4eb8a0017db9d7b3cc337142fd1d08b5da5 (patch)
tree78b16b307860c91db50f9e2fdbc669e6395a0242 /source3/rpc_server
parent025290e9bf0f7597dc8d849a221fd80f140c1f7a (diff)
downloadsamba-33c6a4eb8a0017db9d7b3cc337142fd1d08b5da5.tar.gz
samba-33c6a4eb8a0017db9d7b3cc337142fd1d08b5da5.tar.bz2
samba-33c6a4eb8a0017db9d7b3cc337142fd1d08b5da5.zip
s3-spoolss: add more userlevel info validation to _spoolss_OpenPrinterEx.
Guenther
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 2880013571..3783d0fba7 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -1693,6 +1693,15 @@ WERROR _spoolss_OpenPrinterEx(struct pipes_struct *p,
return WERR_INVALID_PARAM;
}
+ if (r->in.level < 0 || r->in.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)) {
+ return WERR_INVALID_PARAM;
+ }
+
/* some sanity check because you can open a printer or a print server */
/* aka: \\server\printer or \\server */