From: Michael R Sweet Date: Fri, 17 Sep 2021 15:28:22 +0000 (-0400) Subject: Show better error messages when a driver interface fails (Issue #148) X-Git-Tag: v2.4b1~52 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf32336d454237567bd426b5453a767c80944a07;p=thirdparty%2Fcups.git Show better error messages when a driver interface fails (Issue #148) --- diff --git a/CHANGES.md b/CHANGES.md index b1361c544f..7d6ed0f96f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -36,6 +36,8 @@ CUPS v2.4rc1 (Pending) - `httpUpdate` did not reset the socket file descriptor when the TLS negotiation failed (Apple #5915) - The IPP backend now retries Validate-Job requests (Issue #132) +- Now show better error messages when a driver interface program fails to + provide a PPD file (Issue #148) - Added a workaround for Solaris in `httpAddrConnect2` (Issue #156) - Now use a 60 second timeout for reading USB backchannel data (Issue #160) - The USB backend now tries harder to find a serial number (Issue #170) @@ -57,7 +59,7 @@ CUPS v2.4rc1 (Pending) Issue #164) - USB quirk updates (Issue #192, Apple #5766, Apple #5838, Apple #5843, Apple #5867) -- Web interface updates (Issue #142) +- Web interface updates (Issue #142, Issue #218) - The `ippeveprinter` tool now automatically uses an available port. - Fixed some Windows issues. - Deprecated cups-config (Issue #97) @@ -66,7 +68,6 @@ CUPS v2.4rc1 (Pending) `LPDConfigFile`, `KeepAliveTimeout`, `RIPCache`, and `SMBConfigFile` directives in `cupsd.conf` and `cups-files.conf`. - Stubbed out deprecated `httpMD5` functions. -- Printer driver deprecation wasn't mentioned in CUPS Web UI CUPS v2.3.3op2 (February 1, 2021) diff --git a/scheduler/ipp.c b/scheduler/ipp.c index dd5172c668..890a1a3802 100644 --- a/scheduler/ipp.c +++ b/scheduler/ipp.c @@ -2735,7 +2735,6 @@ add_printer(cupsd_client_t *con, /* I - Client connection */ if (copy_model(con, ppd_name, dstfile)) { - send_ipp_status(con, IPP_INTERNAL_ERROR, _("Unable to copy PPD file.")); if (!modify) cupsdDeletePrinter(printer, 0); @@ -4494,6 +4493,7 @@ copy_model(cupsd_client_t *con, /* I - Client connection */ if (!cupsdStartProcess(buffer, argv, envp, -1, temppipe[1], CGIPipes[1], -1, -1, 0, DefaultProfile, NULL, &temppid)) { + send_ipp_status(con, IPP_INTERNAL_ERROR, _("Unable to run cups-driverd: %s"), strerror(errno)); close(tempfd); unlink(tempfile); @@ -4573,6 +4573,7 @@ copy_model(cupsd_client_t *con, /* I - Client connection */ */ cupsdLogMessage(CUPSD_LOG_ERROR, "copy_model: empty PPD file"); + send_ipp_status(con, IPP_INTERNAL_ERROR, _("cups-driverd failed to get PPD file - see error_log for details.")); unlink(tempfile); return (-1); } @@ -4666,6 +4667,7 @@ copy_model(cupsd_client_t *con, /* I - Client connection */ if ((dst = cupsdCreateConfFile(to, ConfigFilePerm)) == NULL) { + send_ipp_status(con, IPP_INTERNAL_ERROR, _("Unable to save PPD file: %s"), strerror(errno)); cupsFreeOptions(num_defaults, defaults); cupsFileClose(src); unlink(tempfile); @@ -4719,7 +4721,15 @@ copy_model(cupsd_client_t *con, /* I - Client connection */ unlink(tempfile); - return (cupsdCloseCreatedConfFile(dst, to)); + if (cupsdCloseCreatedConfFile(dst, to)) + { + send_ipp_status(con, IPP_INTERNAL_ERROR, _("Unable to commit PPD file: %s"), strerror(errno)); + return (-1); + } + else + { + return (0); + } }