]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
lpoptions now works with discovered but un-added printers (Issue #5045)
authorMichael R Sweet <michael.r.sweet@gmail.com>
Thu, 6 Dec 2018 16:24:11 +0000 (11:24 -0500)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Thu, 6 Dec 2018 16:24:11 +0000 (11:24 -0500)
CHANGES.md
systemv/lpoptions.c

index 4fa7697167b464a6febd49f29bcab48a32e50369..94628f2256f5a9bb6dbb57a4bc34137678a0cba9 100644 (file)
@@ -1,4 +1,4 @@
-CHANGES - 2.3b6 - 2018-12-05
+CHANGES - 2.3b6 - 2018-12-06
 ============================
 
 Changes in CUPS v2.3b6
@@ -7,6 +7,8 @@ Changes in CUPS v2.3b6
 - Localization update (Issue #5339, Issue #5348, Issue #5362, Issue #5408,
   Issue #5410)
 - Documentation updates (Issue #5369, Issue #5402, Issue #5403, Issue #5404)
+- The `lpoptions` command now works with IPP Everywhere printers that have not
+  yet been added as local queues (Issue #5045)
 - The lpadmin command would create a non-working printer in some error cases
   (Issue #5305)
 - The scheduler would crash if an empty `AccessLog` directive was specified
index f80319a196935562ce5d35214d93a6fc82ef9e93..0712c908d8ae41cd18f223ae74b0c2abc4112896 100644 (file)
@@ -1,10 +1,11 @@
 /*
  * Printer option program for CUPS.
  *
- * Copyright 2007-2016 by Apple Inc.
- * Copyright 1997-2006 by Easy Software Products.
+ * Copyright © 2007-2018 by Apple Inc.
+ * Copyright © 1997-2006 by Easy Software Products.
  *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
+ * Licensed under Apache License v2.0.  See the file "LICENSE" for more
+ * information.
  */
 
 /*
@@ -476,19 +477,32 @@ list_group(ppd_file_t  *ppd,              /* I - PPD file */
 static void
 list_options(cups_dest_t *dest)                /* I - Destination to list */
 {
+  http_t       *http;                  /* Connection to destination */
+  char         resource[1024];         /* Resource path */
   int          i;                      /* Looping var */
   const char   *filename;              /* PPD filename */
   ppd_file_t   *ppd;                   /* PPD data */
   ppd_group_t  *group;                 /* Current group */
 
 
-  if ((filename = cupsGetPPD(dest->name)) == NULL)
+  if ((http = cupsConnectDest(dest, CUPS_DEST_FLAGS_NONE, 30000, NULL, resource, sizeof(resource), NULL, NULL)) == NULL)
   {
     _cupsLangPrintf(stderr, _("lpoptions: Unable to get PPD file for %s: %s"),
                    dest->name, cupsLastErrorString());
     return;
   }
 
+  if ((filename = cupsGetPPD2(http, dest->name)) == NULL)
+  {
+    httpClose(http);
+
+    _cupsLangPrintf(stderr, _("lpoptions: Unable to get PPD file for %s: %s"),
+                   dest->name, cupsLastErrorString());
+    return;
+  }
+
+  httpClose(http);
+
   if ((ppd = ppdOpenFile(filename)) == NULL)
   {
     unlink(filename);