The following code leads to inconsistent spoolss EnumJobs responses, as described in the summary: 7325 WERROR _spoolss_EnumJobs(struct pipes_struct *p, 7326 struct spoolss_EnumJobs *r) 7327 { ... 7362 count = print_queue_status(p->msg_ctx, snum, &queue, &prt_status); 7363 DEBUGADD(4,("count:[%d], status:[%d], [%s]\n", 7364 count, prt_status.status, prt_status.message)); 7365 7366 if (count == 0) { 7367 SAFE_FREE(queue); 7368 TALLOC_FREE(pinfo2); 7369 return WERR_OK; 7370 } 7371 7372 switch (r->in.level) { 7373 case 1: 7374 result = enumjobs_level1(p->mem_ctx, queue, count, snum, 7375 pinfo2, r->out.info, r->out.count); 7376 break; 7377 case 2: 7378 result = enumjobs_level2(p->mem_ctx, queue, count, snum, 7379 pinfo2, r->out.info, r->out.count); 7380 break; 7381 case 3: 7382 result = enumjobs_level3(p->mem_ctx, queue, count, snum, 7383 pinfo2, r->out.info, r->out.count); 7384 break; 7385 default: 7386 result = WERR_UNKNOWN_LEVEL; 7387 break; 7388 } We should check for an unsupported EnumJobs level prior to the "if (count == 0) {" response fast-path. The fix is quite simple, but will take a little longer, as I'd also like to add a corresponding smbtorture test.
Created attachment 10370 [details] cherry-pick against 3.6-test branch
Created attachment 10371 [details] fix cherry-picked for v4-0-test branch
Created attachment 10372 [details] fix cherry-picked for v4-1-test branch
Created attachment 10373 [details] fix cherry-picked for v4-2-test branch
Karolin, please add the patches to the branches. Thanks!
Pushed to autobuild-v4-[0|1|2]-test.
Pushed to all branches. Closing out bug report. Thanks!