diff options
author | David Disseldorp <ddiss@samba.org> | 2014-10-27 20:13:59 +0100 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2014-11-09 20:47:09 +0100 |
commit | 5126c0157757d16c723d3a23f3b0218c06994f86 (patch) | |
tree | 14fe7af6bac48c56c903797e007789778f73ee22 /source3 | |
parent | 39a9211e2c59f98b3185419c6409298c0abb77f5 (diff) | |
download | samba-5126c0157757d16c723d3a23f3b0218c06994f86.tar.gz |
spoolss: fix handling of bad EnumJobs levels
Currently Samba is inconsistent when returning WERR_UNKNOWN_LEVEL
errors for spoolss EnumJobs requests - if no print jobs are present,
then WERR_OK will be returned, regardless of whether the EnumJobs level
is supported or not.
This change fixes this behaviour, by catching invalid or unsupported
levels prior to the no-jobs response fast-path.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10898
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Oct 28 03:05:35 CET 2014 on sn-devel-104
(cherry picked from commit d4f233a746d89e13aae78008b499c71b695ff882)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/rpc_server/spoolss/srv_spoolss_nt.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source3/rpc_server/spoolss/srv_spoolss_nt.c b/source3/rpc_server/spoolss/srv_spoolss_nt.c index 335647bf16..c247173165 100644 --- a/source3/rpc_server/spoolss/srv_spoolss_nt.c +++ b/source3/rpc_server/spoolss/srv_spoolss_nt.c @@ -7333,6 +7333,11 @@ WERROR _spoolss_EnumJobs(struct pipes_struct *p, return WERR_INVALID_PARAM; } + if ((r->in.level != 1) && (r->in.level != 2) && (r->in.level != 3)) { + DEBUG(4, ("EnumJobs level %d not supported\n", r->in.level)); + return WERR_UNKNOWN_LEVEL; + } + DEBUG(4,("_spoolss_EnumJobs\n")); *r->out.needed = 0; @@ -7378,7 +7383,7 @@ WERROR _spoolss_EnumJobs(struct pipes_struct *p, pinfo2, r->out.info, r->out.count); break; default: - result = WERR_UNKNOWN_LEVEL; + SMB_ASSERT(false); /* level checked on entry */ break; } |