Skip to content

Commit

Permalink
Fix lpadmin with cupsIPPSupplies and cupsSNMPSupplies (Issue #5610)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelrsweet committed Jul 16, 2019
1 parent 666d076 commit c507739
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Changes in CUPS v2.2.12
- Fixed some compatibility issues with old releases of CUPS (Issue #5587)
- Fixed a bug in the scheduler job cleanup code (Issue #5588)
- "make" failed with GZIP options (Issue #5595)
- The `lpadmin` command did not always update the PPD file for changes to the
`cupsIPPSupplies` and `cupsSNMPSupplies` keywords (Issue #5610)
- The scheduler now uses both the group's membership list as well as the
various OS-specific membership functions to determine whether a user belongs
to a named group (Issue #5613)
Expand Down
9 changes: 7 additions & 2 deletions systemv/lpadmin.c
Original file line number Diff line number Diff line change
Expand Up @@ -1488,6 +1488,7 @@ set_printer_options(
(boolval = cupsGetOption("cupsIPPSupplies", num_options,
options)) != NULL)
{
ppdchanged = 1;
wrote_ipp_supplies = 1;
cupsFilePrintf(out, "*cupsIPPSupplies: %s\n",
(!_cups_strcasecmp(boolval, "true") ||
Expand All @@ -1498,6 +1499,7 @@ set_printer_options(
(boolval = cupsGetOption("cupsSNMPSupplies", num_options,
options)) != NULL)
{
ppdchanged = 1;
wrote_snmp_supplies = 1;
cupsFilePrintf(out, "*cupsSNMPSupplies: %s\n",
(!_cups_strcasecmp(boolval, "true") ||
Expand Down Expand Up @@ -1558,6 +1560,8 @@ set_printer_options(
(boolval = cupsGetOption("cupsIPPSupplies", num_options,
options)) != NULL)
{
ppdchanged = 1;

cupsFilePrintf(out, "*cupsIPPSupplies: %s\n",
(!_cups_strcasecmp(boolval, "true") ||
!_cups_strcasecmp(boolval, "yes") ||
Expand All @@ -1568,6 +1572,8 @@ set_printer_options(
(boolval = cupsGetOption("cupsSNMPSupplies", num_options,
options)) != NULL)
{
ppdchanged = 1;

cupsFilePrintf(out, "*cupsSNMPSupplies: %s\n",
(!_cups_strcasecmp(boolval, "true") ||
!_cups_strcasecmp(boolval, "yes") ||
Expand All @@ -1582,8 +1588,7 @@ set_printer_options(
* Do the request...
*/

ippDelete(cupsDoFileRequest(http, request, "/admin/",
ppdchanged ? tempfile : file));
ippDelete(cupsDoFileRequest(http, request, "/admin/", ppdchanged ? tempfile : file));

/*
* Clean up temp files... (TODO: catch signals in case we CTRL-C during
Expand Down

0 comments on commit c507739

Please sign in to comment.