]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Show better error messages when a driver interface fails (Issue #148)
authorMichael R Sweet <michael.r.sweet@gmail.com>
Fri, 17 Sep 2021 15:28:22 +0000 (11:28 -0400)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Fri, 17 Sep 2021 15:28:22 +0000 (11:28 -0400)
CHANGES.md
scheduler/ipp.c

index b1361c544f6eb88eef139c77161e31f6e14893d8..7d6ed0f96fa0f6d6ff6ab1832a78e6dd3169db64 100644 (file)
@@ -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)
index dd5172c668b6745594585d8d65c20676f24b079f..890a1a3802ec4c1164b0c1e64d4d8568b39b73cd 100644 (file)
@@ -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);
+  }
 }