Bug 506803 - CUPS snmp backend does not validate retrieved device URI
Summary: CUPS snmp backend does not validate retrieved device URI
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: cups
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Zdenek Dohnal
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 673067 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-06-18 17:44 UTC by cornel panceac
Modified: 2023-09-14 01:17 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2017-04-30 13:10:33 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
the troubleshooter output (51.81 KB, text/plain)
2009-06-25 19:05 UTC, cornel panceac
no flags Details
snmp debug output (843 bytes, text/plain)
2009-06-27 11:13 UTC, cornel panceac
no flags Details
snmp debug output 29th of june 2k9 (15.51 KB, text/plain)
2009-06-29 12:09 UTC, cornel panceac
no flags Details


Links
System ID Private Priority Status Summary Last Updated
CUPS Bugs and Features 3239 0 None None None Never

Description cornel panceac 2009-06-18 17:44:55 UTC
Description of problem:
i've added one network printer, brother hl-5250dn, to one computer. i first used the "Find Network Printer" option. i've entered the ip, hte printer was eventually configured but it was not printing. i've deleted the printer and used the "JetDirect" option. this time the printer worked.

then, i've added the printer to another computer. this time i used directly the JetDirect option. the printer didn't print at all. i've rebooted the computer for some not important reason. after reboot, the printer worked.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.add a brother hl-5250dn network printer
2.try to print
3.
  
Actual results:
nothing is printed

Expected results:


Additional info:

the "find network printer" option can not really be used to find any network printer. it requires to know the ip wich is not always possible.

the appsocket/jetdirect option does not detect/identify the printer even if you give the ip. it requires to specify the maker and model.

maybe instead of reboot i should've restart cups. on the third computer i'll try that :)

Comment 1 Tim Waugh 2009-06-24 10:04:54 UTC
Please update to the most recent system-config-printer test update:

yum --enablerepo=updates-testing update 'system-config-printer*'

Then run the printing troubleshooter: System->Administration->Printing, then Help->Troubleshoot.  Follow the on-screen instructions and attach the resulting troubleshoot.txt file to this bug report.

It is important that the print fails as described when you run the troubleshooter!

Comment 2 cornel panceac 2009-06-24 19:34:36 UTC
i've installed updates from testing onto my netbook. then i installed the printer (with "find network printer") and thentried to print. failed and then i started the troubleshooter. i reach the screen where the troubleshooter says:

"Queue not enabled" and then instructions on how to enable it. however, trying to enable it fails, i check the box and press apply, and the result is that the box is left unchecked.

i don't really have any idea on what to do next, but i'll try a reboot :)

Comment 3 cornel panceac 2009-06-24 20:09:09 UTC
after reboot, we were still "unable to find printer". trying to delete the printer, made te gui crash. reboot again, and the printer was gone. i installed this time jetdirect and choosed manually model (brother hl-5250dn-br3) and the driver, and it worked immediately.

