From: Michael R Sweet Date: Wed, 27 Feb 2019 20:34:37 +0000 (-0500) Subject: Fix PPD caching and IPP Everywhere PPDs (Issue #5535) X-Git-Tag: v2.2.11~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c7b37f21eb26c7e2b0bdc0017a4dbd20106f6b55;p=thirdparty%2Fcups.git Fix PPD caching and IPP Everywhere PPDs (Issue #5535) --- diff --git a/CHANGES.md b/CHANGES.md index 808a851554..de112ecf1d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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) diff --git a/cups/ppd-cache.c b/cups/ppd-cache.c index 8b496e3b21..b1b53e4b30 100644 --- a/cups/ppd-cache.c +++ b/cups/ppd-cache.c @@ -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); } /*