summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDidier Raboud <odyx@debian.org>2018-06-08 14:42:43 +0200
committerDidier Raboud <odyx@debian.org>2018-06-08 14:54:36 +0200
commit5a63f6c6a3516bdaf1f30a2628fbe53679e5a637 (patch)
tree407a4cf17f61051116f84f138caf585091188ed0
parent1c956f7f9ffd3518a7a762da1f4126d8348eb5ee (diff)
parent145b38346c4db876915a426f2f921a75bdd4f966 (diff)
merge patched-debian/master into debian/master
-rw-r--r--cups/ipp.c54
-rw-r--r--cups/testhttp.c7
-rw-r--r--debian/.git-dpm4
-rw-r--r--debian/patches/0016-Revert-Generalize-the-input-validation-of-some-kinds.patch358
-rw-r--r--debian/patches/0038-Build-mantohtml-with-the-build-architecture-compiler.patch (renamed from debian/patches/0037-Build-mantohtml-with-the-build-architecture-compiler.patch)2
-rw-r--r--debian/patches/0039-The-lp-and-lpr-commands-now-provide-better-error-mes.patch (renamed from debian/patches/0038-The-lp-and-lpr-commands-now-provide-better-error-mes.patch)2
-rw-r--r--debian/patches/airprint-support.patch2
-rw-r--r--debian/patches/confdirperms.patch2
-rw-r--r--debian/patches/cups-deviced-allow-device-ids-with-newline.patch2
-rw-r--r--debian/patches/cups-set-default-error-policy-retry-job.patch2
-rw-r--r--debian/patches/cups-snmp-oids-device-id-hp-ricoh.patch2
-rw-r--r--debian/patches/cupsd-set-default-for-SyncOnClose-to-Yes.patch2
-rw-r--r--debian/patches/debianize_cups-config.patch2
-rw-r--r--debian/patches/default_log_settings.patch2
-rw-r--r--debian/patches/do-not-broadcast-with-hostnames.patch2
-rw-r--r--debian/patches/drop_unnecessary_dependencies.patch2
-rw-r--r--debian/patches/log-debug-history-nearly-unlimited.patch2
-rw-r--r--debian/patches/logfiles_adm_readable.patch2
-rw-r--r--debian/patches/man-cups-lpd-drop-dangling-references.patch2
-rw-r--r--debian/patches/manpage-translations.patch2
-rw-r--r--debian/patches/move-cupsd-conf-default-to-share.patch2
-rw-r--r--debian/patches/no-conffile-timestamp.patch2
-rw-r--r--debian/patches/printer-filtering.patch4
-rw-r--r--debian/patches/reactivate_recommended_driver.patch2
-rw-r--r--debian/patches/read-embedded-options-from-incoming-postscript-and-add-to-ipp-attrs.patch8
-rw-r--r--debian/patches/removecvstag.patch2
-rw-r--r--debian/patches/rename-systemd-units.patch2
-rw-r--r--debian/patches/series5
-rw-r--r--debian/patches/show-compile-command-lines.patch2
-rw-r--r--scheduler/ipp.c164
30 files changed, 515 insertions, 133 deletions
diff --git a/cups/ipp.c b/cups/ipp.c
index 225188c86..abb80b15a 100644
--- a/cups/ipp.c
+++ b/cups/ipp.c
@@ -1,8 +1,8 @@
/*
* Internet Printing Protocol functions for CUPS.
*
- * Copyright © 2007-2018 by Apple Inc.
- * Copyright © 1997-2007 by Easy Software Products, all rights reserved.
+ * Copyright 2007-2017 by Apple Inc.
+ * Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Apple Inc. and are protected by Federal copyright
@@ -4935,6 +4935,21 @@ ippValidateAttribute(
ipp_attribute_t *colattr; /* Collection attribute */
regex_t re; /* Regular expression */
ipp_uchar_t *date; /* Current date value */
+ static const char * const uri_status_strings[] =
+ { /* URI status strings */
+ "URI too large",
+ "Bad arguments to function",
+ "Bad resource in URI",
+ "Bad port number in URI",
+ "Bad hostname/address in URI",
+ "Bad username in URI",
+ "Bad scheme in URI",
+ "Bad/empty URI",
+ "OK",
+ "Missing scheme in URI",
+ "Unknown scheme in URI",
+ "Missing resource in URI"
+ };
/*
@@ -5209,18 +5224,14 @@ ippValidateAttribute(
}
else if (*ptr & 0x80)
break;
- else if ((*ptr < ' ' && *ptr != '\n' && *ptr != '\r' && *ptr != '\t') || *ptr == 0x7f)
- break;
}
- if (*ptr < ' ' || *ptr == 0x7f)
- {
- ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad text value \"%s\" - bad control character (PWG 5100.14 section 8.3)."), attr->name, attr->values[i].string.text);
- return (0);
- }
- else if (*ptr)
+ if (*ptr)
{
- ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad text value \"%s\" - bad UTF-8 sequence (RFC 8011 section 5.1.2)."), attr->name, attr->values[i].string.text);
+ ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
+ _("\"%s\": Bad text value \"%s\" - bad UTF-8 "
+ "sequence (RFC 8011 section 5.1.2)."), attr->name,
+ attr->values[i].string.text);
return (0);
}
@@ -5271,18 +5282,14 @@ ippValidateAttribute(
}
else if (*ptr & 0x80)
break;
- else if (*ptr < ' ' || *ptr == 0x7f)
- break;
}
- if (*ptr < ' ' || *ptr == 0x7f)
+ if (*ptr)
{
- ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad name value \"%s\" - bad control character (PWG 5100.14 section 8.1)."), attr->name, attr->values[i].string.text);
- return (0);
- }
- else if (*ptr)
- {
- ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad name value \"%s\" - bad UTF-8 sequence (RFC 8011 section 5.1.3)."), attr->name, attr->values[i].string.text);
+ ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
+ _("\"%s\": Bad name value \"%s\" - bad UTF-8 "
+ "sequence (RFC 8011 section 5.1.3)."), attr->name,
+ attr->values[i].string.text);
return (0);
}
@@ -5339,7 +5346,12 @@ ippValidateAttribute(
if (uri_status < HTTP_URI_STATUS_OK)
{
- ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad URI value \"%s\" - %s (RFC 8011 section 5.1.6)."), attr->name, attr->values[i].string.text, httpURIStatusString(uri_status));
+ ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
+ _("\"%s\": Bad URI value \"%s\" - %s "
+ "(RFC 8011 section 5.1.6)."), attr->name,
+ attr->values[i].string.text,
+ uri_status_strings[uri_status -
+ HTTP_URI_STATUS_OVERFLOW]);
return (0);
}
diff --git a/cups/testhttp.c b/cups/testhttp.c
index fa8356c02..a2d890d06 100644
--- a/cups/testhttp.c
+++ b/cups/testhttp.c
@@ -1,8 +1,8 @@
/*
* HTTP test program for CUPS.
*
- * Copyright © 2007-2018 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
@@ -186,9 +186,6 @@ static uri_test_t uri_tests[] = /* URI test data */
HTTP_URI_CODING_MOST },
/* Bad resource */
- { HTTP_URI_STATUS_BAD_RESOURCE, "mailto:\r\nbla",
- "mailto", "", "", "", 0, 0,
- HTTP_URI_CODING_MOST },
{ HTTP_URI_STATUS_BAD_RESOURCE, "http://server/index.html%",
"http", "", "server", "", 80, 0,
HTTP_URI_CODING_MOST },
diff --git a/debian/.git-dpm b/debian/.git-dpm
index dd309b259..fffdd6d64 100644
--- a/debian/.git-dpm
+++ b/debian/.git-dpm
@@ -1,6 +1,6 @@
# see git-dpm(1) from git-dpm package
-355576a29ac7a47c8d1ed29d12fb9116bf5ad866
-355576a29ac7a47c8d1ed29d12fb9116bf5ad866
+145b38346c4db876915a426f2f921a75bdd4f966
+145b38346c4db876915a426f2f921a75bdd4f966
4ebeb20c50145190312c9897efa26ed5b58b3bc5
4ebeb20c50145190312c9897efa26ed5b58b3bc5
cups_2.2.8.orig.tar.gz
diff --git a/debian/patches/0016-Revert-Generalize-the-input-validation-of-some-kinds.patch b/debian/patches/0016-Revert-Generalize-the-input-validation-of-some-kinds.patch
new file mode 100644
index 000000000..54385837d
--- /dev/null
+++ b/debian/patches/0016-Revert-Generalize-the-input-validation-of-some-kinds.patch
@@ -0,0 +1,358 @@
+From e140328970f39713cf9ad3aa9ddb069611605eb4 Mon Sep 17 00:00:00 2001
+From: Didier Raboud <odyx@debian.org>
+Date: Fri, 8 Jun 2018 14:39:21 +0200
+Subject: Revert "Generalize the input validation of some kinds of attributes."
+
+This reverts commit 4c37eb9f77910f6f856fc540fc9a94a5885af17c.
+
+Fixes FTBFS on 2.2.8, see https://github.com/apple/cups/issues/5322
+---
+ cups/ipp.c | 54 +++++++++-------
+ cups/testhttp.c | 7 +--
+ scheduler/ipp.c | 164 ++++++++++++++++++++++++++----------------------
+ 3 files changed, 124 insertions(+), 101 deletions(-)
+
+diff --git a/cups/ipp.c b/cups/ipp.c
+index b33a3bc2e..a93e1e921 100644
+--- a/cups/ipp.c
++++ b/cups/ipp.c
+@@ -1,8 +1,8 @@
+ /*
+ * Internet Printing Protocol functions for CUPS.
+ *
+- * Copyright © 2007-2018 by Apple Inc.
+- * Copyright © 1997-2007 by Easy Software Products, all rights reserved.
++ * Copyright 2007-2017 by Apple Inc.
++ * Copyright 1997-2007 by Easy Software Products, all rights reserved.
+ *
+ * These coded instructions, statements, and computer programs are the
+ * property of Apple Inc. and are protected by Federal copyright
+@@ -4819,6 +4819,21 @@ ippValidateAttribute(
+ ipp_attribute_t *colattr; /* Collection attribute */
+ regex_t re; /* Regular expression */
+ ipp_uchar_t *date; /* Current date value */
++ static const char * const uri_status_strings[] =
++ { /* URI status strings */
++ "URI too large",
++ "Bad arguments to function",
++ "Bad resource in URI",
++ "Bad port number in URI",
++ "Bad hostname/address in URI",
++ "Bad username in URI",
++ "Bad scheme in URI",
++ "Bad/empty URI",
++ "OK",
++ "Missing scheme in URI",
++ "Unknown scheme in URI",
++ "Missing resource in URI"
++ };
+
+
+ /*
+@@ -5093,18 +5108,14 @@ ippValidateAttribute(
+ }
+ else if (*ptr & 0x80)
+ break;
+- else if ((*ptr < ' ' && *ptr != '\n' && *ptr != '\r' && *ptr != '\t') || *ptr == 0x7f)
+- break;
+ }
+
+- if (*ptr < ' ' || *ptr == 0x7f)
+- {
+- ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad text value \"%s\" - bad control character (PWG 5100.14 section 8.3)."), attr->name, attr->values[i].string.text);
+- return (0);
+- }
+- else if (*ptr)
++ if (*ptr)
+ {
+- ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad text value \"%s\" - bad UTF-8 sequence (RFC 8011 section 5.1.2)."), attr->name, attr->values[i].string.text);
++ ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
++ _("\"%s\": Bad text value \"%s\" - bad UTF-8 "
++ "sequence (RFC 8011 section 5.1.2)."), attr->name,
++ attr->values[i].string.text);
+ return (0);
+ }
+
+@@ -5155,18 +5166,14 @@ ippValidateAttribute(
+ }
+ else if (*ptr & 0x80)
+ break;
+- else if (*ptr < ' ' || *ptr == 0x7f)
+- break;
+ }
+
+- if (*ptr < ' ' || *ptr == 0x7f)
++ if (*ptr)
+ {
+- ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad name value \"%s\" - bad control character (PWG 5100.14 section 8.1)."), attr->name, attr->values[i].string.text);
+- return (0);
+- }
+- else if (*ptr)
+- {
+- ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad name value \"%s\" - bad UTF-8 sequence (RFC 8011 section 5.1.3)."), attr->name, attr->values[i].string.text);
++ ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
++ _("\"%s\": Bad name value \"%s\" - bad UTF-8 "
++ "sequence (RFC 8011 section 5.1.3)."), attr->name,
++ attr->values[i].string.text);
+ return (0);
+ }
+
+@@ -5223,7 +5230,12 @@ ippValidateAttribute(
+
+ if (uri_status < HTTP_URI_STATUS_OK)
+ {
+- ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad URI value \"%s\" - %s (RFC 8011 section 5.1.6)."), attr->name, attr->values[i].string.text, httpURIStatusString(uri_status));
++ ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
++ _("\"%s\": Bad URI value \"%s\" - %s "
++ "(RFC 8011 section 5.1.6)."), attr->name,
++ attr->values[i].string.text,
++ uri_status_strings[uri_status -
++ HTTP_URI_STATUS_OVERFLOW]);
+ return (0);
+ }
+
+diff --git a/cups/testhttp.c b/cups/testhttp.c
+index fa8356c02..a2d890d06 100644
+--- a/cups/testhttp.c
++++ b/cups/testhttp.c
+@@ -1,8 +1,8 @@
+ /*
+ * HTTP test program for CUPS.
+ *
+- * Copyright © 2007-2018 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
+@@ -186,9 +186,6 @@ static uri_test_t uri_tests[] = /* URI test data */
+ HTTP_URI_CODING_MOST },
+
+ /* Bad resource */
+- { HTTP_URI_STATUS_BAD_RESOURCE, "mailto:\r\nbla",
+- "mailto", "", "", "", 0, 0,
+- HTTP_URI_CODING_MOST },
+ { HTTP_URI_STATUS_BAD_RESOURCE, "http://server/index.html%",
+ "http", "", "server", "", 80, 0,
+ HTTP_URI_CODING_MOST },
+diff --git a/scheduler/ipp.c b/scheduler/ipp.c
+index d1c6a89fb..d4e092d65 100644
+--- a/scheduler/ipp.c
++++ b/scheduler/ipp.c
+@@ -5873,26 +5873,7 @@ create_subscriptions(
+ }
+
+ if (recipient)
+- {
+ cupsdLogMessage(CUPSD_LOG_DEBUG, "recipient=\"%s\"", recipient);
+-
+-
+- if (!strncmp(recipient, "mailto:", 7) && user_data)
+- {
+- char temp[64]; /* Temporary string */
+-
+- memcpy(temp, user_data->values[0].unknown.data, user_data->values[0].unknown.length);
+- temp[user_data->values[0].unknown.length] = '\0';
+-
+- if (httpSeparateURI(HTTP_URI_CODING_ALL, temp, scheme, sizeof(scheme), userpass, sizeof(userpass), host, sizeof(host), &port, resource, sizeof(resource)) < HTTP_URI_OK)
+- {
+- send_ipp_status(con, IPP_NOT_POSSIBLE, _("Bad notify-user-data \"%s\"."), temp);
+- ippAddInteger(con->response, IPP_TAG_SUBSCRIPTION, IPP_TAG_ENUM, "notify-status-code", IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES);
+- return;
+- }
+- }
+- }
+-
+ if (pullmethod)
+ cupsdLogMessage(CUPSD_LOG_DEBUG, "pullmethod=\"%s\"", pullmethod);
+ cupsdLogMessage(CUPSD_LOG_DEBUG, "notify-lease-duration=%d", lease);
+@@ -7988,16 +7969,13 @@ hold_job(cupsd_client_t *con, /* I - Client connection */
+ * Hold the job and return...
+ */
+
+- if ((attr = ippFindAttribute(con->request, "job-hold-until", IPP_TAG_ZERO)) != NULL)
+- {
+- if ((ippGetValueTag(attr) != IPP_TAG_KEYWORD && ippGetValueTag(attr) != IPP_TAG_NAME && ippGetValueTag(attr) != IPP_TAG_NAMELANG) || ippGetCount(attr) != 1 || !ippValidateAttribute(attr))
+- {
+- send_ipp_status(con, IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES, _("Unsupported 'job-hold-until' value."));
+- ippCopyAttribute(con->response, attr, 0);
+- return;
+- }
++ if ((attr = ippFindAttribute(con->request, "job-hold-until",
++ IPP_TAG_KEYWORD)) == NULL)
++ attr = ippFindAttribute(con->request, "job-hold-until", IPP_TAG_NAME);
+
+- when = ippGetString(attr, 0, NULL);
++ if (attr)
++ {
++ when = attr->values[0].string.text;
+
+ cupsdAddEvent(CUPSD_EVENT_JOB_CONFIG_CHANGED, cupsdFindDest(job->dest), job,
+ "Job job-hold-until value changed by user.");
+@@ -10361,39 +10339,7 @@ set_job_attrs(cupsd_client_t *con, /* I - Client connection */
+ continue;
+ }
+
+- if (!ippValidateAttribute(attr))
+- {
+- send_ipp_status(con, IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES, _("Bad '%s' value."), attr->name);
+- ippCopyAttribute(con->response, attr, 0);
+- return;
+- }
+-
+- if (!strcmp(attr->name, "job-hold-until"))
+- {
+- const char *when = ippGetString(attr, 0, NULL);
+- /* job-hold-until value */
+-
+- if ((ippGetValueTag(attr) != IPP_TAG_KEYWORD && ippGetValueTag(attr) != IPP_TAG_NAME && ippGetValueTag(attr) != IPP_TAG_NAMELANG) || ippGetCount(attr) != 1)
+- {
+- send_ipp_status(con, IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES, _("Unsupported 'job-hold-until' value."));
+- ippCopyAttribute(con->response, attr, 0);
+- return;
+- }
+-
+- cupsdLogJob(job, CUPSD_LOG_DEBUG, "Setting job-hold-until to %s", when);
+- cupsdSetJobHoldUntil(job, when, 0);
+-
+- if (!strcmp(when, "no-hold"))
+- {
+- cupsdReleaseJob(job);
+- check_jobs = 1;
+- }
+- else
+- cupsdSetJobState(job, IPP_JOB_HELD, CUPSD_JOB_DEFAULT, "Job held by \"%s\".", username);
+-
+- event |= CUPSD_EVENT_JOB_CONFIG_CHANGED | CUPSD_EVENT_JOB_STATE;
+- }
+- else if (!strcmp(attr->name, "job-priority"))
++ if (!strcmp(attr->name, "job-priority"))
+ {
+ /*
+ * Change the job priority...
+@@ -10513,6 +10459,28 @@ set_job_attrs(cupsd_client_t *con, /* I - Client connection */
+ */
+
+ ippCopyAttribute(job->attrs, attr, 0);
++
++ /*
++ * See if the job-name or job-hold-until is being changed.
++ */
++
++ if (!strcmp(attr->name, "job-hold-until"))
++ {
++ cupsdLogJob(job, CUPSD_LOG_DEBUG, "Setting job-hold-until to %s",
++ attr->values[0].string.text);
++ cupsdSetJobHoldUntil(job, attr->values[0].string.text, 0);
++
++ if (!strcmp(attr->values[0].string.text, "no-hold"))
++ {
++ cupsdReleaseJob(job);
++ check_jobs = 1;
++ }
++ else
++ cupsdSetJobState(job, IPP_JOB_HELD, CUPSD_JOB_DEFAULT,
++ "Job held by \"%s\".", username);
++
++ event |= CUPSD_EVENT_JOB_CONFIG_CHANGED | CUPSD_EVENT_JOB_STATE;
++ }
+ }
+ else if (attr->value_tag == IPP_TAG_DELETEATTR)
+ {
+@@ -11330,35 +11298,81 @@ validate_job(cupsd_client_t *con, /* I - Client connection */
+ }
+ }
+
+- /*
+- * Is the job-hold-until value valid?
+- */
+-
+- if ((attr = ippFindAttribute(con->request, "job-hold-until", IPP_TAG_ZERO)) != NULL && ((ippGetValueTag(attr) != IPP_TAG_KEYWORD && ippGetValueTag(attr) != IPP_TAG_NAME && ippGetValueTag(attr) != IPP_TAG_NAMELANG) || ippGetCount(attr) != 1 || !ippValidateAttribute(attr)))
+- {
+- send_ipp_status(con, IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES, _("Unsupported 'job-hold-until' value."));
+- ippCopyAttribute(con->response, attr, 0);
+- return;
+- }
+-
+ /*
+ * Is the job-name valid?
+ */
+
+ if ((name = ippFindAttribute(con->request, "job-name", IPP_TAG_ZERO)) != NULL)
+ {
++ int bad_name = 0; /* Is the job-name value bad? */
++
+ if ((name->value_tag != IPP_TAG_NAME && name->value_tag != IPP_TAG_NAMELANG) ||
+- name->num_values != 1 || !ippValidateAttribute(name))
++ name->num_values != 1)
++ {
++ bad_name = 1;
++ }
++ else
++ {
++ /*
++ * Validate that job-name conforms to RFC 5198 (Network Unicode) and
++ * IPP Everywhere requirements for "name" values...
++ */
++
++ const unsigned char *nameptr; /* Pointer into "job-name" attribute */
++
++ for (nameptr = (unsigned char *)name->values[0].string.text;
++ *nameptr;
++ nameptr ++)
++ {
++ if (*nameptr < ' ' && *nameptr != '\t')
++ break;
++ else if (*nameptr == 0x7f)
++ break;
++ else if ((*nameptr & 0xe0) == 0xc0)
++ {
++ if ((nameptr[1] & 0xc0) != 0x80)
++ break;
++
++ nameptr ++;
++ }
++ else if ((*nameptr & 0xf0) == 0xe0)
++ {
++ if ((nameptr[1] & 0xc0) != 0x80 ||
++ (nameptr[2] & 0xc0) != 0x80)
++ break;
++
++ nameptr += 2;
++ }
++ else if ((*nameptr & 0xf8) == 0xf0)
++ {
++ if ((nameptr[1] & 0xc0) != 0x80 ||
++ (nameptr[2] & 0xc0) != 0x80 ||
++ (nameptr[3] & 0xc0) != 0x80)
++ break;
++
++ nameptr += 3;
++ }
++ else if (*nameptr & 0x80)
++ break;
++ }
++
++ if (*nameptr)
++ bad_name = 1;
++ }
++
++ if (bad_name)
+ {
+ if (StrictConformance)
+ {
+- send_ipp_status(con, IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES, _("Unsupported 'job-name' value."));
++ send_ipp_status(con, IPP_ATTRIBUTES,
++ _("Unsupported 'job-name' value."));
+ ippCopyAttribute(con->response, name, 0);
+ return;
+ }
+ else
+ {
+- cupsdLogMessage(CUPSD_LOG_WARN, "Unsupported 'job-name' value, deleting from request.");
++ cupsdLogMessage(CUPSD_LOG_WARN,
++ "Unsupported 'job-name' value, deleting from request.");
+ ippDeleteAttribute(con->request, name);
+ }
+ }
diff --git a/debian/patches/0037-Build-mantohtml-with-the-build-architecture-compiler.patch b/debian/patches/0038-Build-mantohtml-with-the-build-architecture-compiler.patch
index 154ac3080..3094b4315 100644
--- a/debian/patches/0037-Build-mantohtml-with-the-build-architecture-compiler.patch
+++ b/debian/patches/0038-Build-mantohtml-with-the-build-architecture-compiler.patch
@@ -1,4 +1,4 @@
-From 8d51e6299fe9112daa9af6c74ec3253bd5c31c40 Mon Sep 17 00:00:00 2001
+From ada44999435298a40cb5befa8c832ff23132d822 Mon Sep 17 00:00:00 2001
From: Helmut Grohne <helmut@subdivi.de>
Date: Tue, 9 Aug 2016 18:11:49 +0200
Subject: Build mantohtml with the build architecture compiler
diff --git a/debian/patches/0038-The-lp-and-lpr-commands-now-provide-better-error-mes.patch b/debian/patches/0039-The-lp-and-lpr-commands-now-provide-better-error-mes.patch
index 49e7ea898..d5aaff377 100644
--- a/debian/patches/0038-The-lp-and-lpr-commands-now-provide-better-error-mes.patch
+++ b/debian/patches/0039-The-lp-and-lpr-commands-now-provide-better-error-mes.patch
@@ -1,4 +1,4 @@
-From a3d48ac8af9dcbaee0383392941b8fef1e2a3a88 Mon Sep 17 00:00:00 2001
+From fcb76f462c47a59bcbe8167bf484360efcc655a9 Mon Sep 17 00:00:00 2001
From: Michael R Sweet <michaelrsweet@gmail.com>
Date: Wed, 1 Nov 2017 15:45:50 -0400
Subject: =?UTF-8?q?The=20`lp`=20and=20`lpr`=20commands=20now=20provide=20b?=
diff --git a/debian/patches/airprint-support.patch b/debian/patches/airprint-support.patch
index 74a6fbbde..615340567 100644
--- a/debian/patches/airprint-support.patch
+++ b/debian/patches/airprint-support.patch
@@ -1,4 +1,4 @@
-From 789f25839201a9d684445901a103970b8ec4680b Mon Sep 17 00:00:00 2001
+From baf8117daf415804f2fccae6233ad1e16c2cfd16 Mon Sep 17 00:00:00 2001
From: Till Kamppeter <till.kamppeter@gmail.com>
Date: Tue, 9 Aug 2016 18:11:29 +0200
Subject: Patch to support Apple AirPrint (printing from iPhone, iPad, iPod
diff --git a/debian/patches/confdirperms.patch b/debian/patches/confdirperms.patch
index 84f914a46..97d0ea945 100644
--- a/debian/patches/confdirperms.patch
+++ b/debian/patches/confdirperms.patch
@@ -1,4 +1,4 @@
-From 2a9f6516fd406ea2d40b2ccae8657cdfcbe8d2af Mon Sep 17 00:00:00 2001
+From 5a37dd3711ad82aaa1dcafcd04215859d54052d2 Mon Sep 17 00:00:00 2001
From: Martin Pitt <mpitt@debian.org>
Date: Tue, 9 Aug 2016 18:11:41 +0200
Subject: Do not mess with the permissions of cupsd.conf.
diff --git a/debian/patches/cups-deviced-allow-device-ids-with-newline.patch b/debian/patches/cups-deviced-allow-device-ids-with-newline.patch
index 879d37ae6..ecf713e8f 100644
--- a/debian/patches/cups-deviced-allow-device-ids-with-newline.patch
+++ b/debian/patches/cups-deviced-allow-device-ids-with-newline.patch
@@ -1,4 +1,4 @@
-From 4e8cee22bb9fcf4b447b8171fdfdfac717b437f6 Mon Sep 17 00:00:00 2001
+From 3d3dc0a730f0a8b4e05fc6fc22ad7810fea752e3 Mon Sep 17 00:00:00 2001
From: Till Kamppeter <till.kamppeter@gmail.com>
Date: Tue, 9 Aug 2016 18:11:28 +0200
Subject: Some printers have broken device IDs with newline
diff --git a/debian/patches/cups-set-default-error-policy-retry-job.patch b/debian/patches/cups-set-default-error-policy-retry-job.patch
index acb166677..f7da95d6e 100644
--- a/debian/patches/cups-set-default-error-policy-retry-job.patch
+++ b/debian/patches/cups-set-default-error-policy-retry-job.patch
@@ -1,4 +1,4 @@
-From 610938a64201e9b1115840973229e28b24472878 Mon Sep 17 00:00:00 2001
+From 0483b918940fd5f63975fbc6069e14276e31b19f Mon Sep 17 00:00:00 2001
From: Martin Pitt <martin.pitt@ubuntu.com>
Date: Tue, 9 Aug 2016 18:11:47 +0200
Subject: Set default job error policy to "retry-job", since it is less
diff --git a/debian/patches/cups-snmp-oids-device-id-hp-ricoh.patch b/debian/patches/cups-snmp-oids-device-id-hp-ricoh.patch
index ff11ff539..f0f6073ba 100644
--- a/debian/patches/cups-snmp-oids-device-id-hp-ricoh.patch
+++ b/debian/patches/cups-snmp-oids-device-id-hp-ricoh.patch
@@ -1,4 +1,4 @@
-From c8769eeaa3e188a11ed50e2aeea67d7109c9cfb3 Mon Sep 17 00:00:00 2001
+From 653baf017212efc60e7ac971c238881bd6bdcd42 Mon Sep 17 00:00:00 2001
From: Tim Waugh <twaugh@redhat.com>
Date: Tue, 9 Aug 2016 18:11:30 +0200
Subject: Let the "snmp" backend also use the manufacturer-specific
diff --git a/debian/patches/cupsd-set-default-for-SyncOnClose-to-Yes.patch b/debian/patches/cupsd-set-default-for-SyncOnClose-to-Yes.patch
index a1bf14741..78bab5336 100644
--- a/debian/patches/cupsd-set-default-for-SyncOnClose-to-Yes.patch
+++ b/debian/patches/cupsd-set-default-for-SyncOnClose-to-Yes.patch
@@ -1,4 +1,4 @@
-From cea4b49b631767e54c83ae7039591771fdc7baa3 Mon Sep 17 00:00:00 2001
+From 762841e50eafdd7e5083262308034ead54442aea Mon Sep 17 00:00:00 2001
From: Tim Waugh <twaugh@redhat.com>
Date: Tue, 9 Aug 2016 18:11:46 +0200
Subject: Set the default for SyncOnClose to Yes
diff --git a/debian/patches/debianize_cups-config.patch b/debian/patches/debianize_cups-config.patch
index c620e2d7c..01b453050 100644
--- a/debian/patches/debianize_cups-config.patch
+++ b/debian/patches/debianize_cups-config.patch
@@ -1,4 +1,4 @@
-From ca8a35f06a8b8042a2fc667a5af843b67a77db6b Mon Sep 17 00:00:00 2001
+From d178c738513206c0183ed808d08645b7ed16bde3 Mon Sep 17 00:00:00 2001
From: Didier Raboud <odyx@debian.org>
Date: Tue, 9 Aug 2016 18:11:49 +0200
Subject: Use dpkg-architecture in cups-config to make it
diff --git a/debian/patches/default_log_settings.patch b/debian/patches/default_log_settings.patch
index f37bd53d2..a51a7ccc6 100644
--- a/debian/patches/default_log_settings.patch
+++ b/debian/patches/default_log_settings.patch
@@ -1,4 +1,4 @@
-From 297d7ae79c162e1839b73e6308b3b2bae4252821 Mon Sep 17 00:00:00 2001
+From 97c108f0306b3e35bd704eec918e89e8f3c87de4 Mon Sep 17 00:00:00 2001
From: Didier Raboud <odyx@debian.org>
Date: Tue, 9 Aug 2016 18:11:40 +0200
Subject: Deactivate CUPS' own log rotating as the system already provides a
diff --git a/debian/patches/do-not-broadcast-with-hostnames.patch b/debian/patches/do-not-broadcast-with-hostnames.patch
index 1137d4f10..73630689d 100644
--- a/debian/patches/do-not-broadcast-with-hostnames.patch
+++ b/debian/patches/do-not-broadcast-with-hostnames.patch
@@ -1,4 +1,4 @@
-From 52dfbfd86e86170036cc1e90e536c1198eadb764 Mon Sep 17 00:00:00 2001
+From 1c9aacb0071bfd15a9b278e4339324345cf33b1b Mon Sep 17 00:00:00 2001
From: Till Kampetter <till.kampetter@gmail.com>
Date: Tue, 9 Aug 2016 18:11:35 +0200
Subject: Do not use host names for broadcasting print queues and
diff --git a/debian/patches/drop_unnecessary_dependencies.patch b/debian/patches/drop_unnecessary_dependencies.patch
index 932b47cdb..b341543e6 100644
--- a/debian/patches/drop_unnecessary_dependencies.patch
+++ b/debian/patches/drop_unnecessary_dependencies.patch
@@ -1,4 +1,4 @@
-From 878e5c809045f237d63b6eea671a93c07f6d9f6f Mon Sep 17 00:00:00 2001
+From 9b521dc8c038f6ab2752bc2007c8ab4b44323356 Mon Sep 17 00:00:00 2001
From: Martin Pitt <mpitt@debian.org>
Date: Tue, 9 Aug 2016 18:11:25 +0200
Subject: Do not link libcups.so and libcupsimage.so against
diff --git a/debian/patches/log-debug-history-nearly-unlimited.patch b/debian/patches/log-debug-history-nearly-unlimited.patch
index b504eef4a..5fca291e3 100644
--- a/debian/patches/log-debug-history-nearly-unlimited.patch
+++ b/debian/patches/log-debug-history-nearly-unlimited.patch
@@ -1,4 +1,4 @@
-From 6509f49045183998de4664abc00060db5cf741b1 Mon Sep 17 00:00:00 2001
+From b364d933443ef4dbda67fd3faf75641dc86e142a Mon Sep 17 00:00:00 2001
From: Till Kampetter <till.kampetter@gmail.com>
Date: Tue, 9 Aug 2016 18:11:45 +0200
Subject: Make log debug history nearly unlimited
diff --git a/debian/patches/logfiles_adm_readable.patch b/debian/patches/logfiles_adm_readable.patch
index 78bbf51b7..058e9dc2e 100644
--- a/debian/patches/logfiles_adm_readable.patch
+++ b/debian/patches/logfiles_adm_readable.patch
@@ -1,4 +1,4 @@
-From 937510a4f277944ddf57286ae31ff272ea1dc95d Mon Sep 17 00:00:00 2001
+From 3cfc3305864f324af844580c83a8a973e46c0d5f Mon Sep 17 00:00:00 2001
From: Martin Pitt <mpitt@debian.org>
Date: Tue, 9 Aug 2016 18:11:38 +0200
Subject: Make log files readable to group "adm", if present.
diff --git a/debian/patches/man-cups-lpd-drop-dangling-references.patch b/debian/patches/man-cups-lpd-drop-dangling-references.patch
index 7fc99af89..08773112b 100644
--- a/debian/patches/man-cups-lpd-drop-dangling-references.patch
+++ b/debian/patches/man-cups-lpd-drop-dangling-references.patch
@@ -1,4 +1,4 @@
-From d15f913b61d988b3689caa9740f96ad1e4fb6b78 Mon Sep 17 00:00:00 2001
+From 018290b8288a23d8ecf1d61c8a26aaf09b2f86d7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bastien=20ROUCARI=C3=88S?= <bastien.roucaries@u-cergy.fr>
Date: Tue, 9 Aug 2016 18:11:48 +0200
Subject: Drop dangling references from cups-lpd.man
diff --git a/debian/patches/manpage-translations.patch b/debian/patches/manpage-translations.patch
index 08a9ab6dd..e9a86c3ba 100644
--- a/debian/patches/manpage-translations.patch
+++ b/debian/patches/manpage-translations.patch
@@ -1,4 +1,4 @@
-From 355576a29ac7a47c8d1ed29d12fb9116bf5ad866 Mon Sep 17 00:00:00 2001
+From 145b38346c4db876915a426f2f921a75bdd4f966 Mon Sep 17 00:00:00 2001
From: Didier Raboud <odyx@debian.org>
Date: Tue, 9 Aug 2016 18:11:50 +0200
Subject: po4a infrastructure and translations for manpages.
diff --git a/debian/patches/move-cupsd-conf-default-to-share.patch b/debian/patches/move-cupsd-conf-default-to-share.patch
index 43673ef64..fffabc577 100644
--- a/debian/patches/move-cupsd-conf-default-to-share.patch
+++ b/debian/patches/move-cupsd-conf-default-to-share.patch
@@ -1,4 +1,4 @@
-From dc7aeddf1314c694af258d169276f92084926e23 Mon Sep 17 00:00:00 2001
+From 68de1d5dce843e71426eacad8500dc7da081cdb0 Mon Sep 17 00:00:00 2001
From: Didier Raboud <odyx@debian.org>
Date: Tue, 9 Aug 2016 18:11:24 +0200
Subject: Move cupsd.conf.default from SERVERROOT to DATADIR
diff --git a/debian/patches/no-conffile-timestamp.patch b/debian/patches/no-conffile-timestamp.patch
index d8e2d400c..44f1f350d 100644
--- a/debian/patches/no-conffile-timestamp.patch
+++ b/debian/patches/no-conffile-timestamp.patch
@@ -1,4 +1,4 @@
-From f8cf41573d8556f5f2c7428921780067e10fc846 Mon Sep 17 00:00:00 2001
+From bfae1b7b1ab669e863c400ccc7f265ea4bf3dc1c Mon Sep 17 00:00:00 2001
From: Joey Hess <joeyh@debian.org>
Date: Tue, 9 Aug 2016 18:11:31 +0200
Subject: Disable time stamps in conffiles, to avoid ever-changing files in
diff --git a/debian/patches/printer-filtering.patch b/debian/patches/printer-filtering.patch
index e57a7ad19..a80b3f0b3 100644
--- a/debian/patches/printer-filtering.patch
+++ b/debian/patches/printer-filtering.patch
@@ -1,4 +1,4 @@
-From 3bb47630b2ce0761a6ae125cedf800b4036d52be Mon Sep 17 00:00:00 2001
+From 7e9229575d043043d6ad34d0b16d8f56f879b844 Mon Sep 17 00:00:00 2001
From: Julien Desfossez at Revolution Linux
<Julien Desfossez at Revolution Linux>
Date: Tue, 9 Aug 2016 18:11:42 +0200
@@ -13,7 +13,7 @@ Patch-Name: printer-filtering.patch
1 file changed, 116 insertions(+)
diff --git a/cups/ipp.c b/cups/ipp.c
-index b33a3bc2e..225188c86 100644
+index a93e1e921..abb80b15a 100644
--- a/cups/ipp.c
+++ b/cups/ipp.c
@@ -2739,6 +2739,120 @@ ippNew(void)
diff --git a/debian/patches/reactivate_recommended_driver.patch b/debian/patches/reactivate_recommended_driver.patch
index b05ae62b4..6cbaa08f5 100644
--- a/debian/patches/reactivate_recommended_driver.patch
+++ b/debian/patches/reactivate_recommended_driver.patch
@@ -1,4 +1,4 @@
-From 3b0428da9309478386005b42750db126f2418cc9 Mon Sep 17 00:00:00 2001
+From b28d3b493025f9952fcc049bbebd45518c2238d8 Mon Sep 17 00:00:00 2001
From: Till Kampetter <till.kampetter@gmail.com>
Date: Tue, 9 Aug 2016 18:11:36 +0200
Subject: CUPS removes the "(recommended)" comments of the NickNames of
diff --git a/debian/patches/read-embedded-options-from-incoming-postscript-and-add-to-ipp-attrs.patch b/debian/patches/read-embedded-options-from-incoming-postscript-and-add-to-ipp-attrs.patch
index 3ecb4787a..8ea52b92d 100644
--- a/debian/patches/read-embedded-options-from-incoming-postscript-and-add-to-ipp-attrs.patch
+++ b/debian/patches/read-embedded-options-from-incoming-postscript-and-add-to-ipp-attrs.patch
@@ -1,4 +1,4 @@
-From c7fe39e4dddd60c968dcc01b2563efe345b3a006 Mon Sep 17 00:00:00 2001
+From 5082c6ec26696a170ce0587e4244b7bda3feb14a Mon Sep 17 00:00:00 2001
From: Till Kamppeter <till.kamppeter@gmail.com>
Date: Tue, 9 Aug 2016 18:11:27 +0200
Subject: Make CUPS reading all option settings in PostScript print
@@ -19,10 +19,10 @@ Patch-Name: read-embedded-options-from-incoming-postscript-and-add-to-ipp-attrs.
1 file changed, 84 insertions(+)
diff --git a/scheduler/ipp.c b/scheduler/ipp.c
-index d1c6a89fb..d1b9140d3 100644
+index d4e092d65..9ee8942b3 100644
--- a/scheduler/ipp.c
+++ b/scheduler/ipp.c
-@@ -8721,6 +8721,11 @@ read_job_ticket(cupsd_client_t *con) /* I - Client connection */
+@@ -8699,6 +8699,11 @@ read_job_ticket(cupsd_client_t *con) /* I - Client connection */
ipp_attribute_t *attr, /* Current attribute */
*attr2, /* Job attribute */
*prev2; /* Previous job attribute */
@@ -34,7 +34,7 @@ index d1c6a89fb..d1b9140d3 100644
/*
-@@ -8781,6 +8786,85 @@ read_job_ticket(cupsd_client_t *con) /* I - Client connection */
+@@ -8759,6 +8764,85 @@ read_job_ticket(cupsd_client_t *con) /* I - Client connection */
num_options = cupsParseOptions(line + 15, num_options, &options);
}
diff --git a/debian/patches/removecvstag.patch b/debian/patches/removecvstag.patch
index 48b7ba2e3..af99ab412 100644
--- a/debian/patches/removecvstag.patch
+++ b/debian/patches/removecvstag.patch
@@ -1,4 +1,4 @@
-From eb886361ce0897b66f79b8fd20c0049e6c91f997 Mon Sep 17 00:00:00 2001
+From 0ee69706132710d221891f13aaa8f369f6683691 Mon Sep 17 00:00:00 2001
From: Kenshi Muto <kmuto@debian.org>
Date: Tue, 9 Aug 2016 18:11:33 +0200
Subject: Do not write VCS tags into installed conffiles
diff --git a/debian/patches/rename-systemd-units.patch b/debian/patches/rename-systemd-units.patch
index 5da46e1ff..0e19fb3c9 100644
--- a/debian/patches/rename-systemd-units.patch
+++ b/debian/patches/rename-systemd-units.patch
@@ -1,4 +1,4 @@
-From 34b5cc4ed7315482fcc3c55fea5d815713d3b1e5 Mon Sep 17 00:00:00 2001
+From a0bd697237cc5a45fc91d50f9c9626bd62160504 Mon Sep 17 00:00:00 2001
From: Didier Raboud <odyx@debian.org>
Date: Tue, 9 Aug 2016 18:11:34 +0200
Subject: Rename the systemd service file from org.cups.cups.* to cups.*
diff --git a/debian/patches/series b/debian/patches/series
index 8f91b4288..be6da2c57 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -13,6 +13,7 @@ tests-fix-ppdLocalize-on-unclean-env.patch
tests-use-ipv4-lo-address.patch
tests-make-lpstat-call-reproducible.patch
tests-no-pdftourf.patch
+0016-Revert-Generalize-the-input-validation-of-some-kinds.patch
move-cupsd-conf-default-to-share.patch
drop_unnecessary_dependencies.patch
read-embedded-options-from-incoming-postscript-and-add-to-ipp-attrs.patch
@@ -34,6 +35,6 @@ cupsd-set-default-for-SyncOnClose-to-Yes.patch
cups-set-default-error-policy-retry-job.patch
man-cups-lpd-drop-dangling-references.patch
debianize_cups-config.patch
-0037-Build-mantohtml-with-the-build-architecture-compiler.patch
-0038-The-lp-and-lpr-commands-now-provide-better-error-mes.patch
+0038-Build-mantohtml-with-the-build-architecture-compiler.patch
+0039-The-lp-and-lpr-commands-now-provide-better-error-mes.patch
manpage-translations.patch
diff --git a/debian/patches/show-compile-command-lines.patch b/debian/patches/show-compile-command-lines.patch
index 46a7c09fa..4cae19d84 100644
--- a/debian/patches/show-compile-command-lines.patch
+++ b/debian/patches/show-compile-command-lines.patch
@@ -1,4 +1,4 @@
-From 47b1900584aa99bef8b123abcebc136021051518 Mon Sep 17 00:00:00 2001
+From 6d82eb7cd6af4178e1c2501e8ba90446644cc14e Mon Sep 17 00:00:00 2001
From: Till Kampetter <till.kampetter@gmail.com>
Date: Tue, 9 Aug 2016 18:11:43 +0200
Subject: Show compile command lines
diff --git a/scheduler/ipp.c b/scheduler/ipp.c
index d1b9140d3..9ee8942b3 100644
--- a/scheduler/ipp.c
+++ b/scheduler/ipp.c
@@ -5873,26 +5873,7 @@ create_subscriptions(
}
if (recipient)
- {
cupsdLogMessage(CUPSD_LOG_DEBUG, "recipient=\"%s\"", recipient);
-
-
- if (!strncmp(recipient, "mailto:", 7) && user_data)
- {
- char temp[64]; /* Temporary string */
-
- memcpy(temp, user_data->values[0].unknown.data, user_data->values[0].unknown.length);
- temp[user_data->values[0].unknown.length] = '\0';
-
- if (httpSeparateURI(HTTP_URI_CODING_ALL, temp, scheme, sizeof(scheme), userpass, sizeof(userpass), host, sizeof(host), &port, resource, sizeof(resource)) < HTTP_URI_OK)
- {
- send_ipp_status(con, IPP_NOT_POSSIBLE, _("Bad notify-user-data \"%s\"."), temp);
- ippAddInteger(con->response, IPP_TAG_SUBSCRIPTION, IPP_TAG_ENUM, "notify-status-code", IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES);
- return;
- }
- }
- }
-
if (pullmethod)
cupsdLogMessage(CUPSD_LOG_DEBUG, "pullmethod=\"%s\"", pullmethod);
cupsdLogMessage(CUPSD_LOG_DEBUG, "notify-lease-duration=%d", lease);
@@ -7988,16 +7969,13 @@ hold_job(cupsd_client_t *con, /* I - Client connection */
* Hold the job and return...
*/
- if ((attr = ippFindAttribute(con->request, "job-hold-until", IPP_TAG_ZERO)) != NULL)
- {
- if ((ippGetValueTag(attr) != IPP_TAG_KEYWORD && ippGetValueTag(attr) != IPP_TAG_NAME && ippGetValueTag(attr) != IPP_TAG_NAMELANG) || ippGetCount(attr) != 1 || !ippValidateAttribute(attr))
- {
- send_ipp_status(con, IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES, _("Unsupported 'job-hold-until' value."));
- ippCopyAttribute(con->response, attr, 0);
- return;
- }
+ if ((attr = ippFindAttribute(con->request, "job-hold-until",
+ IPP_TAG_KEYWORD)) == NULL)
+ attr = ippFindAttribute(con->request, "job-hold-until", IPP_TAG_NAME);
- when = ippGetString(attr, 0, NULL);
+ if (attr)
+ {
+ when = attr->values[0].string.text;
cupsdAddEvent(CUPSD_EVENT_JOB_CONFIG_CHANGED, cupsdFindDest(job->dest), job,
"Job job-hold-until value changed by user.");
@@ -10445,39 +10423,7 @@ set_job_attrs(cupsd_client_t *con, /* I - Client connection */
continue;
}
- if (!ippValidateAttribute(attr))
- {
- send_ipp_status(con, IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES, _("Bad '%s' value."), attr->name);
- ippCopyAttribute(con->response, attr, 0);
- return;
- }
-
- if (!strcmp(attr->name, "job-hold-until"))
- {
- const char *when = ippGetString(attr, 0, NULL);
- /* job-hold-until value */
-
- if ((ippGetValueTag(attr) != IPP_TAG_KEYWORD && ippGetValueTag(attr) != IPP_TAG_NAME && ippGetValueTag(attr) != IPP_TAG_NAMELANG) || ippGetCount(attr) != 1)
- {
- send_ipp_status(con, IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES, _("Unsupported 'job-hold-until' value."));
- ippCopyAttribute(con->response, attr, 0);
- return;
- }
-
- cupsdLogJob(job, CUPSD_LOG_DEBUG, "Setting job-hold-until to %s", when);
- cupsdSetJobHoldUntil(job, when, 0);
-
- if (!strcmp(when, "no-hold"))
- {
- cupsdReleaseJob(job);
- check_jobs = 1;
- }
- else
- cupsdSetJobState(job, IPP_JOB_HELD, CUPSD_JOB_DEFAULT, "Job held by \"%s\".", username);
-
- event |= CUPSD_EVENT_JOB_CONFIG_CHANGED | CUPSD_EVENT_JOB_STATE;
- }
- else if (!strcmp(attr->name, "job-priority"))
+ if (!strcmp(attr->name, "job-priority"))
{
/*
* Change the job priority...
@@ -10597,6 +10543,28 @@ set_job_attrs(cupsd_client_t *con, /* I - Client connection */
*/
ippCopyAttribute(job->attrs, attr, 0);
+
+ /*
+ * See if the job-name or job-hold-until is being changed.
+ */
+
+ if (!strcmp(attr->name, "job-hold-until"))
+ {
+ cupsdLogJob(job, CUPSD_LOG_DEBUG, "Setting job-hold-until to %s",
+ attr->values[0].string.text);
+ cupsdSetJobHoldUntil(job, attr->values[0].string.text, 0);
+
+ if (!strcmp(attr->values[0].string.text, "no-hold"))
+ {
+ cupsdReleaseJob(job);
+ check_jobs = 1;
+ }
+ else
+ cupsdSetJobState(job, IPP_JOB_HELD, CUPSD_JOB_DEFAULT,
+ "Job held by \"%s\".", username);
+
+ event |= CUPSD_EVENT_JOB_CONFIG_CHANGED | CUPSD_EVENT_JOB_STATE;
+ }
}
else if (attr->value_tag == IPP_TAG_DELETEATTR)
{
@@ -11415,34 +11383,80 @@ validate_job(cupsd_client_t *con, /* I - Client connection */
}
/*
- * Is the job-hold-until value valid?
- */
-
- if ((attr = ippFindAttribute(con->request, "job-hold-until", IPP_TAG_ZERO)) != NULL && ((ippGetValueTag(attr) != IPP_TAG_KEYWORD && ippGetValueTag(attr) != IPP_TAG_NAME && ippGetValueTag(attr) != IPP_TAG_NAMELANG) || ippGetCount(attr) != 1 || !ippValidateAttribute(attr)))
- {
- send_ipp_status(con, IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES, _("Unsupported 'job-hold-until' value."));
- ippCopyAttribute(con->response, attr, 0);
- return;
- }
-
- /*
* Is the job-name valid?
*/
if ((name = ippFindAttribute(con->request, "job-name", IPP_TAG_ZERO)) != NULL)
{
+ int bad_name = 0; /* Is the job-name value bad? */
+
if ((name->value_tag != IPP_TAG_NAME && name->value_tag != IPP_TAG_NAMELANG) ||
- name->num_values != 1 || !ippValidateAttribute(name))
+ name->num_values != 1)
+ {
+ bad_name = 1;
+ }
+ else
+ {
+ /*
+ * Validate that job-name conforms to RFC 5198 (Network Unicode) and
+ * IPP Everywhere requirements for "name" values...
+ */
+
+ const unsigned char *nameptr; /* Pointer into "job-name" attribute */
+
+ for (nameptr = (unsigned char *)name->values[0].string.text;
+ *nameptr;
+ nameptr ++)
+ {
+ if (*nameptr < ' ' && *nameptr != '\t')
+ break;
+ else if (*nameptr == 0x7f)
+ break;
+ else if ((*nameptr & 0xe0) == 0xc0)
+ {
+ if ((nameptr[1] & 0xc0) != 0x80)
+ break;
+
+ nameptr ++;
+ }
+ else if ((*nameptr & 0xf0) == 0xe0)
+ {
+ if ((nameptr[1] & 0xc0) != 0x80 ||
+ (nameptr[2] & 0xc0) != 0x80)
+ break;
+
+ nameptr += 2;
+ }
+ else if ((*nameptr & 0xf8) == 0xf0)
+ {
+ if ((nameptr[1] & 0xc0) != 0x80 ||
+ (nameptr[2] & 0xc0) != 0x80 ||
+ (nameptr[3] & 0xc0) != 0x80)
+ break;
+
+ nameptr += 3;
+ }
+ else if (*nameptr & 0x80)
+ break;
+ }
+
+ if (*nameptr)
+ bad_name = 1;
+ }
+
+ if (bad_name)
{
if (StrictConformance)
{
- send_ipp_status(con, IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES, _("Unsupported 'job-name' value."));
+ send_ipp_status(con, IPP_ATTRIBUTES,
+ _("Unsupported 'job-name' value."));
ippCopyAttribute(con->response, name, 0);
return;
}
else
{
- cupsdLogMessage(CUPSD_LOG_WARN, "Unsupported 'job-name' value, deleting from request.");
+ cupsdLogMessage(CUPSD_LOG_WARN,
+ "Unsupported 'job-name' value, deleting from request.");
ippDeleteAttribute(con->request, name);
}
}