Bug 1074245

Summary: Cannot enter IPv6 IPs as host for JetDirect printers
Product: [Fedora] Fedora Reporter: Till Maas <opensource>
Component: system-config-printerAssignee: Tim Waugh <twaugh>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: collura, jpopelka, opensource, ovasik, twaugh
Target Milestone: ---Keywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: system-config-printer-1.4.5-1.fc20 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-07-10 00:23:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 195271    
Attachments:
Description Flags
allow characters needed by IPv6 address in URI fields none

Description Till Maas 2014-03-09 08:05:10 UTC
Description of problem:
When I tried to add a IPv6 IP as host for a JetDirect printer, system-config-printer did not accept the colons.

Version-Release number of selected component (if applicable):
system-config-printer-1.4.3-2.fc19

How reproducible:
always

Steps to Reproduce:
1. Add a printer
2. Select network printer/JetDirect
3. Enter fe80::1

Actual results:
The colons cannot be entered

Expected results:
Should accept IPv6 address.


Additional info:

Comment 1 Till Maas 2014-03-09 08:16:21 UTC
(In reply to Till Maas from comment #0)

> 3. Enter fe80::1

Actually a percent sign might be needed for IPv6 addresses as well, e.g. fe80::1%eth0

Comment 2 Jaromír Končický 2014-03-13 11:58:26 UTC
That's because there are limited allowed characters, only aplhanumeric, '_', '-' and '.' can be entered.
However you can change this by editing /usr/share/system-config-printer/newprinter.py file. Find the function "on_entNPTJetDirectHostname_changed" (it should be approx. line 2600) and add ':', '[' and ']' into allowed characters, like:

        allowed_chars = string.ascii_letters+string.digits+'_-.:[]'

Then save, run system-config-printer again and enter IPv6 address inside [ and ] like "[fe80::1]" and it should accept it.
I do not have IPv6 printer here right now so I cannot test it, so I'd like you to report if the IPv6 printer works for you. If yes then s-c-p will be fixed this way.

Comment 3 Till Maas 2014-03-15 10:57:15 UTC
(In reply to Jaromír Končický from comment #2)
> That's because there are limited allowed characters, only aplhanumeric, '_',
> '-' and '.' can be entered.
> However you can change this by editing
> /usr/share/system-config-printer/newprinter.py file. Find the function
> "on_entNPTJetDirectHostname_changed" (it should be approx. line 2600) and
> add ':', '[' and ']' into allowed characters, like:
> 
>         allowed_chars = string.ascii_letters+string.digits+'_-.:[]'
> 
> Then save, run system-config-printer again and enter IPv6 address inside [
> and ] like "[fe80::1]" and it should accept it.
> I do not have IPv6 printer here right now so I cannot test it, so I'd like
> you to report if the IPv6 printer works for you. If yes then s-c-p will be
> fixed this way.

It also needs a percent sign. There are also other network protocols that seem to restrict the allowed characters, e.g. samba or ipp. However after adding missing characters to several allowed_chars lists it works.


Note to self: it is possible to set the IPv6 address as follows:
/usr/sbin/lpadmin -p example -v 'socket://[fe80::1%25eth0]:9100'

Comment 4 Jaromír Končický 2014-03-17 10:19:03 UTC
(In reply to Till Maas from comment #3)
> 
> It also needs a percent sign. 
Yes, % will be added into allowed characters too. 

> There are also other network protocols that
> seem to restrict the allowed characters, e.g. samba or ipp. 
Yes. As I can see, only [ and ] need to be added because : and % are already allowed. 

> However after
> adding missing characters to several allowed_chars lists it works.
It works - you mean that just entering the IPv6 address works or you tested printing with an IPv6-address printer and it worked?

Comment 5 Till Maas 2014-03-17 11:37:57 UTC
(In reply to Jaromír Končický from comment #4)
> (In reply to Till Maas from comment #3)

> > However after
> > adding missing characters to several allowed_chars lists it works.
> It works - you mean that just entering the IPv6 address works or you tested
> printing with an IPv6-address printer and it worked?

I did not yet print but getting cartridge information worked, so it seems to work in general.

Comment 6 Jaromír Končický 2014-03-17 14:07:51 UTC
Created attachment 875497 [details]
allow characters needed by IPv6 address in URI fields

Here is the patch. Assuming that printing on IPv6 printers is working, this should fix the issue.
It's upstream-based so I suggest commiting it into upstream.

Comment 8 Fedora Update System 2014-07-04 16:31:48 UTC
system-config-printer-1.4.5-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/system-config-printer-1.4.5-1.fc20

Comment 9 Fedora Update System 2014-07-05 14:55:41 UTC
Package system-config-printer-1.4.5-1.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing system-config-printer-1.4.5-1.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-8100/system-config-printer-1.4.5-1.fc20
then log in and leave karma (feedback).

Comment 10 Fedora Update System 2014-07-10 00:23:59 UTC
system-config-printer-1.4.5-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.