]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
The scheduler might leave old job data files in the spool directory (STR #3795)
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Fri, 22 Apr 2011 22:36:10 +0000 (22:36 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Fri, 22 Apr 2011 22:36:10 +0000 (22:36 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@9715 7a7537e8-13f0-0310-91df-b6672ffda945

CHANGES-1.4.txt
scheduler/job.c

index 8215edaf916ae1d3dd43ef76f6682f48305d41ab..1cf3a8f2235103cc5907d1f87ff726a6939fc24f 100644 (file)
@@ -9,6 +9,8 @@ CHANGES IN CUPS V1.4.7
          STR #3755, STR #3769, STR #3783)
        - Configure script fixes (STR #3659, STR #3691)
        - Compilation fixes (STR #3718, STR #3771, STR #3774)
+       - The scheduler might leave old job data files in the spool directory
+         (STR #3795)
        - CUPS did not work with locales using the ASCII character set
          (STR #3832)
        - httpAddrString() did not return a URI-style IPv6 numeric address
index 828dcfe53bc9b42469c50ed103c5738f02922b0c..cefd671c5737d900d7ab70ec521f3ba8f8426977 100644 (file)
@@ -1262,6 +1262,9 @@ void
 cupsdDeleteJob(cupsd_job_t       *job, /* I - Job */
                cupsd_jobaction_t action)/* I - Action */
 {
+  char filename[1024];                 /* Job filename */
+
+
   if (job->printer)
     finalize_job(job, 1);
 
@@ -1271,8 +1274,6 @@ cupsdDeleteJob(cupsd_job_t       *job,    /* I - Job */
     * Remove the job info file...
     */
 
-    char       filename[1024];         /* Job filename */
-
     snprintf(filename, sizeof(filename), "%s/c%05d", RequestRoot,
             job->id);
     unlink(filename);
@@ -1290,7 +1291,14 @@ cupsdDeleteJob(cupsd_job_t       *job,   /* I - Job */
     free(job->compressions);
     free(job->filetypes);
 
-    job->num_files = 0;
+    while (job->num_files > 0)
+    {
+      snprintf(filename, sizeof(filename), "%s/d%05d-%03d", RequestRoot,
+              job->id, job->num_files);
+      unlink(filename);
+
+      job->num_files --;
+    }
   }
 
   if (job->history)