]> 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:28:24 +0000 (11:28 -0500)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Mon, 21 Jan 2019 16:28:24 +0000 (11:28 -0500)
requests (Issue #5484)

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

index 9e853c9f1aef53448bb0dd31026a3e4884655862..1389964d763ac50dd6b240d618fa9a19bf15db01 100644 (file)
@@ -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)
 
index ce9297765ff07a115a8c203cbba737cf62c66974..dc2d4f4e61106f13300840e7cb4e63bec4892d92 100644 (file)
@@ -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))
index 6ea3e37f29eb9f59ae4420584e66d332826804bb..4c411b6ceee0a06bcdcbeb07d6924979873bc349 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
@@ -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();