summaryrefslogtreecommitdiff
path: root/systemv
diff options
context:
space:
mode:
authorMichael R Sweet <michaelrsweet@gmail.com>2018-07-17 21:57:41 -0400
committerMichael R Sweet <michaelrsweet@gmail.com>2018-07-17 21:57:41 -0400
commit67bd1f47a5ed92515e8559e49ba1bef792dda8e3 (patch)
treee929503535a6874a5823d9574b22d1b2b0d4242e /systemv
parent6f1c647d735e068e66cdaef2b302c28ce7e50014 (diff)
downloadcups-67bd1f47a5ed92515e8559e49ba1bef792dda8e3.tar.gz
Fix regression in lpadmin fix (Issue #5305)
Diffstat (limited to 'systemv')
-rw-r--r--systemv/lpadmin.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/systemv/lpadmin.c b/systemv/lpadmin.c
index d7d02591a..aaebd3eed 100644
--- a/systemv/lpadmin.c
+++ b/systemv/lpadmin.c
@@ -32,7 +32,7 @@ static cups_ptype_t get_printer_type(http_t *http, char *printer, char *uri,
size_t urisize);
static int set_printer_options(http_t *http, char *printer,
int num_options, cups_option_t *options,
- char *file);
+ char *file, int enable);
static int validate_name(const char *name);
@@ -50,6 +50,7 @@ main(int argc, /* I - Number of command-line arguments */
*pclass, /* Printer class name */
*opt, /* Option pointer */
*val; /* Pointer to allow/deny value */
+ int enable = 0; /* Enable/resume printer? */
int num_options; /* Number of options */
cups_option_t *options; /* Options */
char *file, /* New PPD file */
@@ -259,8 +260,7 @@ main(int argc, /* I - Number of command-line arguments */
}
}
- if (enable_printer(http, printer))
- return (1);
+ enable = 1;
break;
case 'm' : /* Use the specified standard script/PPD file */
@@ -647,9 +647,11 @@ main(int argc, /* I - Number of command-line arguments */
}
}
- if (set_printer_options(http, printer, num_options, options, file))
+ if (set_printer_options(http, printer, num_options, options, file, enable))
return (1);
}
+ else if (enable && enable_printer(http, printer))
+ return (1);
if (evefile[0])
unlink(evefile);
@@ -1331,7 +1333,8 @@ set_printer_options(
char *printer, /* I - Printer */
int num_options, /* I - Number of options */
cups_option_t *options, /* I - Options */
- char *file) /* I - PPD file/interface script */
+ char *file, /* I - PPD file */
+ int enable) /* I - Enable printer? */
{
ipp_t *request; /* IPP Request */
const char *ppdfile; /* PPD filename */
@@ -1377,6 +1380,12 @@ 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...
*/