<div dir="ltr"><div><div><div>Hi Brian,<br><br></div>Yes, filing a bug is the best idea.<br><br></div>Cheers,<br></div>- Ira<br><br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr">Ira McDonald (Musician / Software Architect)<br>Co-Chair - TCG Trusted Mobility Solutions WG<br>Chair - Linux Foundation Open Printing WG<br>Secretary - IEEE-ISTO Printer Working Group<br>Co-Chair - IEEE-ISTO PWG Internet Printing Protocol WG<br>IETF Designated Expert - IPP & Printer MIB<br>Blue Roof Music / High North Inc<br><a style="color:rgb(51,51,255)" href="http://sites.google.com/site/blueroofmusic" target="_blank">http://sites.google.com/site/blueroofmusic</a><br><a style="color:rgb(102,0,204)" href="http://sites.google.com/site/highnorthinc" target="_blank">http://sites.google.com/site/highnorthinc</a><br>mailto: <a href="mailto:blueroofmusic@gmail.com" target="_blank">blueroofmusic@gmail.com</a><br>Winter 579 Park Place Saline, MI 48176 734-944-0094<br>Summer PO Box 221 Grand Marais, MI 49839 906-494-2434<br><br><div style="display:inline"></div><div style="display:inline"></div><div style="display:inline"></div><div></div><div></div><div></div><div></div></div></div></div>
<br><div class="gmail_quote">On Mon, Apr 11, 2016 at 12:51 PM, Brian Norris <span dir="ltr"><<a href="mailto:computersforpeace@gmail.com" target="_blank">computersforpeace@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Ping? Should I just file a bug for these sort of questions?<br>
<div class="HOEnZb"><div class="h5"><br>
On Tue, Mar 22, 2016 at 01:40:34PM -0700, Brian Norris wrote:<br>
> Hi,<br>
><br>
> I'm looking at the features of cups-browsed to see if I would want to<br>
> use it for my purposes, and I ran across a really confusing piece of<br>
> logic in the source code:<br>
><br>
> if (!pdl || pdl[0] == '\0' ||<br>
> (!strcasestr(pdl, "application/postscript") &&<br>
> !strcasestr(pdl, "application/pdf") &&<br>
> !strcasestr(pdl, "image/pwg-raster") &&<br>
> ((!strcasestr(pdl, "application/vnd.hp-PCL") &&<br>
> !strcasestr(pdl, "application/PCL") &&<br>
> !strcasestr(pdl, "application/x-pcl")) ||<br>
> ((strncasecmp(make_model, "HP", 2) ||<br>
> strncasecmp(make_model, "Hewlett Packard", 15) ||<br>
> strncasecmp(make_model, "Hewlett-Packard", 15)) &&<br>
> !strcasestr(make_model, "LaserJet") &&<br>
> !strcasestr(make_model, "Mopier"))) &&<br>
> !strcasestr(pdl, "application/vnd.hp-PCLXL"))) {<br>
> debug_printf("cups-browsed: Cannot create remote printer %s (%s) as its PDLs are not known, ignoring this printer.\n",<br>
> p->name, p->uri);<br>
> goto fail;<br>
> }<br>
><br>
> First of all, can anyone explain exactly what the block about HP is<br>
> really supposed to be doing? I can't honestly figure it out.<br>
><br>
> But at any rate, I don't see how it could be correct. Particularly, this<br>
> clause is always true (at most one of the comparisons will return 0), so<br>
> why is it there?<br>
><br>
> (strncasecmp(make_model, "HP", 2) ||<br>
> strncasecmp(make_model, "Hewlett Packard", 15) ||<br>
> strncasecmp(make_model, "Hewlett-Packard", 15))<br>
><br>
> Seems like at a minimum, this block should be corrected to actually<br>
> produce the status of "is this an HP model." e.g., does the following<br>
> diff make sense?<br>
><br>
> === modified file 'utils/cups-browsed.c'<br>
> --- utils/cups-browsed.c 2016-02-10 14:18:28 +0000<br>
> +++ utils/cups-browsed.c 2016-03-22 20:25:19 +0000<br>
> @@ -2784,8 +2784,8 @@<br>
> ((!strcasestr(pdl, "application/vnd.hp-PCL") &&<br>
> !strcasestr(pdl, "application/PCL") &&<br>
> !strcasestr(pdl, "application/x-pcl")) ||<br>
> - ((strncasecmp(make_model, "HP", 2) ||<br>
> - strncasecmp(make_model, "Hewlett Packard", 15) ||<br>
> + ((strncasecmp(make_model, "HP", 2) &&<br>
> + strncasecmp(make_model, "Hewlett Packard", 15) &&<br>
> strncasecmp(make_model, "Hewlett-Packard", 15)) &&<br>
> !strcasestr(make_model, "LaserJet") &&<br>
> !strcasestr(make_model, "Mopier"))) &&<br>
><br>
> But I still don't feel like that's really what's intended, so an answer<br>
> to my first question would be the most helpful.<br>
><br>
> Now, besides the correctness of this logic, is this aspect of the daemon<br>
> something that people regularly use? I see that it's installed on many<br>
> Linux distributions, but it seems like it isn't really exercised for<br>
> Bonjour/DNS-SD discovery unless someone modifies the default<br>
> cups-browsed.conf to have 'CreateIPPPrinterQueues Yes'.<br>
><br>
> Regards,<br>
> Brian<br>
_______________________________________________<br>
Printing-architecture mailing list<br>
<a href="mailto:Printing-architecture@lists.linux-foundation.org">Printing-architecture@lists.linux-foundation.org</a><br>
<a href="https://lists.linuxfoundation.org/mailman/listinfo/printing-architecture" rel="noreferrer" target="_blank">https://lists.linuxfoundation.org/mailman/listinfo/printing-architecture</a><br>
</div></div></blockquote></div><br></div>