From: Sean Kau Date: Thu, 17 Dec 2020 19:04:59 +0000 (-0800) Subject: backend/ipp: Change handling of job_canceled X-Git-Tag: v2.4b1~203^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=eb60f2dcbc9b6722f652153e84a106f58f650e0a;p=thirdparty%2Fcups.git backend/ipp: Change handling of job_canceled job_canceled can be -1, 0, or 1. 0 indicates no error, 1 indicates that we were cancelled in normal operations (user cancelled from computer) and -1 indicates cancelled by printer. There is clearly an assumption that -1 is false since there is a check for job_canceled < 0 a few lines later. BUG=b:174793115 TEST=Print to printer with malformed PWG-Raster content Change-Id: I88f504d00e0680507cd439b633c6c288cf7c5390 --- diff --git a/backend/ipp.c b/backend/ipp.c index 521c0390cc..8b1976990d 100644 --- a/backend/ipp.c +++ b/backend/ipp.c @@ -2240,7 +2240,8 @@ main(int argc, /* I - Number of command-line args */ else if (ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_AUTHORIZATION_FAILED) fputs("JOBSTATE: account-authorization-failed\n", stderr); - if (job_canceled) + // job_canceled can be -1 which should not be treated as CUPS_BACKEND_OK + if (job_canceled > 0) return (CUPS_BACKEND_OK); else if (ipp_status == IPP_STATUS_ERROR_NOT_AUTHORIZED || ipp_status == IPP_STATUS_ERROR_FORBIDDEN || ipp_status == IPP_STATUS_ERROR_CUPS_AUTHENTICATION_CANCELED) return (CUPS_BACKEND_AUTH_REQUIRED);