1 diff -up cups-1.7.5/cgi-bin/ipp-var.c.str4609 cups-1.7.5/cgi-bin/ipp-var.c
2 --- cups-1.7.5/cgi-bin/ipp-var.c.str4609 2014-05-22 15:59:21.000000000 +0200
3 +++ cups-1.7.5/cgi-bin/ipp-var.c 2015-06-10 10:31:45.297965345 +0200
4 @@ -1206,21 +1206,7 @@ cgiSetIPPObjectVars(
8 - if (!strcmp(name, "member_uris"))
10 - char url[1024]; /* URL for class member... */
13 - cgiRewriteURL(attr->values[i].string.text, url,
16 - snprintf(valptr, sizeof(value) - (valptr - value),
17 - "<A HREF=\"%s\">%s</A>", url,
18 - strrchr(attr->values[i].string.text, '/') + 1);
21 - cgiRewriteURL(attr->values[i].string.text, valptr,
22 - sizeof(value) - (valptr - value), NULL);
23 + cgiRewriteURL(attr->values[i].string.text, valptr, sizeof(value) - (valptr - value), NULL);
27 diff -up cups-1.7.5/cgi-bin/template.c.str4609 cups-1.7.5/cgi-bin/template.c
28 --- cups-1.7.5/cgi-bin/template.c.str4609 2014-03-05 22:11:32.000000000 +0100
29 +++ cups-1.7.5/cgi-bin/template.c 2015-06-10 10:31:45.297965345 +0200
30 @@ -659,39 +659,7 @@ cgi_puts(const char *s, /* I - String
36 - * Pass <A HREF="url"> and </A>, otherwise quote it...
39 - if (!_cups_strncasecmp(s, "<A HREF=\"", 9))
41 - fputs("<A HREF=\"", out);
44 - while (*s && *s != '\"')
47 - fputs("&", out);
59 - else if (!_cups_strncasecmp(s, "</A>", 4))
71 diff -up cups-1.7.5/scheduler/client.c.str4609 cups-1.7.5/scheduler/client.c
72 --- cups-1.7.5/scheduler/client.c.str4609 2015-06-10 10:31:45.280965399 +0200
73 +++ cups-1.7.5/scheduler/client.c 2015-06-10 10:31:45.300965335 +0200
74 @@ -598,7 +598,12 @@ cupsdCloseClient(cupsd_client_t *con) /*
75 httpClearCookie(HTTP(con));
76 httpClearFields(HTTP(con));
78 - cupsdClearString(&con->filename);
81 + unlink(con->filename);
82 + cupsdClearString(&con->filename);
85 cupsdClearString(&con->command);
86 cupsdClearString(&con->options);
87 cupsdClearString(&con->query_string);
88 diff -up cups-1.7.5/scheduler/env.c.str4609 cups-1.7.5/scheduler/env.c
89 --- cups-1.7.5/scheduler/env.c.str4609 2015-06-10 10:31:45.208965629 +0200
90 +++ cups-1.7.5/scheduler/env.c 2015-06-10 10:31:45.300965335 +0200
91 @@ -131,6 +131,13 @@ cupsdSetEnv(const char *name, /* I - Na
95 + * Do not allow dynamic linker variables when running as root...
98 + if (!RunUser && (!strncmp(name, "DYLD_", 5) || !strncmp(name, "LD_", 3)))
102 * See if this variable has already been defined...
105 diff -up cups-1.7.5/scheduler/ipp.c.str4609 cups-1.7.5/scheduler/ipp.c
106 --- cups-1.7.5/scheduler/ipp.c.str4609 2015-06-10 10:31:45.287965377 +0200
107 +++ cups-1.7.5/scheduler/ipp.c 2015-06-10 10:31:45.299965339 +0200
108 @@ -412,8 +412,7 @@ cupsdProcessIPPRequest(
109 * Remote unauthenticated user masquerading as local root...
112 - _cupsStrFree(username->values[0].string.text);
113 - username->values[0].string.text = _cupsStrAlloc(RemoteRoot);
114 + ippSetString(con->request, &username, 0, RemoteRoot);
118 @@ -1576,7 +1575,7 @@ add_job(cupsd_client_t *con, /* I - Cl
119 cupsdSetString(&job->username, con->username);
122 - cupsdSetString(&attr->values[0].string.text, con->username);
123 + ippSetString(job->attrs, &attr, 0, con->username);
127 @@ -1594,9 +1593,8 @@ add_job(cupsd_client_t *con, /* I - Cl
128 "job-originating-user-name", NULL, job->username);
131 - attr->group_tag = IPP_TAG_JOB;
132 - _cupsStrFree(attr->name);
133 - attr->name = _cupsStrAlloc("job-originating-user-name");
134 + ippSetGroupTag(job->attrs, &attr, IPP_TAG_JOB);
135 + ippSetName(job->attrs, &attr, "job-originating-user-name");
138 if (con->username[0] || auth_info)
139 @@ -1630,48 +1628,11 @@ add_job(cupsd_client_t *con, /* I - Cl
140 * Also, we can only have 1 value and it must be a name value.
143 - switch (attr->value_tag)
145 - case IPP_TAG_STRING :
146 - case IPP_TAG_TEXTLANG :
147 - case IPP_TAG_NAMELANG :
148 - case IPP_TAG_TEXT :
149 - case IPP_TAG_NAME :
150 - case IPP_TAG_KEYWORD :
152 - case IPP_TAG_URISCHEME :
153 - case IPP_TAG_CHARSET :
154 - case IPP_TAG_LANGUAGE :
155 - case IPP_TAG_MIMETYPE :
157 - * Free old strings...
160 - for (i = 0; i < attr->num_values; i ++)
162 - _cupsStrFree(attr->values[i].string.text);
163 - attr->values[i].string.text = NULL;
164 - if (attr->values[i].string.language)
166 - _cupsStrFree(attr->values[i].string.language);
167 - attr->values[i].string.language = NULL;
176 - * Use the default connection hostname instead...
179 - attr->value_tag = IPP_TAG_NAME;
180 - attr->num_values = 1;
181 - attr->values[0].string.text = _cupsStrAlloc(con->http.hostname);
182 + ippDeleteAttribute(job->attrs, attr);
183 + ippAddString(job->attrs, IPP_TAG_JOB, IPP_TAG_NAME, "job-originating-host-name", NULL, con->http.hostname);
186 - attr->group_tag = IPP_TAG_JOB;
188 + ippSetGroupTag(job->attrs, &attr, IPP_TAG_JOB);
192 @@ -1767,8 +1728,8 @@ add_job(cupsd_client_t *con, /* I - Cl
194 attr = ippAddStrings(job->attrs, IPP_TAG_JOB, IPP_TAG_NAME, "job-sheets",
196 - attr->values[0].string.text = _cupsStrRetain(printer->job_sheets[0]);
197 - attr->values[1].string.text = _cupsStrRetain(printer->job_sheets[1]);
198 + ippSetString(job->attrs, &attr, 0, printer->job_sheets[0]);
199 + ippSetString(job->attrs, &attr, 1, printer->job_sheets[1]);
202 job->job_sheets = attr;
203 @@ -1794,7 +1755,7 @@ add_job(cupsd_client_t *con, /* I - Cl
204 * Force the leading banner to have the classification on it...
207 - cupsdSetString(&attr->values[0].string.text, Classification);
208 + ippSetString(job->attrs, &attr, 0, Classification);
210 cupsdLogJob(job, CUPSD_LOG_NOTICE, "CLASSIFICATION FORCED "
211 "job-sheets=\"%s,none\", "
212 @@ -1811,7 +1772,7 @@ add_job(cupsd_client_t *con, /* I - Cl
213 * Can't put two different security markings on the same document!
216 - cupsdSetString(&attr->values[1].string.text, attr->values[0].string.text);
217 + ippSetString(job->attrs, &attr, 1, attr->values[0].string.text);
219 cupsdLogJob(job, CUPSD_LOG_NOTICE, "CLASSIFICATION FORCED "
220 "job-sheets=\"%s,%s\", "
221 @@ -1851,18 +1812,18 @@ add_job(cupsd_client_t *con, /* I - Cl
222 if (attr->num_values > 1 &&
223 !strcmp(attr->values[0].string.text, attr->values[1].string.text))
225 - cupsdSetString(&(attr->values[0].string.text), Classification);
226 - cupsdSetString(&(attr->values[1].string.text), Classification);
227 + ippSetString(job->attrs, &attr, 0, Classification);
228 + ippSetString(job->attrs, &attr, 1, Classification);
232 if (attr->num_values == 1 ||
233 strcmp(attr->values[0].string.text, "none"))
234 - cupsdSetString(&(attr->values[0].string.text), Classification);
235 + ippSetString(job->attrs, &attr, 0, Classification);
237 if (attr->num_values > 1 &&
238 strcmp(attr->values[1].string.text, "none"))
239 - cupsdSetString(&(attr->values[1].string.text), Classification);
240 + ippSetString(job->attrs, &attr, 1, Classification);
243 if (attr->num_values > 1)
244 @@ -3098,8 +3059,8 @@ authenticate_job(cupsd_client_t *con, /
248 - attr->value_tag = IPP_TAG_KEYWORD;
249 - cupsdSetString(&(attr->values[0].string.text), "no-hold");
250 + ippSetValueTag(job->attrs, &attr, IPP_TAG_KEYWORD);
251 + ippSetString(job->attrs, &attr, 0, "no-hold");
255 @@ -8224,11 +8185,7 @@ print_job(cupsd_client_t *con, /* I -
260 - _cupsStrFree(format->values[0].string.text);
262 - format->values[0].string.text = _cupsStrAlloc(mimetype);
264 + ippSetString(con->request, &format, 0, mimetype);
266 ippAddString(con->request, IPP_TAG_JOB, IPP_TAG_MIMETYPE,
267 "document-format", NULL, mimetype);
268 @@ -8765,10 +8722,8 @@ release_job(cupsd_client_t *con, /* I -
272 - _cupsStrFree(attr->values[0].string.text);
274 - attr->value_tag = IPP_TAG_KEYWORD;
275 - attr->values[0].string.text = _cupsStrAlloc("no-hold");
276 + ippSetValueTag(job->attrs, &attr, IPP_TAG_KEYWORD);
277 + ippSetString(job->attrs, &attr, 0, "no-hold");
279 cupsdAddEvent(CUPSD_EVENT_JOB_CONFIG_CHANGED, cupsdFindDest(job->dest), job,
280 "Job job-hold-until value changed by user.");
281 @@ -9461,11 +9416,7 @@ send_document(cupsd_client_t *con, /* I
283 if ((jformat = ippFindAttribute(job->attrs, "document-format",
284 IPP_TAG_MIMETYPE)) != NULL)
286 - _cupsStrFree(jformat->values[0].string.text);
288 - jformat->values[0].string.text = _cupsStrAlloc(mimetype);
290 + ippSetString(job->attrs, &jformat, 0, mimetype);
292 ippAddString(job->attrs, IPP_TAG_JOB, IPP_TAG_MIMETYPE,
293 "document-format", NULL, mimetype);
294 diff -up cups-1.7.5/scheduler/job.c.str4609 cups-1.7.5/scheduler/job.c
295 --- cups-1.7.5/scheduler/job.c.str4609 2015-06-10 10:31:45.288965374 +0200
296 +++ cups-1.7.5/scheduler/job.c 2015-06-10 10:31:45.299965339 +0200
297 @@ -375,7 +375,7 @@ cupsdCheckJobs(void)
299 if ((attr = ippFindAttribute(job->attrs, "job-actual-printer-uri",
300 IPP_TAG_URI)) != NULL)
301 - cupsdSetString(&attr->values[0].string.text, printer->uri);
302 + ippSetString(job->attrs, &attr, 0, printer->uri);
304 ippAddString(job->attrs, IPP_TAG_JOB, IPP_TAG_URI,
305 "job-actual-printer-uri", NULL, printer->uri);
306 @@ -2109,7 +2109,7 @@ cupsdMoveJob(cupsd_job_t *job, /* I
308 if ((attr = ippFindAttribute(job->attrs, "job-printer-uri",
309 IPP_TAG_URI)) != NULL)
310 - cupsdSetString(&(attr->values[0].string.text), p->uri);
311 + ippSetString(job->attrs, &attr, 0, p->uri);
313 cupsdAddEvent(CUPSD_EVENT_JOB_STOPPED, p, job,
314 "Job #%d moved from %s to %s.", job->id, olddest,
315 @@ -2306,7 +2306,7 @@ cupsdSetJobHoldUntil(cupsd_job_t *job, /
316 attr = ippFindAttribute(job->attrs, "job-hold-until", IPP_TAG_NAME);
319 - cupsdSetString(&(attr->values[0].string.text), when);
320 + ippSetString(job->attrs, &attr, 0, when);
322 attr = ippAddString(job->attrs, IPP_TAG_JOB, IPP_TAG_KEYWORD,
323 "job-hold-until", NULL, when);
324 @@ -2560,8 +2560,8 @@ cupsdSetJobState(
328 - attr->value_tag = IPP_TAG_KEYWORD;
329 - cupsdSetString(&(attr->values[0].string.text), "no-hold");
330 + ippSetValueTag(job->attrs, &attr, IPP_TAG_KEYWORD);
331 + ippSetString(job->attrs, &attr, 0, "no-hold");
335 @@ -4598,7 +4598,7 @@ start_job(cupsd_job_t *job, /* I -
336 "job-printer-state-message",
338 if (job->printer_message)
339 - cupsdSetString(&(job->printer_message->values[0].string.text), "");
340 + ippSetString(job->attrs, &job->printer_message, 0, "");
342 ippSetString(job->attrs, &job->reasons, 0, "job-printing");
343 cupsdSetJobState(job, IPP_JOB_PROCESSING, CUPSD_JOB_DEFAULT, NULL);
344 @@ -5216,15 +5216,14 @@ update_job_attrs(cupsd_job_t *job, /* I
345 if (job->state_value != IPP_JOB_PROCESSING &&
346 job->status_level == CUPSD_LOG_INFO)
348 - cupsdSetString(&(job->printer_message->values[0].string.text), "");
349 + ippSetString(job->attrs, &job->printer_message, 0, "");
352 cupsdMarkDirty(CUPSD_DIRTY_JOBS);
354 else if (job->printer->state_message[0] && do_message)
356 - cupsdSetString(&(job->printer_message->values[0].string.text),
357 - job->printer->state_message);
358 + ippSetString(job->attrs, &job->printer_message, 0, job->printer->state_message);
361 cupsdMarkDirty(CUPSD_DIRTY_JOBS);
362 diff -up cups-1.7.5/scheduler/main.c.str4609 cups-1.7.5/scheduler/main.c
363 --- cups-1.7.5/scheduler/main.c.str4609 2015-06-10 10:31:45.265965447 +0200
364 +++ cups-1.7.5/scheduler/main.c 2015-06-10 10:31:45.300965335 +0200
365 @@ -1205,8 +1205,8 @@ cupsdAddString(cups_array_t **a, /* IO -
367 *a = cupsArrayNew3((cups_array_func_t)strcmp, NULL,
368 (cups_ahash_func_t)NULL, 0,
369 - (cups_acopy_func_t)_cupsStrAlloc,
370 - (cups_afree_func_t)_cupsStrFree);
371 + (cups_acopy_func_t)strdup,
372 + (cups_afree_func_t)free);
374 return (cupsArrayAdd(*a, (char *)s));
376 @@ -1236,7 +1236,7 @@ cupsdClearString(char **s) /* O - Strin
385 @@ -1317,10 +1317,10 @@ cupsdSetString(char **s, /* O - N
393 - *s = _cupsStrAlloc(v);
398 @@ -1351,13 +1351,13 @@ cupsdSetStringf(char **s, /* O -
399 vsnprintf(v, sizeof(v), f, ap);
402 - *s = _cupsStrAlloc(v);
409 - _cupsStrFree(olds);
414 @@ -1804,8 +1804,7 @@ process_children(void)
417 if (job->printer_message)
418 - cupsdSetString(&(job->printer_message->values[0].string.text),
420 + ippSetString(job->attrs, &job->printer_message, 0, message);