scheduler/quotas.c:cupsdUpdateQuota() fails to scan all of the (500 per default) last jobs #3030

Closed
michaelrsweet opened this Issue Dec 2, 2008 · 3 comments

Comments

Projects
None yet
1 participant
Collaborator

michaelrsweet commented Dec 2, 2008

Version: 1.3-current
CUPS.org User: Lothar_Brendel

If I'm not utterly off the track, scheduler/quotas.c:cupsdUpdateQuota() shouldn't stop summing pages and kilobytes as soon as it encounters a job without a time-at-* attribute (i.e. neither time-at-completion nor time-at-processing nor time-at-creation).

Yet in the job scanning loop it reads:
if (attr == NULL)
break;

Could someone explain why the "break" ought not to be a "continue"?

Collaborator

michaelrsweet commented Dec 5, 2008

CUPS.org User: mike

Moving to 1.3-current... This condition actually signals a serious problem with your system, however, in that the job history files are corrupt.

Continuing may or may not be the right thing to do in this case...

Collaborator

michaelrsweet commented Dec 8, 2008

CUPS.org User: mike

Fixed in Subversion repository.

Collaborator

michaelrsweet commented Dec 8, 2008

"str3030.patch":

Index: scheduler/job.c

--- scheduler/job.c (revision 8166)
+++ scheduler/job.c (working copy)
@@ -1112,6 +1112,17 @@

  • Copy attribute data to the job object...
    */
  • if (!ippFindAttribute(job->attrs, "time-at-creation", IPP_TAG_INTEGER))
  • {
  • cupsdLogMessage(CUPSD_LOG_ERROR,
  •       "[Job %d] Missing or bad time-at-creation attribute in "
    
  •       "control file!", job->id);
    
  • ippDelete(job->attrs);
  • job->attrs = NULL;
  • unlink(jobfile);
  • return;
  • }

if ((job->state = ippFindAttribute(job->attrs, "job-state",
IPP_TAG_ENUM)) == NULL)
{

michaelrsweet added this to the Stable milestone Mar 17, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment