]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Mirror 1.1.x changes.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Tue, 24 Feb 2004 21:36:59 +0000 (21:36 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Tue, 24 Feb 2004 21:36:59 +0000 (21:36 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.2@4070 7a7537e8-13f0-0310-91df-b6672ffda945

CHANGES-1.1.txt
cups/util.c
scheduler/conf.c
scheduler/listen.c
scheduler/printers.c

index 44baca9253dcc884d518baa355ab44231427e8bf..8e220a175ad02f7500df5f29dd2d7bc79004995a 100644 (file)
@@ -3,6 +3,10 @@ CHANGES-1.1.txt
 
 CHANGES IN CUPS V1.1.21rc1
 
+       - The scheduler did not check for a valid Listen/Port
+         configuration (STR #499)
+       - The cupsPrintFiles() function did not always set the
+         last IPP error message (STR #538)
        - The pstops filter did not write the PostScript header
          line if the file began with a PJL escape sequence (STR
          #574)
index d1310939baaebd50007169a6ef8922a0dc565a2b..105a4ee932c18622930580fcff35f093a85162c5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: util.c,v 1.81.2.31 2004/02/17 21:32:58 mike Exp $"
+ * "$Id: util.c,v 1.81.2.32 2004/02/24 21:36:59 mike Exp $"
  *
  *   Printing utilities for the Common UNIX Printing System (CUPS).
  *
@@ -1416,6 +1416,9 @@ cupsPrintFiles(const char    *name,       /* I - Printer or class name */
   else if ((attr = ippFindAttribute(response, "job-id", IPP_TAG_INTEGER)) == NULL)
   {
     DEBUG_puts("No job ID!");
+
+    last_error = IPP_SERVICE_UNAVAILABLE;
+
     jobid = 0;
   }
   else
@@ -1557,5 +1560,5 @@ cups_connect(const char *name,            /* I - Destination (printer[@host]) */
 
 
 /*
- * End of "$Id: util.c,v 1.81.2.31 2004/02/17 21:32:58 mike Exp $".
+ * End of "$Id: util.c,v 1.81.2.32 2004/02/24 21:36:59 mike Exp $".
  */
index ccc50bff4b9150f483a18e69cfc9a59569aae9e4..c9860bbb0b2ec50a3500803ff5bcae8914b972c9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: conf.c,v 1.77.2.47 2004/02/05 16:20:12 mike Exp $"
+ * "$Id: conf.c,v 1.77.2.48 2004/02/24 21:36:59 mike Exp $"
  *
  *   Configuration routines for the Common UNIX Printing System (CUPS).
  *
@@ -437,6 +437,26 @@ ReadConfiguration(void)
 
   LogMessage(L_INFO, "Loaded configuration file \"%s\"", ConfigurationFile);
 
+ /*
+  * Check that we have at least one listen/port line; if not, report this
+  * as an error and exit!
+  */
+
+  if (NumListeners == 0)
+  {
+   /*
+    * No listeners!
+    */
+
+    LogMessage(L_EMERG, "No valid Listen or Port lines were found in the configuration file!");
+
+   /*
+    * Commit suicide...
+    */
+
+    kill(getpid(), SIGTERM);
+  }
+
  /*
   * Set the default locale using the language and charset...
   */
@@ -2286,5 +2306,5 @@ CDSAGetServerCerts(void)
 
 
 /*
- * End of "$Id: conf.c,v 1.77.2.47 2004/02/05 16:20:12 mike Exp $".
+ * End of "$Id: conf.c,v 1.77.2.48 2004/02/24 21:36:59 mike Exp $".
  */
index 35dad7ba6f9982d227468e05f4058483fd868304..cec74eeff4d2db403f7128adfc621a96f9bdc21c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: listen.c,v 1.9.2.11 2003/07/20 03:13:10 mike Exp $"
+ * "$Id: listen.c,v 1.9.2.12 2004/02/24 21:36:59 mike Exp $"
  *
  *   Server listening routines for the Common UNIX Printing System (CUPS)
  *   scheduler.
@@ -140,7 +140,7 @@ StartListening(void)
   * Setup socket listeners...
   */
 
-  for (i = NumListeners, lis = Listeners; i > 0; i --, lis ++)
+  for (i = NumListeners, lis = Listeners, LocalPort = 0; i > 0; i --, lis ++)
   {
     httpAddrString(&(lis->address), s, sizeof(s));
 
@@ -158,8 +158,9 @@ StartListening(void)
     * "any" address...
     */
 
-    if (httpAddrLocalhost(&(lis->address)) ||
-        httpAddrAny(&(lis->address)))
+    if (!LocalPort &&
+        (httpAddrLocalhost(&(lis->address)) ||
+         httpAddrAny(&(lis->address))))
     {
 #ifdef AF_INET6
       if (lis->address.addr.sa_family == AF_INET6)
@@ -226,6 +227,21 @@ StartListening(void)
     }
   }
 
+ /*
+  * Make sure that we are listening on localhost!
+  */
+
+  if (!LocalPort)
+  {
+    LogMessage(L_EMERG, "No Listen or Port lines were found to allow access via localhost!");
+
+   /*
+    * Commit suicide...
+    */
+
+    kill(getpid(), SIGTERM);
+  }
+
   ResumeListening();
 }
 
@@ -255,5 +271,5 @@ StopListening(void)
 
 
 /*
- * End of "$Id: listen.c,v 1.9.2.11 2003/07/20 03:13:10 mike Exp $".
+ * End of "$Id: listen.c,v 1.9.2.12 2004/02/24 21:36:59 mike Exp $".
  */
index 0ea932d8a9a3ed69078f38f21199e18eb5beecc7..034880c3ea3d2d3990f46800b8b416d896c67bc2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: printers.c,v 1.93.2.54 2004/02/05 16:20:12 mike Exp $"
+ * "$Id: printers.c,v 1.93.2.55 2004/02/24 21:36:59 mike Exp $"
  *
  *   Printer routines for the Common UNIX Printing System (CUPS).
  *
@@ -101,14 +101,16 @@ AddPrinter(const char *name)      /* I - Name of printer */
   SetString(&p->info, name);
   SetString(&p->hostname, ServerName);
 
+  if (NumListeners == 0)
+    SetStringf(&p->uri, "ipp://%s:%d/printers/%s", ServerName, ippPort(), name);
 #ifdef AF_INET6
-  if (Listeners[0].address.addr.sa_family == AF_INET6)
+  else if (Listeners[0].address.addr.sa_family == AF_INET6)
     SetStringf(&p->uri, "ipp://%s:%d/printers/%s", ServerName,
                ntohs(Listeners[0].address.ipv6.sin6_port), name);
-  else
 #endif /* AF_INET6 */
-  SetStringf(&p->uri, "ipp://%s:%d/printers/%s", ServerName,
-             ntohs(Listeners[0].address.ipv4.sin_port), name);
+  else
+    SetStringf(&p->uri, "ipp://%s:%d/printers/%s", ServerName,
+               ntohs(Listeners[0].address.ipv4.sin_port), name);
   SetStringf(&p->device_uri, "file:/dev/null");
 
   p->state     = IPP_PRINTER_STOPPED;
@@ -2413,5 +2415,5 @@ write_irix_state(printer_t *p)            /* I - Printer to update */
 
 
 /*
- * End of "$Id: printers.c,v 1.93.2.54 2004/02/05 16:20:12 mike Exp $".
+ * End of "$Id: printers.c,v 1.93.2.55 2004/02/24 21:36:59 mike Exp $".
  */