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)
/*
- * "$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).
*
else if ((attr = ippFindAttribute(response, "job-id", IPP_TAG_INTEGER)) == NULL)
{
DEBUG_puts("No job ID!");
+
+ last_error = IPP_SERVICE_UNAVAILABLE;
+
jobid = 0;
}
else
/*
- * 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 $".
*/
/*
- * "$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).
*
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...
*/
/*
- * 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 $".
*/
/*
- * "$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.
* 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));
* "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)
}
}
+ /*
+ * 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();
}
/*
- * 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 $".
*/
/*
- * "$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).
*
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;
/*
- * 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 $".
*/