]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Use the same requested-attributes values for all IPP Everywhere setup
authorMichael R Sweet <michael.r.sweet@gmail.com>
Mon, 21 Jan 2019 16:27:43 +0000 (11:27 -0500)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Mon, 21 Jan 2019 16:27:43 +0000 (11:27 -0500)
requests (Issue #5484)

CHANGES.md
cgi-bin/admin.c
scheduler/ipp.c

index c2af135ae3f70753f9dd17b62cc9611fbb3b9bb4..da04ebe46b132cdced07245fbdccd325ef63d104 100644 (file)
@@ -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)
 
 
index e87e32f1d9588903a7776db3eb9f1a1895cdf857..2be01970745e9e797edc0d31bf29498116ed9bf9 100644 (file)
@@ -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))
index c771f77f807473124f9d3238a4e5b41002bf1966..9580bb0901f0bebc69bc5d3524bc970b9c1739d8 100644 (file)
@@ -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();