From: Zdenek Dohnal Date: Mon, 22 Sep 2025 12:33:45 +0000 (+0200) Subject: scheduler: Fix applying print-as-raster default X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F1369%2Fhead;p=thirdparty%2Fcups.git scheduler: Fix applying print-as-raster default Currently, the default was applied only when present in the request, which is how `lp` behaves. However the application does not have to include defaults in the request, so we have to apply it in scheduler. Additionally, this covers a case when print-as-raster is set by default, but we want to disable it in a specific request. --- diff --git a/scheduler/ipp.c b/scheduler/ipp.c index 64db4b70fd..fa822603b0 100644 --- a/scheduler/ipp.c +++ b/scheduler/ipp.c @@ -1507,8 +1507,6 @@ add_job(cupsd_client_t *con, /* I - Client connection */ ippAddString(con->request, IPP_TAG_JOB, IPP_TAG_NAME, "job-name", NULL, "Untitled"); } - attr = ippFindAttribute(con->request, "requesting-user-name", IPP_TAG_NAME); - if ((job = cupsdAddJob(priority, printer->name)) == NULL) { send_ipp_status(con, IPP_STATUS_ERROR_INTERNAL, @@ -1517,8 +1515,19 @@ add_job(cupsd_client_t *con, /* I - Client connection */ return (NULL); } - if (ippGetBoolean(ippFindAttribute(con->request, "print-as-raster", IPP_TAG_BOOLEAN), 0)) - job->print_as_raster = 1; + if ((attr = ippFindAttribute(con->request, "print-as-raster", IPP_TAG_BOOLEAN)) != NULL) + { + if (ippGetBoolean(attr, 0)) + job->print_as_raster = 1; + } + else + { + if (cupsGetOption("print-as-raster", printer->num_options, + printer->options) != NULL) + job->print_as_raster = 1; + } + + attr = ippFindAttribute(con->request, "requesting-user-name", IPP_TAG_NAME); job->dtype = printer->type & (CUPS_PTYPE_CLASS | CUPS_PTYPE_REMOTE); job->attrs = con->request;