From c29d06f9f934403197e73326dd23add700dfa115 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Wed, 5 Dec 2018 12:59:56 -0500 Subject: [PATCH] Fix -E option (Issue #5440) --- CHANGES.md | 1 + systemv/lpadmin.c | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index cb8758abb..4fa769716 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -41,6 +41,7 @@ Changes in CUPS v2.3b6 cupsManualCopies keyword (Issue #5433) - Kerberos credentials might be truncated (Issue #5435) - The handling of `MaxJobTime 0` did not match the documentation (Issue #5438) +- Fixed a bug adding a queue with the `-E` option (Issue #5440) - The scheduler was being backgrounded on macOS, causing applications to spin (rdar://40436080) - The scheduler did not validate that required initial request attributes were diff --git a/systemv/lpadmin.c b/systemv/lpadmin.c index 3e2e1ff0e..744302369 100644 --- a/systemv/lpadmin.c +++ b/systemv/lpadmin.c @@ -1377,12 +1377,6 @@ set_printer_options( ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri); ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", NULL, cupsUser()); - if (enable) - { - ippAddInteger(request, IPP_TAG_PRINTER, IPP_TAG_ENUM, "printer-state", IPP_PSTATE_IDLE); - ippAddBoolean(request, IPP_TAG_PRINTER, "printer-is-accepting-jobs", 1); - } - /* * Add the options... */ @@ -1415,6 +1409,13 @@ set_printer_options( ppdfile = NULL; cupsEncodeOptions2(request, num_options, options, IPP_TAG_OPERATION); + + if (enable) + { + ippAddInteger(request, IPP_TAG_PRINTER, IPP_TAG_ENUM, "printer-state", IPP_PSTATE_IDLE); + ippAddBoolean(request, IPP_TAG_PRINTER, "printer-is-accepting-jobs", 1); + } + cupsEncodeOptions2(request, num_options, options, IPP_TAG_PRINTER); if ((protocol = cupsGetOption("protocol", num_options, options)) != NULL) -- 2.39.5