summaryrefslogtreecommitdiffstats
path: root/patches/source/cups/str4609-1.3.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/source/cups/str4609-1.3.patch')
-rw-r--r--patches/source/cups/str4609-1.3.patch324
1 files changed, 324 insertions, 0 deletions
diff --git a/patches/source/cups/str4609-1.3.patch b/patches/source/cups/str4609-1.3.patch
new file mode 100644
index 000000000..da4664a08
--- /dev/null
+++ b/patches/source/cups/str4609-1.3.patch
@@ -0,0 +1,324 @@
+Index: cgi-bin/ipp-var.c
+===================================================================
+--- cgi-bin/ipp-var.c (revision 12588)
++++ cgi-bin/ipp-var.c (working copy)
+@@ -1048,21 +1048,7 @@
+ * Rewrite URIs...
+ */
+
+- if (!strcmp(name, "member_uris"))
+- {
+- char url[1024]; /* URL for class member... */
+-
+-
+- cgiRewriteURL(attr->values[i].string.text, url,
+- sizeof(url), NULL);
+-
+- snprintf(valptr, sizeof(value) - (valptr - value),
+- "<A HREF=\"%s\">%s</A>", url,
+- strrchr(attr->values[i].string.text, '/') + 1);
+- }
+- else
+- cgiRewriteURL(attr->values[i].string.text, valptr,
+- sizeof(value) - (valptr - value), NULL);
++ cgiRewriteURL(attr->values[i].string.text, valptr, sizeof(value) - (valptr - value), NULL);
+ break;
+ }
+
+Index: cgi-bin/template.c
+===================================================================
+--- cgi-bin/template.c (revision 12588)
++++ cgi-bin/template.c (working copy)
+@@ -602,39 +602,7 @@
+ while (*s)
+ {
+ if (*s == '<')
+- {
+- /*
+- * Pass <A HREF="url"> and </A>, otherwise quote it...
+- */
+-
+- if (!strncasecmp(s, "<A HREF=\"", 9))
+- {
+- fputs("<A HREF=\"", out);
+- s += 9;
+-
+- while (*s && *s != '\"')
+- {
+- if (*s == '&')
+- fputs("&amp;", out);
+- else
+- putc(*s, out);
+-
+- s ++;
+- }
+-
+- if (*s)
+- s ++;
+-
+- fputs("\">", out);
+- }
+- else if (!strncasecmp(s, "</A>", 4))
+- {
+- fputs("</A>", out);
+- s += 3;
+- }
+- else
+- fputs("&lt;", out);
+- }
++ fputs("&lt;", out);
+ else if (*s == '>')
+ fputs("&gt;", out);
+ else if (*s == '\"')
+Index: scheduler/ipp.c
+===================================================================
+--- scheduler/ipp.c (revision 12588)
++++ scheduler/ipp.c (working copy)
+@@ -463,8 +463,8 @@
+ * Remote unauthenticated user masquerading as local root...
+ */
+
+- _cupsStrFree(username->values[0].string.text);
+- username->values[0].string.text = _cupsStrAlloc(RemoteRoot);
++ _cupsStrFree(username->values[0].string.text);
++ username->values[0].string.text = _cupsStrAlloc(RemoteRoot);
+ }
+ }
+
+@@ -1517,7 +1517,10 @@
+ cupsdSetString(&job->username, con->username);
+
+ if (attr)
+- cupsdSetString(&attr->values[0].string.text, con->username);
++ {
++ _cupsStrFree(attr->values[0].string.text);
++ attr->values[0].string.text = _cupsStrAlloc(con->username);
++ }
+ }
+ else if (attr)
+ {
+@@ -1568,48 +1571,11 @@
+ * Also, we can only have 1 value and it must be a name value.
+ */
+
+- switch (attr->value_tag)
+- {
+- case IPP_TAG_STRING :
+- case IPP_TAG_TEXTLANG :
+- case IPP_TAG_NAMELANG :
+- case IPP_TAG_TEXT :
+- case IPP_TAG_NAME :
+- case IPP_TAG_KEYWORD :
+- case IPP_TAG_URI :
+- case IPP_TAG_URISCHEME :
+- case IPP_TAG_CHARSET :
+- case IPP_TAG_LANGUAGE :
+- case IPP_TAG_MIMETYPE :
+- /*
+- * Free old strings...
+- */
+-
+- for (i = 0; i < attr->num_values; i ++)
+- {
+- _cupsStrFree(attr->values[i].string.text);
+- attr->values[i].string.text = NULL;
+- if (attr->values[i].string.charset)
+- {
+- _cupsStrFree(attr->values[i].string.charset);
+- attr->values[i].string.charset = NULL;
+- }
+- }
+-
+- default :
+- break;
+- }
+-
+- /*
+- * Use the default connection hostname instead...
+- */
+-
+- attr->value_tag = IPP_TAG_NAME;
+- attr->num_values = 1;
+- attr->values[0].string.text = _cupsStrAlloc(con->http.hostname);
++ ippDeleteAttribute(job->attrs, attr);
++ ippAddString(job->attrs, IPP_TAG_JOB, IPP_TAG_NAME, "job-originating-host-name", NULL, con->http.hostname);
+ }
+-
+- attr->group_tag = IPP_TAG_JOB;
++ else
++ attr->group_tag = IPP_TAG_JOB;
+ }
+ else
+ {
+@@ -1731,7 +1697,8 @@
+ * Force the leading banner to have the classification on it...
+ */
+
+- cupsdSetString(&attr->values[0].string.text, Classification);
++ _cupsStrFree(attr->values[0].string.text);
++ attr->values[0].string.text = _cupsStrAlloc(Classification);
+
+ cupsdLogMessage(CUPSD_LOG_NOTICE, "[Job %d] CLASSIFICATION FORCED "
+ "job-sheets=\"%s,none\", "
+@@ -1748,7 +1715,8 @@
+ * Can't put two different security markings on the same document!
+ */
+
+- cupsdSetString(&attr->values[1].string.text, attr->values[0].string.text);
++ _cupsStrFree(attr->values[1].string.text);
++ attr->values[1].string.text = _cupsStrAlloc(attr->values[0].string.text);
+
+ cupsdLogMessage(CUPSD_LOG_NOTICE, "[Job %d] CLASSIFICATION FORCED "
+ "job-sheets=\"%s,%s\", "
+@@ -1788,18 +1756,26 @@
+ if (attr->num_values > 1 &&
+ !strcmp(attr->values[0].string.text, attr->values[1].string.text))
+ {
+- cupsdSetString(&(attr->values[0].string.text), Classification);
+- cupsdSetString(&(attr->values[1].string.text), Classification);
++ _cupsStrFree(attr->values[0].string.text);
++ attr->values[0].string.text = _cupsStrAlloc(Classification);
++ _cupsStrFree(attr->values[1].string.text);
++ attr->values[1].string.text = _cupsStrAlloc(Classification);
+ }
+ else
+ {
+ if (attr->num_values == 1 ||
+ strcmp(attr->values[0].string.text, "none"))
+- cupsdSetString(&(attr->values[0].string.text), Classification);
++ {
++ _cupsStrFree(attr->values[0].string.text);
++ attr->values[0].string.text = _cupsStrAlloc(Classification);
++ }
+
+ if (attr->num_values > 1 &&
+ strcmp(attr->values[1].string.text, "none"))
+- cupsdSetString(&(attr->values[1].string.text), Classification);
++ {
++ _cupsStrFree(attr->values[1].string.text);
++ attr->values[1].string.text = _cupsStrAlloc(Classification);
++ }
+ }
+
+ if (attr->num_values > 1)
+@@ -3088,7 +3064,8 @@
+ if (attr)
+ {
+ attr->value_tag = IPP_TAG_KEYWORD;
+- cupsdSetString(&(attr->values[0].string.text), "no-hold");
++ _cupsStrFree(attr->values[0].string.text);
++ attr->values[0].string.text = _cupsStrAlloc("no-hold");
+ }
+
+ /*
+@@ -7665,7 +7642,6 @@
+ if (format)
+ {
+ _cupsStrFree(format->values[0].string.text);
+-
+ format->values[0].string.text = _cupsStrAlloc(mimetype);
+ }
+ else
+@@ -8137,9 +8113,8 @@
+
+ if (attr)
+ {
++ attr->value_tag = IPP_TAG_KEYWORD;
+ _cupsStrFree(attr->values[0].string.text);
+-
+- attr->value_tag = IPP_TAG_KEYWORD;
+ attr->values[0].string.text = _cupsStrAlloc("no-hold");
+
+ cupsdAddEvent(CUPSD_EVENT_JOB_CONFIG_CHANGED, job->printer, job,
+@@ -8894,7 +8869,6 @@
+ if (jformat)
+ {
+ _cupsStrFree(jformat->values[0].string.text);
+-
+ jformat->values[0].string.text = _cupsStrAlloc(mimetype);
+ }
+ else
+Index: scheduler/job.c
+===================================================================
+--- scheduler/job.c (revision 12588)
++++ scheduler/job.c (working copy)
+@@ -393,7 +393,8 @@
+ if (attr)
+ {
+ attr->value_tag = IPP_TAG_KEYWORD;
+- cupsdSetString(&(attr->values[0].string.text), "no-hold");
++ _cupsStrFree(attr->values[0].string.text);
++ attr->values[0].string.text = _cupsStrAlloc("no-hold");
+ cupsdSaveJob(job);
+ }
+ }
+@@ -457,7 +458,10 @@
+
+ if ((attr = ippFindAttribute(job->attrs, "job-actual-printer-uri",
+ IPP_TAG_URI)) != NULL)
+- cupsdSetString(&attr->values[0].string.text, printer->uri);
++ {
++ _cupsStrFree(attr->values[0].string.text);
++ attr->values[0].string.text = _cupsStrAlloc(printer->uri);
++ }
+ else
+ ippAddString(job->attrs, IPP_TAG_JOB, IPP_TAG_URI,
+ "job-actual-printer-uri", NULL, printer->uri);
+@@ -468,7 +472,7 @@
+ ((printer->type & CUPS_PRINTER_DISCOVERED) && /* Printer is remote */
+ !printer->job)) /* and not printing */
+ {
+- /*
++ /*
+ * Clear any message and reasons for the queue...
+ */
+
+@@ -761,8 +765,8 @@
+ if (attr)
+ {
+ attr->value_tag = IPP_TAG_KEYWORD;
+- cupsdSetString(&(attr->values[0].string.text),
+- "auth-info-required");
++ _cupsStrFree(attr->values[0].string.text);
++ attr->values[0].string.text = _cupsStrAlloc("auth-info-required");
+ }
+
+ job->state->values[0].integer = IPP_JOB_HELD;
+@@ -1350,7 +1354,10 @@
+
+ if ((attr = ippFindAttribute(job->attrs, "job-printer-uri",
+ IPP_TAG_URI)) != NULL)
+- cupsdSetString(&(attr->values[0].string.text), p->uri);
++ {
++ _cupsStrFree(attr->values[0].string.text);
++ attr->values[0].string.text = _cupsStrAlloc(p->uri);
++ }
+
+ cupsdAddEvent(CUPSD_EVENT_JOB_STOPPED, p, job,
+ "Job #%d moved from %s to %s.", job->id, olddest,
+@@ -2425,7 +2432,10 @@
+ ippAddString(job->attrs, IPP_TAG_JOB, IPP_TAG_KEYWORD, "job-hold-until",
+ NULL, holdstr);
+ else
+- cupsdSetString(&attr->values[0].string.text, holdstr);
++ {
++ _cupsStrFree(attr->values[0].string.text);
++ attr->values[0].string.text = _cupsStrAlloc(holdstr);
++ }
+
+ cupsdSaveJob(job);
+ }
+@@ -3880,9 +3890,10 @@
+ */
+
+ if (job->printer->state_message[0])
+- cupsdSetString(&(job->printer_message->values[0].string.text),
+- job->printer->state_message);
+-
++ {
++ _cupsStrFree(job->printer_message->values[0].string.text);
++ job->printer_message->values[0].string.text = _cupsStrAlloc(job->printer->state_message);
++ }
+ /*
+ * ... and the printer-state-reasons value...
+ */