Comment 4 Tim Waugh 2009-06-25 08:43:55 UTC
(In reply to comment #2)
> i've installed updates from testing onto my netbook. then i installed the
> printer (with "find network printer") and thentried to print. failed and then i
> started the troubleshooter.

This is the wrong way round.  Please start the troubleshooter *first*, and try to print when it prompts you to.  Otherwise we'll miss the failure, and I won't be able to diagnose it.

(In reply to comment #3)
> after reboot, we were still "unable to find printer".

I don't know what you mean by this.  Did you see an error message somewhere? Where?  What did it say (exactly)?

> i installed
> this time jetdirect and choosed manually model (brother hl-5250dn-br3) and the
> driver, and it worked immediately.  

How is that different from the procedure you had been using before?

Please start again and post the troubleshoot.txt file you get from the troubleshooter.  Thanks.

Comment 5 cornel panceac 2009-06-25 19:05:51 UTC
Created attachment 349446 [details]
the troubleshooter output

Comment 6 cornel panceac 2009-06-25 19:10:01 UTC
(In reply to comment #4)
> (In reply to comment #2)
> > i've installed updates from testing onto my netbook. then i installed the
> > printer (with "find network printer") and thentried to print. failed and then i
> > started the troubleshooter.
> 
> This is the wrong way round.  Please start the troubleshooter *first*, and try
> to print when it prompts you to.  Otherwise we'll miss the failure, and I won't
> be able to diagnose it.

ok


> 
> (In reply to comment #3)
> > after reboot, we were still "unable to find printer".
> 
> I don't know what you mean by this.  Did you see an error message somewhere?
> Where?  What did it say (exactly)?

printer properties: stopped - unable to locate printer BRN_E0E229

also, in troubleshooter, somewhere :)

> 
> > i installed
> > this time jetdirect and choosed manually model (brother hl-5250dn-br3) and the
> > driver, and it worked immediately.  
> 
> How is that different from the procedure you had been using before?

i assume the main difference is that the printer is identified by ip and not by name ....
> 
> Please start again and post the troubleshoot.txt file you get from the
> troubleshooter.  Thanks.  

done. thank you.

Comment 7 Tim Waugh 2009-06-25 20:27:34 UTC
OK, I think I'm beginning to understand the problem.

What does this command say, replacing the IP address with the one for the printer?:

/usr/lib/cups/backend/snmp 192.168.1.1

Comment 8 cornel panceac 2009-06-26 03:31:55 UTC
(In reply to comment #7)
> OK, I think I'm beginning to understand the problem.
> 
> What does this command say, replacing the IP address with the one for the
> printer?:
> 
> /usr/lib/cups/backend/snmp 192.168.1.1  



$ /usr/lib/cups/backend/snmp 192.168.1.99
network lpd://BRN_E0E229/BINARY_P1 "Brother HL-5250DN series" "Brother HL-5250DN series" "MFG:Brother;CMD:PJL,PCL,PCLXL,POSTSCRIPT;MDL:HL-5250DN series;CLS:PRINTER;" ""

Comment 9 Tim Waugh 2009-06-26 08:54:12 UTC
(In reply to comment #0)
> the "find network printer" option can not really be used to find any network
> printer. it requires to know the ip wich is not always possible.

Hostnames work as well.  In fact the 'Network printers' tree will include any SNMP- or mDNS-discoverable printers automatically in the list.  Unfortunately this printer is not responding to SNMP broadcast queries, is not using mDNS, and in any case is reporting an incorrect hostname for itself.

> the appsocket/jetdirect option does not detect/identify the printer even if you
> give the ip. it requires to specify the maker and model.

Would you mind filing that as a separate bug report against system-config-printer please?

Now, as for *this* problem, what I think is going on is that the printer device is advertising a device URI for itself using an incorrect hostname.  Incorrect in two ways actually: firstly, and most importantly, that there is no DNS server on the network able to map it to the IP address for the printer; secondly that it contains an invalid character (_) for hostnames.

It looks to me like the snmp backend is not validating this URI, which it probably ought to.  After all, *it* knows the IP address and could easily replace it in the URI.

Could you please run the following and attach snmp-debug.txt to this bug report?

cp /etc/cups/snmp.conf /tmp/snmp.conf
echo 'DebugLevel 10' >> /tmp/snmp.conf
CUPS_SERVERROOT=/tmp /usr/lib/cups/backend/snmp 2> snmp-debug.txt

Comment 10 cornel panceac 2009-06-27 11:13:52 UTC
Created attachment 349649 [details]
snmp debug output

Comment 11 Tim Waugh 2009-06-29 11:02:53 UTC
Thanks.  Now please try this one:

cp /etc/cups/snmp.conf /tmp/snmp.conf
echo 'DebugLevel 10' >> /tmp/snmp.conf
CUPS_SERVERROOT=/tmp /usr/lib/cups/backend/snmp 192.168.1.99 2> snmp-debug.txt

Comment 12 cornel panceac 2009-06-29 12:09:47 UTC
Created attachment 349774 [details]
snmp debug output 29th of june 2k9

thank you, here's the output.

Comment 13 Tim Waugh 2009-06-29 12:23:21 UTC
Thanks.  The printer is indeed telling us an incorrect name for itself, as I suspected.

Comment 14 cornel panceac 2009-07-01 15:44:49 UTC
thnx a lot

Comment 15 Tim Waugh 2009-07-01 16:12:18 UTC
You might be able to configure the printer to give a different name, or to use mDNS / DNS-SD.  I'll monitor the upstream bug report and try to get a fix included.

Comment 16 JMcGuire 2009-08-29 01:29:02 UTC
I had the same installation problems using a stock Fedora 11 install and a Brother HL-4070DW printer.  Using "Find Network Printer," I got the above results.  I was able to configure the printer properly by selecting the "AppSocket/HP Jetdirect" option, using port 9100, entering the IP address of the printer, and choosing the model from the list.  I can't say why this method works and the other doesn't.

Comment 17 Tim Waugh 2011-01-27 13:30:54 UTC
*** Bug 673067 has been marked as a duplicate of this bug. ***

Comment 18 Javier Jardón 2011-01-27 18:13:12 UTC
Hello, I'm the reporter of bug #673067.

Can we have a temporal solution before CUPS 1.5 was released? It's a pity that the printer detection works out-of-the-box in other distributions ( Ubuntu ) but not in fedora

Comment 19 Tim Waugh 2011-01-28 09:00:47 UTC
We could try performing DNS look-ups for names that don't contain ".".

Comment 20 Fedora Admin XMLRPC Client 2016-06-24 10:29:36 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 21 Zdenek Dohnal 2017-04-06 15:10:16 UTC
Hi Javier,

is your issue solved with current CUPS version in Fedora 25?

Comment 22 Zdenek Dohnal 2017-04-30 13:10:33 UTC
I conclude from comment #18 that issue is solved with cups-1.5. Closing this bug as CURRENTRELEASE.

Comment 23 Red Hat Bugzilla 2023-09-14 01:17:00 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days


Note You need to log in before you can comment on or make changes to this bug.