-CHANGES.txt - 1.7.3 - 2014-05-13
+CHANGES.txt - 1.7.3 - 2014-05-22
--------------------------------
CHANGES IN CUPS V1.7.3
- The IPP backend did not abort a job when the printer did not validate
the supplied options (<rdar://problem/16836752>)
- Fixed an authentication race condition in cupsSendRequest (STR #4403)
+ - The scheduler did not add the "job-hold-until-specified" reason when
+ holding a job using the lp command (STR #4405)
+ - The CUPS headers incorrectly needed libdispatch for blocks support
+ (STR #4397)
+ - The configure script incorrectly added libgcrypt as a GNU TLS
+ dependency (STR #4399)
+ - CUPS did not compile when Avahi or mDNSResponder was not present
+ (STR #4402)
- cupsGetDestMediaCount did not work for CUPS_MEDIA_FLAGS DEFAULT
(STR #4414)
+ - Auto-typing of PWG Raster files did not work (STR #4417)
+ - IPP queues using hardcoded credentials would ask for credentials
+ (STR #4371)
+ - Dates in non-UTF-8 locales did not display correctly (STR #4388)
CHANGES IN CUPS V1.7.2
"job-state",
"job-state-reasons"
};
-static int job_canceled = 0;
+static int job_canceled = 0,
/* Job cancelled? */
+ uri_credentials = 0;
+ /* Credentials supplied in URI? */
static char username[256] = "",
/* Username for device URI */
*password = NULL;
*password++ = '\0';
cupsSetUser(username);
+ uri_credentials = 1;
}
else
{
(void)method;
(void)resource;
- /*
- * Remember that we need to authenticate...
- */
+ if (!uri_credentials)
+ {
+ /*
+ * Remember that we need to authenticate...
+ */
- auth_info_required = "username,password";
+ auth_info_required = "username,password";
- if (httpGetSubField(http, HTTP_FIELD_WWW_AUTHENTICATE, "username",
- def_username))
- {
- char quoted[HTTP_MAX_VALUE * 2 + 4];
- /* Quoted string */
+ if (httpGetSubField(http, HTTP_FIELD_WWW_AUTHENTICATE, "username",
+ def_username))
+ {
+ char quoted[HTTP_MAX_VALUE * 2 + 4];
+ /* Quoted string */
- fprintf(stderr, "ATTR: auth-info-default=%s,\n",
- quote_string(def_username, quoted, sizeof(quoted)));
+ fprintf(stderr, "ATTR: auth-info-default=%s,\n",
+ quote_string(def_username, quoted, sizeof(quoted)));
+ }
}
if (password && *password && *password_tries < 3)
/*
* "$Id$"
*
- * CGI <-> IPP variable routines for CUPS.
+ * CGI <-> IPP variable routines for CUPS.
*
- * Copyright 2007-2012 by Apple Inc.
- * Copyright 1997-2007 by Easy Software Products.
+ * Copyright 2007-2014 by Apple Inc.
+ * Copyright 1997-2007 by Easy Software Products.
*
- * These coded instructions, statements, and computer programs are the
- * property of Apple Inc. and are protected by Federal copyright
- * law. Distribution and use rights are outlined in the file "LICENSE.txt"
- * which should have been included with this file. If this file is
- * file is missing or damaged, see the license at "http://www.cups.org/".
- *
- * Contents:
- *
- * cgiGetAttributes() - Get the list of attributes that are needed by the
- * template file.
- * cgiGetIPPObjects() - Get the objects in an IPP response.
- * cgiMoveJobs() - Move one or more jobs.
- * cgiPrintCommand() - Print a CUPS command job.
- * cgiPrintTestPage() - Print a test page.
- * cgiRewriteURL() - Rewrite a printer URI into a web browser URL...
- * cgiSetIPPObjectVars() - Set CGI variables from an IPP object.
- * cgiSetIPPVars() - Set CGI variables from an IPP response.
- * cgiShowIPPError() - Show the last IPP error message.
- * cgiShowJobs() - Show print jobs.
- * cgiText() - Return localized text.
+ * These coded instructions, statements, and computer programs are the
+ * property of Apple Inc. and are protected by Federal copyright
+ * law. Distribution and use rights are outlined in the file "LICENSE.txt"
+ * which should have been included with this file. If this file is
+ * file is missing or damaged, see the license at "http://www.cups.org/".
*/
/*
*nameptr, /* Pointer into name */
value[16384], /* Value(s) */
*valptr; /* Pointer into value */
- struct tm *date; /* Date information */
fprintf(stderr, "DEBUG2: cgiSetIPPObjectVars(obj=%p, prefix=\"%s\", "
case IPP_TAG_INTEGER :
case IPP_TAG_ENUM :
if (strncmp(name, "time_at_", 8) == 0)
- {
- time_t t; /* Temporary time value */
-
- t = (time_t)attr->values[i].integer;
- date = localtime(&t);
-
- strftime(valptr, sizeof(value) - (valptr - value), "%c", date);
- }
+ _cupsStrDate(valptr, sizeof(value) - (size_t)(valptr - value), (time_t)ippGetInteger(attr, i));
else
- snprintf(valptr, sizeof(value) - (valptr - value),
- "%d", attr->values[i].integer);
+ snprintf(valptr, sizeof(value) - (size_t)(valptr - value), "%d", ippGetInteger(attr, i));
break;
case IPP_TAG_BOOLEAN :
#
# "$Id: mime.types 7670 2008-06-17 22:42:08Z mike $"
#
-# Base MIME types file for CUPS.
+# Base MIME types file for CUPS.
#
-# DO NOT EDIT THIS FILE, AS IT IS OVERWRITTEN WHEN YOU INSTALL NEW
-# VERSIONS OF CUPS. Instead, create a "local.types" file that
-# reflects your local configuration changes.
+# DO NOT EDIT THIS FILE, AS IT IS OVERWRITTEN WHEN YOU INSTALL NEW
+# VERSIONS OF CUPS. Instead, create a "local.types" file that
+# reflects your local configuration changes.
#
-# Copyright 2007-2011 by Apple Inc.
-# Copyright 1997-2007 by Easy Software Products.
+# Copyright 2007-2014 by Apple Inc.
+# Copyright 1997-2007 by Easy Software Products.
#
-# These coded instructions, statements, and computer programs are the
-# property of Apple Inc. and are protected by Federal copyright
-# law. Distribution and use rights are outlined in the file "LICENSE.txt"
-# which should have been included with this file. If this file is
-# file is missing or damaged, see the license at "http://www.cups.org/".
+# These coded instructions, statements, and computer programs are the
+# property of Apple Inc. and are protected by Federal copyright
+# law. Distribution and use rights are outlined in the file "LICENSE.txt"
+# which should have been included with this file. If this file is
+# file is missing or damaged, see the license at "http://www.cups.org/".
#
########################################################################
char(3,0xe4) char(3,0xe5) char(3,0xe6) char(3,0xe7)\
char(3,0xe8) char(3,0xe9) char(3,0xea) char(3,0xeb)\
char(3,0xec) char(3,0xed) char(3,0xee) char(3,0xef))
-image/pwg-raster string(0,"RaS2") + string(4,PwgRaster<00>) priority(100)
+image/pwg-raster string(0,"RaS2") + string(4,PwgRaster<00>) priority(150)
image/tiff tiff tif string(0,MM<002A>) string(0,II<2A00>)
image/x-photocd pcd string(2048,PCD_IPI)
image/x-portable-anymap pnm
application/vnd.cups-postscript
application/vnd.cups-ppd ppd string(0,"*PPD-Adobe:")
application/vnd.cups-raster string(0,"RaSt") string(0,"tSaR") \
- string(0,"RaS2") string(0,"2SaR") \
+ (string(0,"RaS2") + !string(4,PwgRaster<00>)) string(0,"2SaR") \
string(0,"RaS3") string(0,"3SaR")
application/vnd.cups-raw (string(0,<1B>E) + !string(2,<1B>%0B)) \
string(0,<1B>@) \
_cupsSetError\r
_cupsSetLocale\r
_cupsStrAlloc\r
+_cupsStrDate\r
_cupsStrFlush\r
_cupsStrFormatd\r
_cupsStrFree\r
/*
* "$Id$"
*
- * Private string definitions for CUPS.
+ * Private string definitions for CUPS.
*
- * Copyright 2007-2013 by Apple Inc.
- * Copyright 1997-2006 by Easy Software Products.
+ * Copyright 2007-2014 by Apple Inc.
+ * Copyright 1997-2006 by Easy Software Products.
*
- * These coded instructions, statements, and computer programs are the
- * property of Apple Inc. and are protected by Federal copyright
- * law. Distribution and use rights are outlined in the file "LICENSE.txt"
- * which should have been included with this file. If this file is
- * file is missing or damaged, see the license at "http://www.cups.org/".
+ * These coded instructions, statements, and computer programs are the
+ * property of Apple Inc. and are protected by Federal copyright
+ * law. Distribution and use rights are outlined in the file "LICENSE.txt"
+ * which should have been included with this file. If this file is
+ * file is missing or damaged, see the license at "http://www.cups.org/".
*
- * This file is subject to the Apple OS-Developed Software exception.
+ * This file is subject to the Apple OS-Developed Software exception.
*/
#ifndef _CUPS_STRING_PRIVATE_H_
# include <ctype.h>
# include <errno.h>
# include <locale.h>
+# include <time.h>
# include "config.h"
struct lconv *loc);
+/*
+ * Date function...
+ */
+
+extern char *_cupsStrDate(char *buf, size_t bufsize, time_t timeval);
+
+
/*
* C++ magic...
*/
*/
#define _CUPS_STRING_C_
-#include "string-private.h"
-#include "debug-private.h"
-#include "thread-private.h"
-#include "array.h"
+#include "cups-private.h"
#include <stddef.h>
#include <limits.h>
}
+/*
+ * '_cupsStrDate()' - Return a localized date for a given time value.
+ *
+ * This function works around the locale encoding issues of strftime...
+ */
+
+char * /* O - Buffer */
+_cupsStrDate(char *buf, /* I - Buffer */
+ size_t bufsize, /* I - Size of buffer */
+ time_t timeval) /* I - Time value */
+{
+ struct tm *dateval; /* Local date/time */
+ char temp[1024]; /* Temporary buffer */
+ _cups_globals_t *cg = _cupsGlobals(); /* Per-thread globals */
+
+
+ if (!cg->lang_default)
+ cg->lang_default = cupsLangDefault();
+
+ dateval = localtime(&timeval);
+
+ if (cg->lang_default->encoding != CUPS_UTF8)
+ {
+ strftime(temp, sizeof(temp), "%c", dateval);
+ cupsCharsetToUTF8((cups_utf8_t *)buf, temp, (int)bufsize, cg->lang_default->encoding);
+ }
+ else
+ strftime(buf, bufsize, "%c", dateval);
+
+ return (buf);
+}
+
+
/*
* '_cupsStrFlush()' - Flush the string pool.
*/
case IPP_TAG_DATE :
{
- time_t vtime; /* Date/Time value */
- struct tm *vdate; /* Date info */
char vstring[256]; /* Formatted time */
for (i = 0, val = attr->values; i < attr->num_values; i ++, val ++)
- {
- vtime = ippDateToTime(val->date);
- vdate = localtime(&vtime);
- strftime(vstring, sizeof(vstring), "%c", vdate);
- printf(" (%s)", vstring);
- }
+ printf(" (%s)", _cupsStrDate(vstring, sizeof(vstring), ippDateToTime(val->date)));
}
putchar('\n');
break;
case IPP_TAG_DATE :
{
- time_t vtime; /* Date/Time value */
- struct tm *vdate; /* Date info */
char vstring[256]; /* Formatted time */
for (i = 0, val = attr->values; i < attr->num_values; i ++, val ++)
- {
- vtime = ippDateToTime(val->date);
- vdate = localtime(&vtime);
- strftime(vstring, sizeof(vstring), "%c", vdate);
- printf(" (%s)", vstring);
- }
+ printf(" (%s)", _cupsStrDate(vstring, sizeof(vstring), ippDateToTime(val->date)));
}
putchar('\n');
break;
*
* "lpstat" command for CUPS.
*
- * Copyright 2007-2013 by Apple Inc.
+ * Copyright 2007-2014 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
*message; /* Printer device URI */
int accepting; /* Accepting requests? */
time_t ptime; /* Printer state time */
- struct tm *pdate; /* Printer state date & time */
char printer_state_time[255];/* Printer state time */
static const char *pattrs[] = /* Attributes we need for printers... */
{
if (match_list(printers, printer))
{
- pdate = localtime(&ptime);
- strftime(printer_state_time, sizeof(printer_state_time), "%c", pdate);
+ _cupsStrDate(printer_state_time, sizeof(printer_state_time), ptime);
if (accepting)
_cupsLangPrintf(stdout, _("%s accepting requests since %s"),
jobid, /* job-id */
size; /* job-k-octets */
time_t jobtime; /* time-at-creation */
- struct tm *jobdate; /* Date & time */
char temp[255], /* Temporary buffer */
date[255]; /* Date buffer */
static const char *jattrs[] = /* Attributes we need for jobs... */
if (match_list(dests, dest) && match_list(users, username))
{
- jobdate = localtime(&jobtime);
snprintf(temp, sizeof(temp), "%s-%d", dest, jobid);
- if (long_status == 3)
- {
- /*
- * Show the consolidated output format for the SGI tools...
- */
+ _cupsStrDate(date, sizeof(date), jobtime);
- if (!strftime(date, sizeof(date), "%b %d %H:%M", jobdate))
- strlcpy(date, "Unknown", sizeof(date));
-
- _cupsLangPrintf(stdout, "%s;%s;%d;%s;%s",
- temp, username ? username : "unknown",
- size, title ? title : "unknown", date);
- }
+ if (ranking)
+ _cupsLangPrintf(stdout, "%3d %-21s %-13s %8.0f %s",
+ rank, temp, username ? username : "unknown",
+ 1024.0 * size, date);
else
+ _cupsLangPrintf(stdout, "%-23s %-13s %8.0f %s",
+ temp, username ? username : "unknown",
+ 1024.0 * size, date);
+ if (long_status)
{
- if (!strftime(date, sizeof(date), "%c", jobdate))
- strlcpy(date, "Unknown", sizeof(date));
-
- if (ranking)
- _cupsLangPrintf(stdout, "%3d %-21s %-13s %8.0f %s",
- rank, temp, username ? username : "unknown",
- 1024.0 * size, date);
- else
- _cupsLangPrintf(stdout, "%-23s %-13s %8.0f %s",
- temp, username ? username : "unknown",
- 1024.0 * size, date);
- if (long_status)
- {
- if (message)
- _cupsLangPrintf(stdout, _("\tStatus: %s"), message);
-
- if (reasons)
- {
- char alerts[1024], /* Alerts string */
- *aptr; /* Pointer into alerts string */
+ if (message)
+ _cupsLangPrintf(stdout, _("\tStatus: %s"), message);
- for (i = 0, aptr = alerts; i < reasons->num_values; i ++)
- {
- if (i)
- snprintf(aptr, sizeof(alerts) - (aptr - alerts), " %s",
- reasons->values[i].string.text);
- else
- strlcpy(alerts, reasons->values[i].string.text,
- sizeof(alerts));
-
- aptr += strlen(aptr);
- }
+ if (reasons)
+ {
+ char alerts[1024], /* Alerts string */
+ *aptr; /* Pointer into alerts string */
- _cupsLangPrintf(stdout, _("\tAlerts: %s"), alerts);
+ for (i = 0, aptr = alerts; i < reasons->num_values; i ++)
+ {
+ if (i)
+ snprintf(aptr, sizeof(alerts) - (aptr - alerts), " %s",
+ reasons->values[i].string.text);
+ else
+ strlcpy(alerts, reasons->values[i].string.text,
+ sizeof(alerts));
+
+ aptr += strlen(aptr);
}
- _cupsLangPrintf(stdout, _("\tqueued for %s"), dest);
+ _cupsLangPrintf(stdout, _("\tAlerts: %s"), alerts);
}
+
+ _cupsLangPrintf(stdout, _("\tqueued for %s"), dest);
}
}
ipp_pstate_t pstate; /* Printer state */
cups_ptype_t ptype; /* Printer type */
time_t ptime; /* Printer state time */
- struct tm *pdate; /* Printer state date & time */
int jobid; /* Job ID of current job */
char printer_uri[HTTP_MAX_URI],
/* Printer URI */
* Display it...
*/
- pdate = localtime(&ptime);
- strftime(printer_state_time, sizeof(printer_state_time), "%c", pdate);
+ _cupsStrDate(printer_state_time, sizeof(printer_state_time), ptime);
switch (pstate)
{