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
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;
pinfo2, r->out.info, r->out.count);
break;
default:
- result = WERR_UNKNOWN_LEVEL;
+ SMB_ASSERT(false); /* level checked on entry */
break;
}