[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#729713: libcups2: fails to fetch ppd of ipp:// device



Here is my patch ported to cups 2.1.0-4. I reproduced the bug with
unpatched 2.1.0-4.

On Mon, Apr 27, 2015 at 03:44:06PM +0200, Lionel Elie Mamane wrote:
> Ping? I still patch my cups (1.7.5-11) locally with the attached
> patch, and this bug is still reproduced with unpatched 1.7.5-11.
> 
> Any progress on this?
> 
> For reminder, the problem is that when (a program using) libcupsys2
> wants to retrieve the PPD for a printer whose device URI is
> "ipp://something", libcupsys2 tries to connect to the device URI
> instead of to the cups server. This makes sense when the device URI is
> actually another CUPS server, but *not* when, as in my case, it is a
> network-attached printer that "talks" IPP natively. It will *not* have
> the PPD at the CUPS-specific URL.
> 
> On Tue, Jul 01, 2014 at 04:24:58PM +0200, Lionel Elie Mamane wrote:
> > Control: unarchive -1
> > Control: found -1 1.7.2-3
> > Control: found -1 1.7.3-6
> > Control: notfixed -1 1.7.1-1
> > Control: reopen -1
> > 
> > It seems the below test was mistaken. I had the problem again with
> > 1.7.3-3, so I downgraded to 1.7.2-3, but I still get the problem.
> > 
> > I think I had temporarily changed my printer to not use ipp:// but
> > socket:// to work around the problem, and got confused in my
> > tests... This bug is *not* fixed.
> > 
> > On Tue, May 13, 2014 at 04:55:52PM +0200, Lionel Elie Mamane wrote:
> > > Control: tags -1 -moreinfo
> > > 
> > > On Sun, Jan 05, 2014 at 12:45:10PM +0100, Didier 'OdyX' Raboud wrote:
> > > 
> > > > thanks for your detailed bugreports and proposed patch.
> > > 
> > > > Le dimanche, 5 janvier 2014, 01.44:37 Wolfgang Walter a écrit :
> > > >> We modified libcups in the same way as Lionel. I don't know why this
> > > >> has been changed from 1.5 to 1.6 but it seems buggy. Most
> > > >> ipp-printers don't provide a PPD. And even if the do there is no
> > > >> guarantie the client is allowed to communicate directly with the
> > > >> printer.
> > > 
> > > > Lionel & Wolfgang: can you try to rebuild and try unstable's cups 
> > > > (1.7.0-2) without the get-ppd-file-for-statically-configured-ipp-shared-
> > > > queues patch and report back if this works as expected?
> > > 
> > > I upgraded to cups 1.7.2-3, which does not anymore have
> > > get-ppd-file-for-statically-configured-ipp-shared-queues, and it works
> > > as expected.
> > > 

> Index: cups-1.7.5/cups/util.c
> ===================================================================
> --- cups-1.7.5.orig/cups/util.c
> +++ cups-1.7.5/cups/util.c
> @@ -1718,6 +1718,7 @@ cups_get_printer_uri(
>                                   IPP_TAG_URI)) != NULL)
>        device_uri = attr->values[0].string.text;
>  
> +#if 0
>      if (device_uri &&
>          (!strncmp(device_uri, "ipp://", 6) ||
>           !strncmp(device_uri, "ipps://", 7) ||
> @@ -1738,7 +1739,9 @@ cups_get_printer_uri(
>  
>        return (1);
>      }
> -    else if ((attr = ippFindAttribute(response, "member-uris",
> +    else
> +#endif
> +    if ((attr = ippFindAttribute(response, "member-uris",
>                                        IPP_TAG_URI)) != NULL)
>      {
>       /*

Index: cups-2.1.0/cups/util.c
===================================================================
--- cups-2.1.0.orig/cups/util.c
+++ cups-2.1.0/cups/util.c
@@ -1529,6 +1529,7 @@ cups_get_printer_uri(
       DEBUG_printf(("5cups_get_printer_uri: device-uri=\"%s\"", device_uri));
     }
 
+#if 0
     if (device_uri &&
         (!strncmp(device_uri, "ipp://", 6) ||
          !strncmp(device_uri, "ipps://", 7) ||
@@ -1546,7 +1547,9 @@ cups_get_printer_uri(
       DEBUG_printf(("5cups_get_printer_uri: Resolved to host=\"%s\", port=%d, resource=\"%s\"", host, *port, resource));
       return (1);
     }
-    else if ((attr = ippFindAttribute(response, "member-uris", IPP_TAG_URI)) != NULL)
+    else
+#endif
+    if ((attr = ippFindAttribute(response, "member-uris", IPP_TAG_URI)) != NULL)
     {
      /*
       * Get the first actual printer name in the class...

Reply to: