Skip to content

Commit

Permalink
scheduler: Tolerate devices breaking IPPEVE specs if possible
Browse files Browse the repository at this point in the history
Related to OpenPrinting#1033

PPD generator currently is capable to bypass missing attribute
"media-col-database", if attributes "media-size-supported" or
"media-supported" are present.

Although such devices do not pass any IPP Everywhere or AirPrint
certifications, they exist in the wilderness.
  • Loading branch information
zdohnal committed Sep 18, 2024
1 parent 6dd0c14 commit 37526a5
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions scheduler/ipp.c
Original file line number Diff line number Diff line change
Expand Up @@ -5356,6 +5356,24 @@ create_local_bg_thread(
}
}

if (ippFindAttribute(response, "media-col-database", IPP_TAG_ZERO) == NULL
&& ippFindAttribute(response, "media-supported", IPP_TAG_ZERO) == NULL
&& ippFindAttribute(response, "media-size-supported", IPP_TAG_BEGIN_COLLECTION) == NULL)
{
cupsdLogMessage(CUPSD_LOG_ERROR, "The printer %s doesn't provide attributes \"media-col-database\","
" \"media-size-supported\" or \"media-supported\" required for generating"
" printer capabilities.", printer->name);

/* Force printer to timeout and be deleted */
cupsRWLockWrite(&printer->lock);
printer->state_time = 0;
cupsRWUnlock(&printer->lock);

send_ipp_status(con, IPP_STATUS_ERROR_DEVICE, _("The printer %s does not provide attributes"
" required for IPP Everywhere."), printer->name);
goto finish_response;
}

// Validate response from printer...
if (!ippValidateAttributes(response))
{
Expand Down

0 comments on commit 37526a5

Please sign in to comment.