CHANGES IN CUPS V1.3.6
- Documentation updates (STR #2646, STR #2647, STR #2649)
+ - The scheduler incorrectly sent printer-stopped events for
+ status updates from the print filters (STR #2680)
+ - The IPP backend could crash when handling printer errors
+ (STR #2667)
+ - Multi-file jobs did not print to remote CUPS servers
+ (STR #2673)
- The scheduler did not provide the Apple language ID to
job filters.
- Kerberos authentication did not work with the web
-CHANGES.txt - 2008-01-08
+CHANGES.txt - 2008-01-23
------------------------
CHANGES IN CUPS V1.4b1
+ - The scheduler now provides the printer-dns-sd-name
+ attribute for printers shared via DNS-SD/Bonjour.
- The pdftops filter now executes the Xpdf or poppler
pdftops utility to convert PDF files (STR #1471)
- Bonjour printer registrations now advertise as local or
_("INFO: Unable to contact printer, queuing on next "
"printer in class...\n"));
- if (argc == 6 || strcmp(filename, argv[6]))
- unlink(filename);
+ if (tmpfilename[0])
+ unlink(tmpfilename);
/*
* Sleep 5 seconds to keep the job from requeuing too rapidly...
if (job_cancelled)
{
- if (argc == 6 || strcmp(filename, argv[6]))
- unlink(filename);
+ if (tmpfilename[0])
+ unlink(tmpfilename);
return (CUPS_BACKEND_FAILED);
}
ippDelete(supported);
httpClose(http);
- if (argc == 6 || strcmp(filename, argv[6]))
- unlink(filename);
+ if (tmpfilename[0])
+ unlink(tmpfilename);
/*
* Sleep 5 seconds to keep the job from requeuing too rapidly...
* so convert the document to PostScript...
*/
- if (run_pictwps_filter(argv, filename))
+ if (run_pictwps_filter(argv, files[0]))
+ {
+ if (pstmpname[0])
+ unlink(pstmpname);
+
+ if (tmpfilename[0])
+ unlink(tmpfilename);
+
return (CUPS_BACKEND_FAILED);
+ }
- filename = pstmpname;
+ files[0] = pstmpname;
/*
* Change the MIME type to application/postscript and change the
_cupsLangPrintf(stderr, _("ERROR: Unable to fork pictwpstops: %s\n"),
strerror(errno));
- unlink(filename);
if (ppdfile)
unlink(ppdfile);
return (-1);
_cupsLangPrintf(stderr, _("ERROR: Unable to wait for pictwpstops: %s\n"),
strerror(errno));
close(fd);
- unlink(filename);
if (ppdfile)
unlink(ppdfile);
return (-1);
_cupsLangPrintf(stderr, _("ERROR: pictwpstops exited on signal %d!\n"),
status);
- unlink(filename);
return (status);
}
/*
* "$Id: pap.c 7010 2007-10-10 21:08:51Z mike $"
*
-* © Copyright 2004 Apple Computer, Inc. All rights reserved.
+* © Copyright 2004-2008 Apple Computer, Inc. All rights reserved.
*
* IMPORTANT: This Apple software is supplied to you by Apple Computer,
* Inc. ("Apple") in consideration of your agreement to the following
* signalHandler() - handle SIGINT to close the session before quiting.
*/
+/*
+ * This backend uses deprecated APIs for AppleTalk; we know this, so
+ * silence any warnings about it...
+ */
+
+#ifdef MAC_OS_X_VERSION_MIN_REQUIRED
+# undef MAC_OS_X_VERSION_MIN_REQUIRED
+#endif /* MAX_OS_X_VERSION_MIN_REQUIRED */
+#define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_0
+
#include <config.h>
#include <stdio.h>
#include <sys/time.h>
#include <sys/errno.h>
+#include <cups/cups.h>
+#include <cups/backend.h>
+#include <cups/sidechannel.h>
+#include <cups/i18n.h>
+
#include <netat/appletalk.h>
#include <netat/atp.h>
#include <netat/ddp.h>
#include <netat/nbp.h>
#include <netat/pap.h>
-#include <cups/cups.h>
-#include <cups/backend.h>
-#include <cups/sidechannel.h>
-#include <cups/i18n.h>
-
#include <libkern/OSByteOrder.h>
#ifdef HAVE_APPLETALK_AT_PROTO_H
# Add useful warning options for tracking down problems...
OPTIM="-Wall -Wno-format-y2k $OPTIM"
# Additional warning options for development testing...
- OPTIM="-Wshadow -Wunused $OPTIM"
+ if test -d .svn; then
+ OPTIM="-Wshadow -Wunused $OPTIM"
+ fi
fi
case "$uname" in
<p>The port-monitor-supported attribute specifies the available port monitors.
+<h4><a name="printer-dns-sd-name">printer-dns-sd-name (name(MAX) | noValue)</a><span class='info'>CUPS 1.4</span></h4>
+
+<p>The printer-dns-sd-name attribute specifies the registered DNS-SD service
+name for the printer. If the printer is not being shared using this protocol,
+printer-dns-sd-name will have the noValue value.</p>
+
<h4><a name="printer-type">printer-type (type2 enum)</a></h4>
<p>The printer-type attribute specifies printer type and
</TD></TR>
<TR><TD> </TD></TR>
-<TR><TD CLASS="trailer">The Common UNIX Printing System, CUPS, and
-the CUPS logo are the trademark property of
-<A HREF="http://www.apple.com">Apple Inc.</A> CUPS is copyright 2007-2008 by
-Apple Inc., all rights reserved.</TD></TR>
+<TR><TD CLASS="trailer">The Common UNIX Printing System, CUPS, and the CUPS
+logo are trademarks of <A HREF="http://www.apple.com">Apple Inc.</A> CUPS is
+copyright 2007-2008 Apple Inc. All rights reserved.</TD></TR>
</TABLE>
</BODY>
</HTML>
const char *domain, /* I - Domain. ".local" for now */
void *context) /* I - User-defined context */
{
- (void)context;
+ cupsd_printer_t *p = (cupsd_printer_t *)context;
+ /* Current printer */
+
- cupsdLogMessage(CUPSD_LOG_DEBUG2,
- "dnssdRegisterCallback(%s, %s)", name, regtype);
+ cupsdLogMessage(CUPSD_LOG_DEBUG2, "dnssdRegisterCallback(%s, %s) for %s",
+ name, regtype, p->name);
if (errorCode)
{
"DNSServiceRegister failed with error %d", (int)errorCode);
return;
}
+ else if (strcasecmp(name, p->reg_name))
+ {
+ cupsdLogMessage(CUPSD_LOG_INFO, "Using service name \"%s\" for \"%s\"",
+ name, p->name);
+
+ cupsdSetString(&p->reg_name, name);
+ LastEvent |= CUPSD_EVENT_PRINTER_MODIFIED;
+ }
}
cupsdLogMessage(CUPSD_LOG_DEBUG,
- "dnssdRegisterPrinter(%s) type, domain is \"%s\", \"%s\"",
- p->name, regtype, domain ? domain : "(null)");
+ "dnssdRegisterPrinter(%s) type, domain is \"%s\", \"%s\"",
+ p->name, regtype, domain ? domain : "(null)");
se = DNSServiceRegister(&p->dnssd_ipp_ref, 0, 0, name, regtype,
domain, NULL, htons(port), txt_len, txt_record,
ippAddDate(con->response, IPP_TAG_PRINTER, "printer-current-time",
ippTimeToDate(curtime));
+#ifdef HAVE_DNSSD
+ if (!ra || cupsArrayFind(ra, "printer-dns-sd-name"))
+ {
+ if (printer->reg_name)
+ ippAddString(con->response, IPP_TAG_PRINTER, IPP_TAG_NAME,
+ "printer-dns-sd-name", NULL, printer->reg_name);
+ else
+ ippAddInteger(con->response, IPP_TAG_PRINTER, IPP_TAG_NOVALUE,
+ "printer-dns-sd-name", 0);
+ }
+#endif /* HAVE_DNSSD */
+
if (!ra || cupsArrayFind(ra, "printer-error-policy"))
ippAddString(con->response, IPP_TAG_PRINTER, IPP_TAG_NAME,
"printer-error-policy", NULL, printer->error_policy);
else if (con->response->request.status.status_code == IPP_OK)
{
cupsdSetJobPriority(job, attr->values[0].integer);
- event |= CUPSD_EVENT_JOB_CONFIG_CHANGED;
+ event |= CUPSD_EVENT_JOB_CONFIG_CHANGED |
+ CUPSD_EVENT_PRINTER_QUEUE_ORDER_CHANGED;
}
}
else if (!strcmp(attr->name, "job-state"))
* Send events as needed...
*/
+ if (event & CUPSD_EVENT_PRINTER_QUEUE_ORDER_CHANGED)
+ cupsdAddEvent(CUPSD_EVENT_PRINTER_QUEUE_ORDER_CHANGED, job->printer, job,
+ "Job priority changed by user.");
+
if (event & CUPSD_EVENT_JOB_STATE)
cupsdAddEvent(CUPSD_EVENT_JOB_STATE, job->printer, job,
job->state_value == IPP_JOB_HELD ?
"[Job %d] Unable to convert file %d to printable format!",
job->current_file, job->id);
cupsdLogMessage(CUPSD_LOG_INFO,
- "Hint: Do you have ESP Ghostscript installed?");
+ "Hint: Do you have Ghostscript installed?");
if (LogLevel < CUPSD_LOG_DEBUG)
cupsdLogMessage(CUPSD_LOG_INFO,
if (strncmp(printer->device_uri, "file:", 5) != 0)
{
- if (job->current_file == 1)
+ if (job->current_file == 1 || printer->remote)
{
sscanf(printer->device_uri, "%254[^:]", method);
snprintf(command, sizeof(command), "%s/backend/%s", ServerBin, method);
{
cupsdSetPrinterReasons(job->printer, message);
cupsdAddPrinterHistory(job->printer);
- event |= CUPSD_EVENT_PRINTER_STATE_CHANGED;
+ event |= CUPSD_EVENT_PRINTER_STATE;
}
update_job_attrs(job);
if ((attr = cupsGetOption("printer-alert", num_attrs, attrs)) != NULL)
{
cupsdSetString(&job->printer->alert, attr);
- event |= CUPSD_EVENT_PRINTER_STATE_CHANGED;
+ event |= CUPSD_EVENT_PRINTER_STATE;
}
if ((attr = cupsGetOption("printer-alert-description", num_attrs,
attrs)) != NULL)
{
cupsdSetString(&job->printer->alert_description, attr);
- event |= CUPSD_EVENT_PRINTER_STATE_CHANGED;
+ event |= CUPSD_EVENT_PRINTER_STATE;
}
cupsFreeOptions(num_attrs, attrs);
cupsdSetString(&job->printer->recoverable, ptr);
cupsdAddPrinterHistory(job->printer);
- event |= CUPSD_EVENT_PRINTER_STATE_CHANGED;
+ event |= CUPSD_EVENT_PRINTER_STATE;
}
else if (!strncmp(message, "recovered:", 10))
{
cupsdSetString(&job->printer->recoverable, ptr);
cupsdAddPrinterHistory(job->printer);
- event |= CUPSD_EVENT_PRINTER_STATE_CHANGED;
+ event |= CUPSD_EVENT_PRINTER_STATE;
}
#endif /* __APPLE__ */
else if (loglevel <= job->status_level)
strlcpy(job->printer->state_message, message,
sizeof(job->printer->state_message));
cupsdAddPrinterHistory(job->printer);
- event |= CUPSD_EVENT_PRINTER_STATE_CHANGED;
+ event |= CUPSD_EVENT_PRINTER_STATE;
update_job_attrs(job);
}
break;
}
- if ((event & CUPSD_EVENT_PRINTER_STATE_CHANGED))
- cupsdAddEvent(CUPSD_EVENT_PRINTER_STATE_CHANGED, job->printer, NULL,
+ if (event & CUPSD_EVENT_PRINTER_STATE)
+ cupsdAddEvent(CUPSD_EVENT_PRINTER_STATE, job->printer, NULL,
(job->printer->type & CUPS_PRINTER_CLASS) ?
"Class \"%s\" state changed." :
"Printer \"%s\" state changed.",
* Reset the accumulated events...
*/
- LastEvent = CUPSD_EVENT_NONE;
+ LastEvent = CUPSD_EVENT_NONE;
}
}
if (old_state != s)
{
cupsdAddEvent(s == IPP_PRINTER_STOPPED ? CUPSD_EVENT_PRINTER_STOPPED :
- CUPSD_EVENT_PRINTER_STATE_CHANGED, p, NULL,
+ CUPSD_EVENT_PRINTER_STATE, p, NULL,
"%s \"%s\" state changed.",
(p->type & CUPS_PRINTER_CLASS) ? "Class" : "Printer",
p->name);
"cupsdAddSubscription(mask=%x, dest=%p(%s), job=%p(%d), "
"uri=\"%s\")",
mask, dest, dest ? dest->name : "", job, job ? job->id : 0,
- uri);
+ uri ? uri : "(null)");
if (!Subscriptions)
Subscriptions = cupsArrayNew((cups_array_func_t)cupsd_compare_subscriptions,
case CUPSD_EVENT_PRINTER_MODIFIED :
return ("printer-modified");
+ case CUPSD_EVENT_PRINTER_QUEUE_ORDER_CHANGED :
+ return ("printer-queue-order-changed");
+
+ case CUPSD_EVENT_PRINTER_STATE :
case CUPSD_EVENT_PRINTER_STATE_CHANGED :
return ("printer-state-changed");
+ case CUPSD_EVENT_PRINTER_CONFIG :
case CUPSD_EVENT_PRINTER_CONFIG_CHANGED :
return ("printer-config-changed");
return ("job-progress");
case CUPSD_EVENT_JOB_STATE :
- return ("job-state");
-
case CUPSD_EVENT_JOB_STATE_CHANGED :
return ("job-state-changed");
return (CUPSD_EVENT_PRINTER_DELETED);
else if (!strcmp(name, "printer-modified"))
return (CUPSD_EVENT_PRINTER_MODIFIED);
+ else if (!strcmp(name, "printer-queue-order-changed"))
+ return (CUPSD_EVENT_PRINTER_QUEUE_ORDER_CHANGED);
else if (!strcmp(name, "printer-state-changed"))
return (CUPSD_EVENT_PRINTER_STATE_CHANGED);
else if (!strcmp(name, "printer-config-changed"))
return (CUPSD_EVENT_PRINTER_CONFIG_CHANGED);
else if (!strcmp(name, "printer-changed"))
return (CUPSD_EVENT_PRINTER_CHANGED);
- else if (!strcmp(name, "job-state"))
- return (CUPSD_EVENT_JOB_STATE);
else if (!strcmp(name, "job-created"))
return (CUPSD_EVENT_JOB_CREATED);
else if (!strcmp(name, "job-completed"))
typedef enum
{
/* Individual printer events... */
- CUPSD_EVENT_PRINTER_RESTARTED = 0x0001,
+ CUPSD_EVENT_PRINTER_STATE = 0x0001, /* Sent after generic printer state change */
+ CUPSD_EVENT_PRINTER_RESTARTED = 0x0002,
/* Sent after printer restarted */
- CUPSD_EVENT_PRINTER_SHUTDOWN = 0x0002,/* Sent after printer shutdown */
- CUPSD_EVENT_PRINTER_STOPPED = 0x0004, /* Sent after printer stopped */
- CUPSD_EVENT_PRINTER_FINISHINGS_CHANGED = 0x0008,
+ CUPSD_EVENT_PRINTER_SHUTDOWN = 0x0004,/* Sent after printer shutdown */
+ CUPSD_EVENT_PRINTER_STOPPED = 0x0008, /* Sent after printer stopped */
+
+ CUPSD_EVENT_PRINTER_CONFIG = 0x0010, /* Send after add/modify changes attrs */
+ CUPSD_EVENT_PRINTER_FINISHINGS_CHANGED = 0x0020,
/* Sent after finishings-supported changed */
- CUPSD_EVENT_PRINTER_MEDIA_CHANGED = 0x0010,
+ CUPSD_EVENT_PRINTER_MEDIA_CHANGED = 0x0040,
/* Sent after media-supported changed */
- CUPSD_EVENT_PRINTER_ADDED = 0x0020, /* Sent after printer added */
- CUPSD_EVENT_PRINTER_DELETED = 0x0040, /* Sent after printer deleted */
- CUPSD_EVENT_PRINTER_MODIFIED = 0x0080,/* Sent after printer modified */
+ CUPSD_EVENT_PRINTER_ADDED = 0x0080, /* Sent after printer added */
+ CUPSD_EVENT_PRINTER_DELETED = 0x0100, /* Sent after printer deleted */
+ CUPSD_EVENT_PRINTER_MODIFIED = 0x0200,/* Sent after printer modified */
+ CUPSD_EVENT_PRINTER_QUEUE_ORDER_CHANGED = 0x0400,
+ /* Sent when the order of jobs is changed */
/* Convenience printer event groupings... */
- CUPSD_EVENT_PRINTER_STATE_CHANGED = 0x0007,
- /* RESTARTED + SHUTDOWN + STOPPED */
- CUPSD_EVENT_PRINTER_CONFIG_CHANGED = 0x0018,
- /* FINISHINGS_CHANGED + MEDIA_CHANGED */
- CUPSD_EVENT_PRINTER_CHANGED = 0x00ff, /* All of the above */
+ CUPSD_EVENT_PRINTER_STATE_CHANGED = 0x000f,
+ /* STATE + RESTARTED + SHUTDOWN + STOPPED */
+ CUPSD_EVENT_PRINTER_CONFIG_CHANGED = 0x0070,
+ /* CONFIG + FINISHINGS_CHANGED + MEDIA_CHANGED */
+ CUPSD_EVENT_PRINTER_CHANGED = 0x07ff, /* All of the above */
/* Individual job events... */
- CUPSD_EVENT_JOB_STATE = 0x0100, /* Any state change */
- CUPSD_EVENT_JOB_CREATED = 0x0200, /* Send after job is created */
- CUPSD_EVENT_JOB_COMPLETED = 0x0400, /* Sent after job is completed */
- CUPSD_EVENT_JOB_STOPPED = 0x0800, /* Sent after job is stopped */
- CUPSD_EVENT_JOB_CONFIG_CHANGED = 0x1000,
+ CUPSD_EVENT_JOB_STATE = 0x0800, /* Any state change */
+ CUPSD_EVENT_JOB_CREATED = 0x1000, /* Send after job is created */
+ CUPSD_EVENT_JOB_COMPLETED = 0x2000, /* Sent after job is completed */
+ CUPSD_EVENT_JOB_STOPPED = 0x4000, /* Sent after job is stopped */
+ CUPSD_EVENT_JOB_CONFIG_CHANGED = 0x8000,
/* Sent after set-job-attributes */
- CUPSD_EVENT_JOB_PROGRESS = 0x2000, /* Sent for each page */
+ CUPSD_EVENT_JOB_PROGRESS = 0x10000, /* Sent for each page */
/* Convenience job event grouping... */
- CUPSD_EVENT_JOB_STATE_CHANGED = 0x0f00,
- /* Any state change + CREATED + COMPLETED + STOPPED */
+ CUPSD_EVENT_JOB_STATE_CHANGED = 0x7800,
+ /* STATE + CREATED + COMPLETED + STOPPED */
/* Server events... */
- CUPSD_EVENT_SERVER_RESTARTED = 0x4000,/* Sent after server restarts */
- CUPSD_EVENT_SERVER_STARTED = 0x8000, /* Sent when server first starts */
- CUPSD_EVENT_SERVER_STOPPED = 0x10000, /* Sent when server is stopped */
- CUPSD_EVENT_SERVER_AUDIT = 0x20000, /* Security-related stuff */
+ CUPSD_EVENT_SERVER_RESTARTED = 0x20000,/* Sent after server restarts */
+ CUPSD_EVENT_SERVER_STARTED = 0x40000, /* Sent when server first starts */
+ CUPSD_EVENT_SERVER_STOPPED = 0x80000, /* Sent when server is stopped */
+ CUPSD_EVENT_SERVER_AUDIT = 0x100000, /* Security-related stuff */
/* Everything and nothing... */
CUPSD_EVENT_NONE = 0, /* Nothing */
- CUPSD_EVENT_ALL = 0x1ffff /* Everything */
+ CUPSD_EVENT_ALL = 0x1fffff /* Everything */
} cupsd_eventmask_t;
</TD></TR>
<TR><TD> </TD></TR>
-<TR><TD CLASS="trailer">The Common UNIX Printing System, CUPS, and
-the CUPS logo are the trademark property of
-<A HREF="http://www.apple.com">Apple Inc.</A> CUPS is copyright 2007-2008 by
-Apple Inc., all rights reserved.</TD></TR>
+<TR><TD CLASS="trailer">The Common UNIX Printing System, CUPS, and the CUPS
+logo are trademarks of <A HREF="http://www.apple.com">Apple Inc.</A> CUPS is
+copyright 2007-2008 Apple Inc. All rights reserved.</TD></TR>
</TABLE>
</BODY>
</HTML>