From: Michael R Sweet Date: Mon, 21 Jan 2019 16:28:24 +0000 (-0500) Subject: Use the same requested-attributes values for all IPP Everywhere setup X-Git-Tag: v2.2.11~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f3693bb3154c00154e7c2aebf5b7f7adab52edcf;p=thirdparty%2Fcups.git Use the same requested-attributes values for all IPP Everywhere setup requests (Issue #5484) --- diff --git a/CHANGES.md b/CHANGES.md index 9e853c9f1a..1389964d76 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,4 @@ -CHANGES - 2.2.11 - 2019-01-10 +CHANGES - 2.2.11 - 2019-01-21 ============================= @@ -8,6 +8,9 @@ Changes in CUPS v2.2.11 - Running ppdmerge with the same input and output filenames did not work as advertised (Issue #5455) - Fixed a potential memory leak when reading at the end of a file (Issue #5473) +- The lpadmin command, web interface, and scheduler all queried an IPP + Everywhere printer differently, resulting in different PPDs for the same + printer (Issue #5484) - Fixed a potential crash bug in cups-driverd (rdar://46625579) - Fixed a performance regression with large PPDs (rdar://47040759) diff --git a/cgi-bin/admin.c b/cgi-bin/admin.c index ce9297765f..dc2d4f4e61 100644 --- a/cgi-bin/admin.c +++ b/cgi-bin/admin.c @@ -1,8 +1,8 @@ /* * Administration CGI for CUPS. * - * Copyright 2007-2018 by Apple Inc. - * Copyright 1997-2007 by Easy Software Products. + * Copyright © 2007-2019 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 @@ -4220,6 +4220,13 @@ get_printer_ppd(const char *uri, /* I - Printer URI */ host[256], /* Hostname */ resource[256]; /* Resource path */ int port; /* Port number */ + static const char * const pattrs[] = /* Printer attributes we need */ + { + "job-template", + "printer-defaults", + "printer-description", + "media-col-database" + }; /* @@ -4260,6 +4267,7 @@ get_printer_ppd(const char *uri, /* I - Printer URI */ request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES); ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri); + ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "requested-attributes", (int)(sizeof(pattrs) / sizeof(pattrs[0])), NULL, pattrs); response = cupsDoRequest(http, request, resource); if (!_ppdCreateFromIPP(buffer, bufsize, response)) diff --git a/scheduler/ipp.c b/scheduler/ipp.c index 6ea3e37f29..4c411b6cee 100644 --- a/scheduler/ipp.c +++ b/scheduler/ipp.c @@ -1,7 +1,7 @@ /* * IPP routines for the CUPS scheduler. * - * Copyright © 2007-2018 by Apple Inc. + * Copyright © 2007-2019 by Apple Inc. * Copyright © 1997-2007 by Easy Software Products, all rights reserved. * * This file contains Kerberos support code, copyright 2006 by @@ -5279,6 +5279,13 @@ create_local_bg_thread( *response; /* Response from printer */ ipp_attribute_t *attr; /* Attribute in response */ ipp_status_t status; /* Status code */ + static const char * const pattrs[] = /* Printer attributes we need */ + { + "job-template", + "printer-defaults", + "printer-description", + "media-col-database" + }; /* @@ -5313,7 +5320,7 @@ create_local_bg_thread( request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES); ippSetVersion(request, 2, 0); ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, printer->device_uri); - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "requested-attributes", NULL, "all"); + ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "requested-attributes", (int)(sizeof(pattrs) / sizeof(pattrs[0])), NULL, pattrs); response = cupsDoRequest(http, request, resource); status = cupsLastError();