From: Michael R Sweet Date: Mon, 21 Jan 2019 16:27:43 +0000 (-0500) Subject: Use the same requested-attributes values for all IPP Everywhere setup X-Git-Tag: v2.3b8~157 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=622207eff5e9734adc2eb7ec5de6a30ddc3feb87;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 c2af135ae3..da04ebe46b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,4 @@ -CHANGES - 2.3b8 - 2019-01-10 +CHANGES - 2.3b8 - 2019-01-21 ============================ @@ -8,6 +8,9 @@ Changes in CUPS v2.3b8 - Fixed a potential crash bug in cups-driverd (rdar://46625579) - Fixed a performance regression with large PPDs (rdar://47040759) - 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) - Localization updates (Issue #5461, Issues #5471) diff --git a/cgi-bin/admin.c b/cgi-bin/admin.c index e87e32f1d9..2be0197074 100644 --- a/cgi-bin/admin.c +++ b/cgi-bin/admin.c @@ -1,7 +1,7 @@ /* * Administration CGI for CUPS. * - * Copyright © 2007-2018 by Apple Inc. + * Copyright © 2007-2019 by Apple Inc. * Copyright © 1997-2007 by Easy Software Products. * * Licensed under Apache License v2.0. See the file "LICENSE" for more @@ -3930,6 +3930,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" + }; /* @@ -3970,6 +3977,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 c771f77f80..9580bb0901 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 @@ -5256,6 +5256,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" + }; /* @@ -5290,7 +5297,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();