]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix PPD caching and IPP Everywhere PPDs (Issue #5535)
authorMichael R Sweet <michael.r.sweet@gmail.com>
Wed, 27 Feb 2019 20:34:37 +0000 (15:34 -0500)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Wed, 27 Feb 2019 20:35:32 +0000 (15:35 -0500)
CHANGES.md
cups/ppd-cache.c

index 808a85155413679b9f9f1034dcb7d5f1e2f6622e..de112ecf1decf9306ec19390e69ffad4973b1e33 100644 (file)
@@ -1,4 +1,4 @@
-CHANGES - 2.2.11 - 2019-02-25
+CHANGES - 2.2.11 - 2019-02-27
 =============================
 
 
@@ -28,6 +28,8 @@ Changes in CUPS v2.2.11
 - The scheduler's self-signed certificate did not include all of the alternate
   names for the server when using GNU TLS (Issue #5525)
 - Fixed compiler warnings with newer versions of GCC (Issue #5532, Issue #5533)
+- Fixed some PPD caching and IPP Everywhere PPD accounting/password bugs
+  (Issue #5535)
 - Media size matching now uses a tolerance of 0.5mm (rdar://33822024)
 - The lpadmin command would hang with a bad PPD file (rdar://41495016)
 - Fixed a potential crash bug in cups-driverd (rdar://46625579)
index 8b496e3b21736267762fdb533da50f8edee1eb74..b1b53e4b30be4872186be1d440ab7b582d0397e9 100644 (file)
@@ -2871,12 +2871,12 @@ _ppdCacheWriteFile(
   if (pc->charge_info_uri)
     cupsFilePutConf(fp, "ChargeInfoURI", pc->charge_info_uri);
 
-  cupsFilePrintf(fp, "AccountId %s\n", pc->account_id ? "true" : "false");
-  cupsFilePrintf(fp, "AccountingUserId %s\n",
+  cupsFilePrintf(fp, "JobAccountId %s\n", pc->account_id ? "true" : "false");
+  cupsFilePrintf(fp, "JobAccountingUserId %s\n",
                  pc->accounting_user_id ? "true" : "false");
 
   if (pc->password)
-    cupsFilePutConf(fp, "Password", pc->password);
+    cupsFilePutConf(fp, "JobPassword", pc->password);
 
   for (value = (char *)cupsArrayFirst(pc->mandatory);
        value;
@@ -3101,6 +3101,22 @@ _ppdCreateFromIPP(char   *buffer,        /* I - Filename buffer */
   cupsFilePuts(fp, "*cupsSNMPSupplies: False\n");
   cupsFilePuts(fp, "*cupsLanguages: \"en\"\n");
 
+  if ((attr = ippFindAttribute(response, "printer-more-info", IPP_TAG_URI)) != NULL)
+    cupsFilePrintf(fp, "*APSupplies: \"%s\"\n", ippGetString(attr, 0, NULL));
+
+  if ((attr = ippFindAttribute(response, "printer-charge-info-uri", IPP_TAG_URI)) != NULL)
+    cupsFilePrintf(fp, "*cupsChargeInfoURI: \"%s\"\n", ippGetString(attr, 0, NULL));
+
+ /*
+  * Accounting...
+  */
+
+  if (ippGetBoolean(ippFindAttribute(response, "job-account-id-supported", IPP_TAG_BOOLEAN), 0))
+    cupsFilePuts(fp, "*cupsJobAccountId: True\n");
+
+  if (ippGetBoolean(ippFindAttribute(response, "job-accounting-user-id-supported", IPP_TAG_BOOLEAN), 0))
+    cupsFilePuts(fp, "*cupsJobAccountingUserId: True\n");
+
  /*
   * Password/PIN printing...
   */
@@ -3133,7 +3149,7 @@ _ppdCreateFromIPP(char   *buffer, /* I - Filename buffer */
 
     pattern[maxlen] = '\0';
 
-    cupsFilePrintf(fp, "*cupsPassword: \"%s\"\n", pattern);
+    cupsFilePrintf(fp, "*cupsJobPassword: \"%s\"\n", pattern);
   }
 
  /*