]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Mirror 1.1.x changes.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Mon, 4 Oct 2004 19:48:56 +0000 (19:48 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Mon, 4 Oct 2004 19:48:56 +0000 (19:48 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.2@4421 7a7537e8-13f0-0310-91df-b6672ffda945

23 files changed:
CHANGES-1.1.txt
scheduler/auth.c
scheduler/banners.c
scheduler/cert.c
scheduler/classes.c
scheduler/client.c
scheduler/cups-lpd.c
scheduler/cupsd.h
scheduler/devices.c
scheduler/dirsvc.c
scheduler/file.c
scheduler/filter.c
scheduler/job.c
scheduler/listen.c
scheduler/main.c
scheduler/mime.c
scheduler/network.c
scheduler/ppds.c
scheduler/printers.c
scheduler/quotas.c
scheduler/server.c
scheduler/testmime.c
scheduler/testspeed.c

index 70e42691ca5fafc65b65e156eec82f33638e0cd7..b602d1a9b8cef77b2efd0783c054fd3ee5b55d0c 100644 (file)
@@ -3,6 +3,10 @@ CHANGES-1.1.txt
 
 CHANGES IN CUPS V1.1.22rc1
 
+       - Fixed some memory and file descriptor leaks in the job
+         dispatch code (STR #921)
+       - Deleting a printer could cause a crash with browsing
+         enabled (STR #865, STR #881, STR #928)
        - Browsing would turn off if the scheduler got an EAGAIN
          error (STR #924)
        - The mime.types file didn't recognize PostScript as a
index 39d990fe721074b246498c7784bb946cb9a5b7f0..4b338d31660e6cdb669ede3f9e003943de83e12a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: auth.c,v 1.41.2.27 2004/06/29 13:15:10 mike Exp $"
+ * "$Id: auth.c,v 1.41.2.28 2004/10/04 19:48:56 mike Exp $"
  *
  *   Authorization routines for the Common UNIX Printing System (CUPS).
  *
@@ -15,7 +15,7 @@
  *       Attn: CUPS Licensing Information
  *       Easy Software Products
  *       44141 Airport View Drive, Suite 204
- *       Hollywood, Maryland 20636-3142 USA
+ *       Hollywood, Maryland 20636 USA
  *
  *       Voice: (301) 373-9600
  *       EMail: cups-info@cups.org
@@ -1780,5 +1780,5 @@ to64(char          *s,    /* O - Output string */
 
 
 /*
- * End of "$Id: auth.c,v 1.41.2.27 2004/06/29 13:15:10 mike Exp $".
+ * End of "$Id: auth.c,v 1.41.2.28 2004/10/04 19:48:56 mike Exp $".
  */
index f07773f3c0ca96c40760271cf992ce26d0776c10..5f3b8bb72af38d87ddd9df20543739ae8be51811 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: banners.c,v 1.5.2.8 2004/06/29 13:15:10 mike Exp $"
+ * "$Id: banners.c,v 1.5.2.9 2004/10/04 19:48:56 mike Exp $"
  *
  *   Banner routines for the Common UNIX Printing System (CUPS).
  *
@@ -15,7 +15,7 @@
  *       Attn: CUPS Licensing Information
  *       Easy Software Products
  *       44141 Airport View Drive, Suite 204
- *       Hollywood, Maryland 20636-3142 USA
+ *       Hollywood, Maryland 20636 USA
  *
  *       Voice: (301) 373-9600
  *       EMail: cups-info@cups.org
@@ -211,5 +211,5 @@ compare(const banner_t *b0, /* I - First banner */
 
 
 /*
- * End of "$Id: banners.c,v 1.5.2.8 2004/06/29 13:15:10 mike Exp $".
+ * End of "$Id: banners.c,v 1.5.2.9 2004/10/04 19:48:56 mike Exp $".
  */
index eb3677d9d3ce6bd3aaa742c442c82b893f855d87..170d21dfde8650b9b8dcf508cc4ec99e76350bc1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: cert.c,v 1.7.2.13 2004/06/29 13:15:10 mike Exp $"
+ * "$Id: cert.c,v 1.7.2.14 2004/10/04 19:48:56 mike Exp $"
  *
  *   Authentication certificate routines for the Common UNIX
  *   Printing System (CUPS).
@@ -16,7 +16,7 @@
  *       Attn: CUPS Licensing Information
  *       Easy Software Products
  *       44141 Airport View Drive, Suite 204
- *       Hollywood, Maryland 20636-3142 USA
+ *       Hollywood, Maryland 20636 USA
  *
  *       Voice: (301) 373-9600
  *       EMail: cups-info@cups.org
@@ -293,5 +293,5 @@ InitCerts(void)
 
 
 /*
- * End of "$Id: cert.c,v 1.7.2.13 2004/06/29 13:15:10 mike Exp $".
+ * End of "$Id: cert.c,v 1.7.2.14 2004/10/04 19:48:56 mike Exp $".
  */
index 5d6de01d1a410a0dd614e8cac6f05da83fb3150f..1cb193599c540b56c602beb49e03adb94ac3b0e4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: classes.c,v 1.34.2.26 2004/07/02 20:19:17 mike Exp $"
+ * "$Id: classes.c,v 1.34.2.27 2004/10/04 19:48:56 mike Exp $"
  *
  *   Printer class routines for the Common UNIX Printing System (CUPS).
  *
@@ -15,7 +15,7 @@
  *       Attn: CUPS Licensing Information
  *       Easy Software Products
  *       44141 Airport View Drive, Suite 204
- *       Hollywood, Maryland 20636-3142 USA
+ *       Hollywood, Maryland 20636 USA
  *
  *       Voice: (301) 373-9600
  *       EMail: cups-info@cups.org
@@ -710,5 +710,5 @@ UpdateImplicitClasses(void)
 
 
 /*
- * End of "$Id: classes.c,v 1.34.2.26 2004/07/02 20:19:17 mike Exp $".
+ * End of "$Id: classes.c,v 1.34.2.27 2004/10/04 19:48:56 mike Exp $".
  */
index 00a8625931081e0d24c0e17a7f4a3164df9ffbd0..6fafaccc1ff7fda909693f28facd1424c30e1e0c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: client.c,v 1.91.2.95 2004/09/12 18:50:10 mike Exp $"
+ * "$Id: client.c,v 1.91.2.96 2004/10/04 19:48:56 mike Exp $"
  *
  *   Client routines for the Common UNIX Printing System (CUPS) scheduler.
  *
@@ -15,7 +15,7 @@
  *       Attn: CUPS Licensing Information
  *       Easy Software Products
  *       44141 Airport View Drive, Suite 204
- *       Hollywood, Maryland 20636-3142 USA
+ *       Hollywood, Maryland 20636 USA
  *
  *       Voice: (301) 373-9600
  *       EMail: cups-info@cups.org
@@ -3238,7 +3238,7 @@ pipe_command(client_t *con,               /* I - Client connection */
   * Create a pipe for the output...
   */
 
-  if (cupsdPipe(fds))
+  if (cupsdOpenPipe(fds))
   {
     ClearString(&query_string);
 
@@ -3350,8 +3350,7 @@ pipe_command(client_t *con,               /* I - Client connection */
     LogMessage(L_ERROR, "Unable to fork for CGI %s - %s", argv[0],
                strerror(errno));
 
-    close(fds[0]);
-    close(fds[1]);
+    cupsdClosePipe(fds);
     pid = 0;
   }
   else
@@ -3425,5 +3424,5 @@ CDSAWriteFunc(SSLConnectionRef connection,        /* I  - SSL/TLS connection */
 
 
 /*
- * End of "$Id: client.c,v 1.91.2.95 2004/09/12 18:50:10 mike Exp $".
+ * End of "$Id: client.c,v 1.91.2.96 2004/10/04 19:48:56 mike Exp $".
  */
index e9eb6e3abdbf452f7aba2c6adbd4eb1113b1cdf8..d5f88e781f631584f5273f3fc7061b3c235e23f2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: cups-lpd.c,v 1.24.2.22 2004/08/18 17:49:19 mike Exp $"
+ * "$Id: cups-lpd.c,v 1.24.2.23 2004/10/04 19:48:56 mike Exp $"
  *
  *   Line Printer Daemon interface for the Common UNIX Printing System (CUPS).
  *
@@ -15,7 +15,7 @@
  *       Attn: CUPS Licensing Information
  *       Easy Software Products
  *       44141 Airport View Drive, Suite 204
- *       Hollywood, Maryland 20636-3142 USA
+ *       Hollywood, Maryland 20636 USA
  *
  *       Voice: (301) 373-9600
  *       EMail: cups-info@cups.org
@@ -1419,5 +1419,5 @@ smart_gets(char *s,                       /* I - Pointer to line buffer */
 
 
 /*
- * End of "$Id: cups-lpd.c,v 1.24.2.22 2004/08/18 17:49:19 mike Exp $".
+ * End of "$Id: cups-lpd.c,v 1.24.2.23 2004/10/04 19:48:56 mike Exp $".
  */
index 1a9b08a51e3f1f336d6c8e185c20c09e4dfe7f9b..0fef99b4339a373838aa1b3fd084d2d8d7446b2c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: cupsd.h,v 1.28.2.27 2004/09/09 15:10:29 mike Exp $"
+ * "$Id: cupsd.h,v 1.28.2.28 2004/10/04 19:48:56 mike Exp $"
  *
  *   Main header file for the Common UNIX Printing System (CUPS) scheduler.
  *
@@ -208,9 +208,10 @@ extern void        SetString(char **s, const char *v);
 extern void    SetStringf(char **s, const char *f, ...);
 extern void    StartServer(void);
 extern void    StopServer(void);
-extern int     cupsdPipe(int *fds);
+extern void    cupsdClosePipe(int *fds);
+extern int     cupsdOpenPipe(int *fds);
 
 
 /*
- * End of "$Id: cupsd.h,v 1.28.2.27 2004/09/09 15:10:29 mike Exp $".
+ * End of "$Id: cupsd.h,v 1.28.2.28 2004/10/04 19:48:56 mike Exp $".
  */
index 3dd67d632fa9e08c2dd10bc907d0ce0e05bd1708..ea75237939f455268f1d8fab49576ecb4cfcc0d1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: devices.c,v 1.14.2.7 2004/06/29 13:15:10 mike Exp $"
+ * "$Id: devices.c,v 1.14.2.8 2004/10/04 19:48:56 mike Exp $"
  *
  *   Device scanning routines for the Common UNIX Printing System (CUPS).
  *
@@ -15,7 +15,7 @@
  *       Attn: CUPS Licensing Information
  *       Easy Software Products
  *       44141 Airport View Drive, Suite 204
- *       Hollywood, Maryland 20636-3142 USA
+ *       Hollywood, Maryland 20636 USA
  *
  *       Voice: (301) 373-9600
  *       EMail: cups-info@cups.org
@@ -480,5 +480,5 @@ sigalrm_handler(int sig)    /* I - Signal number */
 
 
 /*
- * End of "$Id: devices.c,v 1.14.2.7 2004/06/29 13:15:10 mike Exp $".
+ * End of "$Id: devices.c,v 1.14.2.8 2004/10/04 19:48:56 mike Exp $".
  */
index 2edfcd5e0a76ed4a719b5bd52ea32e4d34f470db..4abcc75d02202fac8477f51a439be4b7826e7e35 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: dirsvc.c,v 1.73.2.59 2004/09/30 14:39:06 mike Exp $"
+ * "$Id: dirsvc.c,v 1.73.2.60 2004/10/04 19:48:56 mike Exp $"
  *
  *   Directory services routines for the Common UNIX Printing System (CUPS).
  *
@@ -15,7 +15,7 @@
  *       Attn: CUPS Licensing Information
  *       Easy Software Products
  *       44141 Airport View Drive, Suite 204
- *       Hollywood, Maryland 20636-3142 USA
+ *       Hollywood, Maryland 20636 USA
  *
  *       Voice: (301) 373-9600
  *       EMail: cups-info@cups.org
@@ -1055,7 +1055,7 @@ StartPolling(void)
   * polling daemon...
   */
 
-  if (cupsdPipe(statusfds))
+  if (cupsdOpenPipe(statusfds))
   {
     LogMessage(L_ERROR, "Unable to create polling status pipes - %s.",
               strerror(errno));
@@ -2114,5 +2114,5 @@ UpdateSLPBrowse(void)
 
 
 /*
- * End of "$Id: dirsvc.c,v 1.73.2.59 2004/09/30 14:39:06 mike Exp $".
+ * End of "$Id: dirsvc.c,v 1.73.2.60 2004/10/04 19:48:56 mike Exp $".
  */
index 2ddb911d13fefc5909b4d389ebd5da60260650e7..5b19eb9397cd80dd27fc05519ae327e2e1dee6a9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: file.c,v 1.1.2.9 2004/09/09 15:10:29 mike Exp $"
+ * "$Id: file.c,v 1.1.2.10 2004/10/04 19:48:56 mike Exp $"
  *
  *   File functions for the Common UNIX Printing System (CUPS).
  *
@@ -20,7 +20,7 @@
  *       Attn: CUPS Licensing Information
  *       Easy Software Products
  *       44141 Airport View Drive, Suite 204
- *       Hollywood, Maryland 20636-3142 USA
+ *       Hollywood, Maryland 20636 USA
  *
  *       Voice: (301) 373-9600
  *       EMail: cups-info@cups.org
@@ -987,5 +987,5 @@ cups_write(int        fd,           /* I - File descriptor */
 
 
 /*
- * End of "$Id: file.c,v 1.1.2.9 2004/09/09 15:10:29 mike Exp $".
+ * End of "$Id: file.c,v 1.1.2.10 2004/10/04 19:48:56 mike Exp $".
  */
index 3920f10c16ce1f25cb66b7f3b189f1b9cc9df031..7095616ee2f42942e63327982a64616a4cd425e5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: filter.c,v 1.3.2.9 2004/06/29 13:15:10 mike Exp $"
+ * "$Id: filter.c,v 1.3.2.10 2004/10/04 19:48:56 mike Exp $"
  *
  *   File type conversion routines for the Common UNIX Printing System (CUPS).
  *
@@ -15,7 +15,7 @@
  *       Attn: CUPS Licensing Information
  *       Easy Software Products
  *       44141 Airport View Drive, Suite 204
- *       Hollywood, Maryland 20636-3142 USA
+ *       Hollywood, Maryland 20636 USA
  *
  *       Voice: (301) 373-9600
  *       EMail: cups-info@cups.org
@@ -322,5 +322,5 @@ lookup(mime_t      *mime,   /* I - MIME database */
 
 
 /*
- * End of "$Id: filter.c,v 1.3.2.9 2004/06/29 13:15:10 mike Exp $".
+ * End of "$Id: filter.c,v 1.3.2.10 2004/10/04 19:48:56 mike Exp $".
  */
index aa3fd985062b1ff100e7c8cb659db0127c55646c..7b7c043ddc44d037eca99764680f0babf1a7b04d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: job.c,v 1.124.2.95 2004/09/09 15:10:29 mike Exp $"
+ * "$Id: job.c,v 1.124.2.96 2004/10/04 19:48:56 mike Exp $"
  *
  *   Job management routines for the Common UNIX Printing System (CUPS).
  *
@@ -15,7 +15,7 @@
  *       Attn: CUPS Licensing Information
  *       Easy Software Products
  *       44141 Airport View Drive, Suite 204
- *       Hollywood, Maryland 20636-3142 USA
+ *       Hollywood, Maryland 20636 USA
  *
  *       Voice: (301) 373-9600
  *       EMail: cups-info@cups.org
@@ -1502,7 +1502,8 @@ StartJob(int       id,                    /* I - Job ID */
       LogMessage(L_ERROR, "Unable to add decompression filter - %s",
                  strerror(errno));
 
-      free(filters);
+      if (filters != NULL)
+        free(filters);
 
       current->current_file ++;
 
@@ -1531,7 +1532,7 @@ StartJob(int       id,                    /* I - Job ID */
   if (current->current_file == 0)
   {
     set_time(current, "time-at-processing");
-    cupsdPipe(current->back_pipes);
+    cupsdOpenPipe(current->back_pipes);
   }
 
  /*
@@ -1951,7 +1952,7 @@ StartJob(int       id,                    /* I - Job ID */
   * Now create processes for all of the filters...
   */
 
-  if (cupsdPipe(statusfds))
+  if (cupsdOpenPipe(statusfds))
   {
     LogMessage(L_ERROR, "Unable to create job status pipes - %s.",
               strerror(errno));
@@ -1963,6 +1964,7 @@ StartJob(int       id,                    /* I - Job ID */
     if (filters != NULL)
       free(filters);
 
+    CancelJob(current->id, 0);
     return;
   }
 
@@ -1993,6 +1995,7 @@ StartJob(int       id,                    /* I - Job ID */
     if (filters != NULL)
       free(filters);
 
+    cupsdClosePipe(statusfds);
     CancelJob(current->id, 0);
     return;
   }
@@ -2021,13 +2024,47 @@ StartJob(int       id,                  /* I - Job ID */
 #endif /* __APPLE__ */
 
     if (i < (num_filters - 1))
-      cupsdPipe(filterfds[slot]);
+    {
+      if (cupsdOpenPipe(filterfds[slot]))
+      {
+       LogMessage(L_ERROR, "Unable to create job filter pipes - %s.",
+               strerror(errno));
+       snprintf(printer->state_message, sizeof(printer->state_message),
+               "Unable to create filter pipes - %s.", strerror(errno));
+       AddPrinterHistory(printer);
+
+       if (filters != NULL)
+         free(filters);
+
+       cupsdClosePipe(statusfds);
+       cupsdClosePipe(filterfds[!slot]);
+       CancelJob(current->id, 0);
+       return;
+      }
+    }
     else
     {
       if (current->current_file == 1)
       {
        if (strncmp(printer->device_uri, "file:", 5) != 0)
-         cupsdPipe(current->print_pipes);
+       {
+         if (cupsdOpenPipe(current->print_pipes))
+         {
+           LogMessage(L_ERROR, "Unable to create job filter pipes - %s.",
+                   strerror(errno));
+           snprintf(printer->state_message, sizeof(printer->state_message),
+                   "Unable to create filter pipes - %s.", strerror(errno));
+           AddPrinterHistory(printer);
+
+           if (filters != NULL)
+             free(filters);
+
+           cupsdClosePipe(statusfds);
+           cupsdClosePipe(filterfds[!slot]);
+           CancelJob(current->id, 0);
+           return;
+         }
+       }
        else
        {
          current->print_pipes[0] = -1;
@@ -2056,6 +2093,8 @@ StartJob(int       id,                    /* I - Job ID */
            if (filters != NULL)
              free(filters);
 
+           cupsdClosePipe(statusfds);
+           cupsdClosePipe(filterfds[!slot]);
            CancelJob(current->id, 0);
            return;
          }
@@ -2083,10 +2122,7 @@ StartJob(int       id,                   /* I - Job ID */
     LogMessage(L_DEBUG2, "StartJob: Closing filter pipes for slot %d [ %d %d ]...",
                !slot, filterfds[!slot][0], filterfds[!slot][1]);
 
-    if (filterfds[!slot][0] >= 0)
-      close(filterfds[!slot][0]);
-    if (filterfds[!slot][1] >= 0)
-      close(filterfds[!slot][1]);
+    cupsdClosePipe(filterfds[!slot]);
 
     if (pid == 0)
     {
@@ -2154,6 +2190,7 @@ StartJob(int       id,                    /* I - Job ID */
        if (filters != NULL)
          free(filters);
 
+       cupsdClosePipe(statusfds);
        CancelJob(current->id, 0);
        return;
       }
@@ -2180,22 +2217,12 @@ StartJob(int       id,                  /* I - Job ID */
        LogMessage(L_DEBUG2, "StartJob: Closing print pipes [ %d %d ]...",
                   current->print_pipes[0], current->print_pipes[1]);
 
-        if (current->print_pipes[0] >= 0)
-         close(current->print_pipes[0]);
-        if (current->print_pipes[1] >= 0)
-         close(current->print_pipes[1]);
-
-       current->print_pipes[0] = -1;
-       current->print_pipes[1] = -1;
+        cupsdClosePipe(current->print_pipes);
 
        LogMessage(L_DEBUG2, "StartJob: Closing back pipes [ %d %d ]...",
                   current->back_pipes[0], current->back_pipes[1]);
 
-       close(current->back_pipes[0]);
-       close(current->back_pipes[1]);
-
-       current->back_pipes[0] = -1;
-       current->back_pipes[1] = -1;
+        cupsdClosePipe(current->back_pipes);
 
         CancelJob(current->id, 0);
        return;
@@ -2212,22 +2239,12 @@ StartJob(int       id,                  /* I - Job ID */
       LogMessage(L_DEBUG2, "StartJob: Closing print pipes [ %d %d ]...",
                 current->print_pipes[0], current->print_pipes[1]);
 
-      if (current->print_pipes[0] >= 0)
-       close(current->print_pipes[0]);
-      if (current->print_pipes[1] >= 0)
-       close(current->print_pipes[1]);
-
-      current->print_pipes[0] = -1;
-      current->print_pipes[1] = -1;
+      cupsdClosePipe(current->print_pipes);
 
       LogMessage(L_DEBUG2, "StartJob: Closing back pipes [ %d %d ]...",
                 current->back_pipes[0], current->back_pipes[1]);
 
-      close(current->back_pipes[0]);
-      close(current->back_pipes[1]);
-
-      current->back_pipes[0] = -1;
-      current->back_pipes[1] = -1;
+      cupsdClosePipe(current->back_pipes);
     }
   }
   else
@@ -2240,23 +2257,14 @@ StartJob(int       id,                  /* I - Job ID */
       LogMessage(L_DEBUG2, "StartJob: Closing print pipes [ %d %d ]...",
                 current->print_pipes[0], current->print_pipes[1]);
 
-      if (current->print_pipes[0] >= 0)
-       close(current->print_pipes[0]);
-      if (current->print_pipes[1] >= 0)
-       close(current->print_pipes[1]);
-
-      current->print_pipes[0] = -1;
-      current->print_pipes[1] = -1;
+      cupsdClosePipe(current->print_pipes);
     }
   }
 
   LogMessage(L_DEBUG2, "StartJob: Closing filter pipes for slot %d [ %d %d ]...",
              slot, filterfds[slot][0], filterfds[slot][1]);
 
-  if (filterfds[slot][0] >= 0)
-    close(filterfds[slot][0]);
-  if (filterfds[slot][1] >= 0)
-    close(filterfds[slot][1]);
+  cupsdClosePipe(filterfds[slot]);
 
   LogMessage(L_DEBUG2, "StartJob: Closing status output pipe %d...",
              statusfds[1]);
@@ -2347,22 +2355,12 @@ StopJob(int id,                         /* I - Job ID */
        LogMessage(L_DEBUG2, "StopJob: Closing print pipes [ %d %d ]...",
                   current->print_pipes[0], current->print_pipes[1]);
 
-        if (current->print_pipes[0] >= 0)
-         close(current->print_pipes[0]);
-        if (current->print_pipes[1] >= 0)
-          close(current->print_pipes[1]);
-
-       current->print_pipes[0] = -1;
-       current->print_pipes[1] = -1;
+       cupsdClosePipe(current->print_pipes);
 
        LogMessage(L_DEBUG2, "StopJob: Closing back pipes [ %d %d ]...",
                   current->back_pipes[0], current->back_pipes[1]);
 
-        close(current->back_pipes[0]);
-        close(current->back_pipes[1]);
-
-       current->back_pipes[0] = -1;
-       current->back_pipes[1] = -1;
+       cupsdClosePipe(current->back_pipes);
 
         if (current->status_buffer)
         {
@@ -2804,5 +2802,5 @@ set_hold_until(job_t *job,                /* I - Job to update */
 
 
 /*
- * End of "$Id: job.c,v 1.124.2.95 2004/09/09 15:10:29 mike Exp $".
+ * End of "$Id: job.c,v 1.124.2.96 2004/10/04 19:48:56 mike Exp $".
  */
index 5c012b79d767536599bfeb627d2cf8a3d1e2a7ef..481576c921c8117d549f66e13e24bf5824cc4163 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: listen.c,v 1.9.2.17 2004/06/29 18:54:17 mike Exp $"
+ * "$Id: listen.c,v 1.9.2.18 2004/10/04 19:48:56 mike Exp $"
  *
  *   Server listening routines for the Common UNIX Printing System (CUPS)
  *   scheduler.
@@ -16,7 +16,7 @@
  *       Attn: CUPS Licensing Information
  *       Easy Software Products
  *       44141 Airport View Drive, Suite 204
- *       Hollywood, Maryland 20636-3142 USA
+ *       Hollywood, Maryland 20636 USA
  *
  *       Voice: (301) 373-9600
  *       EMail: cups-info@cups.org
@@ -324,5 +324,5 @@ StopListening(void)
 
 
 /*
- * End of "$Id: listen.c,v 1.9.2.17 2004/06/29 18:54:17 mike Exp $".
+ * End of "$Id: listen.c,v 1.9.2.18 2004/10/04 19:48:56 mike Exp $".
  */
index 81ec473b3eaee9e32240bdcb5e484f61c98f7eff..15a350ff5693ab11c16ec0ee473ee59ca351af4c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: main.c,v 1.57.2.69 2004/09/09 15:10:29 mike Exp $"
+ * "$Id: main.c,v 1.57.2.70 2004/10/04 19:48:56 mike Exp $"
  *
  *   Scheduler main loop for the Common UNIX Printing System (CUPS).
  *
@@ -24,7 +24,8 @@
  * Contents:
  *
  *   main()               - Main entry for the CUPS scheduler.
- *   cupsdPipe()          - Create a pipe which is closed on exec.
+ *   cupsdClosePipe()     - Close a pipe as necessary.
+ *   cupsdOpenPipe()      - Create a pipe which is closed on exec.
  *   CatchChildSignals()  - Catch SIGCHLD signals...
  *   HoldSignals()        - Hold child and termination signals.
  *   IgnoreChildSignals() - Ignore SIGCHLD signals...
@@ -793,11 +794,36 @@ main(int  argc,                           /* I - Number of command-line arguments */
 
 
 /*
- * 'cupsdPipe()' - Create a pipe which is closed on exec.
+ * 'cupsdClosePipe()' - Close a pipe as necessary.
+ */
+
+void
+cupsdClosePipe(int *fds)               /* I - Pipe file descriptors (2) */
+{
+ /*
+  * Close file descriptors as needed...
+  */
+
+  if (fds[0] >= 0)
+  {
+    close(fds[0]);
+    fds[0] = -1;
+  }
+
+  if (fds[1] >= 0)
+  {
+    close(fds[1]);
+    fds[1] = -1;
+  }
+}
+
+
+/*
+ * 'cupsdOpenPipe()' - Create a pipe which is closed on exec.
  */
 
 int                                    /* O - 0 on success, -1 on error */
-cupsdPipe(int *fds)                    /* O - Pipe file descriptors (2) */
+cupsdOpenPipe(int *fds)                        /* O - Pipe file descriptors (2) */
 {
  /*
   * Create the pipe...
@@ -1378,5 +1404,5 @@ usage(void)
 
 
 /*
- * End of "$Id: main.c,v 1.57.2.69 2004/09/09 15:10:29 mike Exp $".
+ * End of "$Id: main.c,v 1.57.2.70 2004/10/04 19:48:56 mike Exp $".
  */
index b4161a8635c384406d133200da1d271a62ce8d6c..a95072604805f2ce45f916d92f4f199ddc1ad80b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: mime.c,v 1.7.2.13 2004/06/29 13:15:11 mike Exp $"
+ * "$Id: mime.c,v 1.7.2.14 2004/10/04 19:48:56 mike Exp $"
  *
  *   MIME database file routines for the Common UNIX Printing System (CUPS).
  *
@@ -15,7 +15,7 @@
  *       Attn: CUPS Licensing Information
  *       Easy Software Products
  *       44141 Airport View Drive, Suite 204
- *       Hollywood, Maryland 20636-3142 USA
+ *       Hollywood, Maryland 20636 USA
  *
  *       Voice: (301) 373-9600
  *       EMail: cups-info@cups.org
@@ -583,5 +583,5 @@ delete_rules(mime_magic_t *rules)   /* I - Rules to free */
 
 
 /*
- * End of "$Id: mime.c,v 1.7.2.13 2004/06/29 13:15:11 mike Exp $".
+ * End of "$Id: mime.c,v 1.7.2.14 2004/10/04 19:48:56 mike Exp $".
  */
index 452d7ff7f24bafe629477ba32cbcd0dbdd64315f..881e10a26ad0d41c56cbc283ca894977a9220e0f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: network.c,v 1.5.2.11 2004/08/18 17:49:19 mike Exp $"
+ * "$Id: network.c,v 1.5.2.12 2004/10/04 19:48:56 mike Exp $"
  *
  *   Network interface functions for the Common UNIX Printing System
  *   (CUPS) scheduler.
@@ -16,7 +16,7 @@
  *       Attn: CUPS Licensing Information
  *       Easy Software Products
  *       44141 Airport View Drive, Suite 204
- *       Hollywood, Maryland 20636-3142 USA
+ *       Hollywood, Maryland 20636 USA
  *
  *       Voice: (301) 373-9600
  *       EMail: cups-info@cups.org
@@ -533,5 +533,5 @@ freeifaddrs(struct ifaddrs *addrs)  /* I - Interface list to free */
 
 
 /*
- * End of "$Id: network.c,v 1.5.2.11 2004/08/18 17:49:19 mike Exp $".
+ * End of "$Id: network.c,v 1.5.2.12 2004/10/04 19:48:56 mike Exp $".
  */
index 2d75758ae46440bf746fc6ad4f490456fa80c71a..2030cf85ca71261aea4bdefb82f65c17c651159c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: ppds.c,v 1.14.2.17 2004/09/09 15:10:29 mike Exp $"
+ * "$Id: ppds.c,v 1.14.2.18 2004/10/04 19:48:56 mike Exp $"
  *
  *   PPD scanning routines for the Common UNIX Printing System (CUPS).
  *
@@ -15,7 +15,7 @@
  *       Attn: CUPS Licensing Information
  *       Easy Software Products
  *       44141 Airport View Drive, Suite 204
- *       Hollywood, Maryland 20636-3142 USA
+ *       Hollywood, Maryland 20636 USA
  *
  *       Voice: (301) 373-9600
  *       EMail: cups-info@cups.org
@@ -777,5 +777,5 @@ load_ppds(const char *d,            /* I - Actual directory */
 
 
 /*
- * End of "$Id: ppds.c,v 1.14.2.17 2004/09/09 15:10:29 mike Exp $".
+ * End of "$Id: ppds.c,v 1.14.2.18 2004/10/04 19:48:56 mike Exp $".
  */
index 19bec45143556a8165eacb3d059986ff8a27f658..e632ae463a75f6775b6b8ec57de4a4c426b04a12 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: printers.c,v 1.93.2.67 2004/07/02 22:15:51 mike Exp $"
+ * "$Id: printers.c,v 1.93.2.68 2004/10/04 19:48:56 mike Exp $"
  *
  *   Printer routines for the Common UNIX Printing System (CUPS).
  *
@@ -15,7 +15,7 @@
  *       Attn: CUPS Licensing Information
  *       Easy Software Products
  *       44141 Airport View Drive, Suite 204
- *       Hollywood, Maryland 20636-3142 USA
+ *       Hollywood, Maryland 20636 USA
  *
  *       Voice: (301) 373-9600
  *       EMail: cups-info@cups.org
@@ -586,13 +586,6 @@ DeletePrinter(printer_t *p,                /* I - Printer to delete */
     return;
   }
 
- /*
-  * If this printer is the next for browsing, point to the next one...
-  */
-
-  if (p == BrowseNext)
-    BrowseNext = p->next;
-
  /*
   * Remove the printer from the list...
   */
@@ -610,6 +603,13 @@ DeletePrinter(printer_t *p,                /* I - Printer to delete */
 
   StopPrinter(p, update);
 
+ /*
+  * If this printer is the next for browsing, point to the next one...
+  */
+
+  if (p == BrowseNext)
+    BrowseNext = p->next;
+
  /*
   * Remove the dummy interface/icon/option files under IRIX...
   */
@@ -2487,5 +2487,5 @@ write_irix_state(printer_t *p)            /* I - Printer to update */
 
 
 /*
- * End of "$Id: printers.c,v 1.93.2.67 2004/07/02 22:15:51 mike Exp $".
+ * End of "$Id: printers.c,v 1.93.2.68 2004/10/04 19:48:56 mike Exp $".
  */
index aa026b1e9b3c0c9796ff2c40a4dd1c576197bd11..de1febed721b843b08cf23e8a85e831f9a59fb91 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: quotas.c,v 1.4.2.7 2004/06/29 13:15:11 mike Exp $"
+ * "$Id: quotas.c,v 1.4.2.8 2004/10/04 19:48:56 mike Exp $"
  *
  *   Quota routines for the Common UNIX Printing System (CUPS).
  *
@@ -15,7 +15,7 @@
  *       Attn: CUPS Licensing Information
  *       Easy Software Products
  *       44141 Airport View Drive, Suite 204
- *       Hollywood, Maryland 20636-3142 USA
+ *       Hollywood, Maryland 20636 USA
  *
  *       Voice: (301) 373-9600
  *       EMail: cups-info@cups.org
@@ -234,5 +234,5 @@ compare(const quota_t *q1,          /* I - First quota record */
 
 
 /*
- * End of "$Id: quotas.c,v 1.4.2.7 2004/06/29 13:15:11 mike Exp $".
+ * End of "$Id: quotas.c,v 1.4.2.8 2004/10/04 19:48:56 mike Exp $".
  */
index 50609305fa8124767c39ce636494deee82d1c5ae..f90987488dc1fdb6e899ac5eb212495e8d1194cf 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: server.c,v 1.2.2.17 2004/09/09 15:10:29 mike Exp $"
+ * "$Id: server.c,v 1.2.2.18 2004/10/04 19:48:56 mike Exp $"
  *
  *   Server start/stop routines for the Common UNIX Printing System (CUPS).
  *
@@ -15,7 +15,7 @@
  *       Attn: CUPS Licensing Information
  *       Easy Software Products
  *       44141 Airport View Drive, Suite 204
- *       Hollywood, Maryland 20636-3142 USA
+ *       Hollywood, Maryland 20636 USA
  *
  *       Voice: (301) 373-9600
  *       EMail: cups-info@cups.org
@@ -93,7 +93,7 @@ StartServer(void)
   * Create a pipe for CGI processes...
   */
 
-  if (cupsdPipe(CGIPipes))
+  if (cupsdOpenPipe(CGIPipes))
     LogMessage(L_ERROR, "StartServer: Unable to create pipes for CGI status!");
   else
   {
@@ -185,5 +185,5 @@ StopServer(void)
 
 
 /*
- * End of "$Id: server.c,v 1.2.2.17 2004/09/09 15:10:29 mike Exp $".
+ * End of "$Id: server.c,v 1.2.2.18 2004/10/04 19:48:56 mike Exp $".
  */
index c302317e788eba7ecf70541963e87b598b36fd9a..a1a9205106e6114b0ee01413eb46f8af1719fd7f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: testmime.c,v 1.4.2.8 2004/06/29 13:15:11 mike Exp $"
+ * "$Id: testmime.c,v 1.4.2.9 2004/10/04 19:48:56 mike Exp $"
  *
  *   MIME test program for the Common UNIX Printing System (CUPS).
  *
@@ -15,7 +15,7 @@
  *       Attn: CUPS Licensing Information
  *       Easy Software Products
  *       44141 Airport View Drive, Suite 204
- *       Hollywood, Maryland 20636-3142 USA
+ *       Hollywood, Maryland 20636 USA
  *
  *       Voice: (301) 373-9600
  *       EMail: cups-info@cups.org
@@ -243,5 +243,5 @@ print_rules(mime_magic_t *rules)    /* I - Rules to print */
 
 
 /*
- * End of "$Id: testmime.c,v 1.4.2.8 2004/06/29 13:15:11 mike Exp $".
+ * End of "$Id: testmime.c,v 1.4.2.9 2004/10/04 19:48:56 mike Exp $".
  */
index 9d2e850cec3757ac01fc96de472aba31704e7151..a7761af73fd79fe6cb0a6e3a441300c4e8a73500 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: testspeed.c,v 1.3.2.7 2004/07/06 00:35:31 mike Exp $"
+ * "$Id: testspeed.c,v 1.3.2.8 2004/10/04 19:48:56 mike Exp $"
  *
  *   Scheduler speed test for the Common UNIX Printing System (CUPS).
  *
@@ -15,7 +15,7 @@
  *       Attn: CUPS Licensing Information
  *       Easy Software Products
  *       44141 Airport View Drive, Suite 204
- *       Hollywood, Maryland 20636-3142 USA
+ *       Hollywood, Maryland 20636 USA
  *
  *       Voice: (301) 373-9600
  *       EMail: cups-info@cups.org
@@ -295,5 +295,5 @@ usage(void)
 
 
 /*
- * End of "$Id: testspeed.c,v 1.3.2.7 2004/07/06 00:35:31 mike Exp $".
+ * End of "$Id: testspeed.c,v 1.3.2.8 2004/10/04 19:48:56 mike Exp $".
  */