Created attachment 325231 [details] Patch to /usr/share/system-config-network/netconfpkg/NC_functions.py Description of problem: Line 250 in the file /usr/share/system-config-network/netconfpkg/NC_functions.py The Python regular expression does not match host name parts of a single letter. Thus, hostnames like "a.example.com" will be rejected when parsing /etc/hosts. Version-Release number of selected component (if applicable): system-config-network-1.5.93-2.fc10.noarch How reproducible: Always Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info: I did some research on Google and found an IETF RFC about valid hostnames: "RFC 1123 -- Requirements for Internet Hosts -- Application and Support". The part related to hostname is here: http://tools.ietf.org/html/rfc1123#page-13 It made a reference to RFC 952, to which a modification is added. In RFC 952, I found the original BNF for valid hostname is buried in its spec for DoD internet hostname table. Namely, it's in the BNFs <hname> (http://tools.ietf.org/html/rfc952#page-5). RFC 1123 made a revision to allow hostnames to begin with a digit. Therefore I made a patch in accordance with RFC 1123. The regular expression in the patch is a direct transliteration of the one found in RFC 952 plus the modification made by RFC 1123. There's one thing I'm not sure about though. According to the RFCs, hostnames like "foo--a-bar.example.com" are valid. However I'm yet to see any real example of hostnames with consecutive hyphens in it. The original Python code rejects this kinds of names, but the RFC seems to allow them and so does my patch. This bug was discovered by the user "ssivil" of FedoraForum.org. Another user "arvinddeshpande" spotted the offending file, and I made the patch. The original discussion can be found at http://forums.fedoraforum.org/showthread.php?t=205903 (I also posted the patch in that discussion). BTW, the RFC use the so-called "Augemented BNF" (http://en.wikipedia.org/wiki/ABNF).
*** Bug 473858 has been marked as a duplicate of this bug. ***
Hi, thanks for patch, I'll review the regexp ASAP and make an update with it. Jirka
$ python Python 2.5.1 (r251:54863, May 18 2007, 16:56:43) [GCC 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> #'([a-zA-Z]|[0-9])(([a-zA-Z]|[0-9]|-)*([a-zA-Z]|[0-9]))?$') ... >>> import re >>> pat = re.compile('([a-zA-Z]|[0-9])(([a-zA-Z]|[0-9]|-)*([a-zA-Z]|[0-9]))?$') >>> pat <_sre.SRE_Pattern object at 0x6d6148> >>> pat.match('a') <_sre.SRE_Match object at 0x7ff78cd8> >>> pat.match('b') <_sre.SRE_Match object at 0x7ff78d30> >>> pat.match('9') <_sre.SRE_Match object at 0x7ff78cd8> >>> pat.match('a9') <_sre.SRE_Match object at 0x7ff78d30> >>> pat.match('a9-') >>> pat.match('-a9') >>> pat.match('-a9-') >>> pat.match('a9') <_sre.SRE_Match object at 0x7ff78cd8> >>> pat.match('a9-abc') <_sre.SRE_Match object at 0x7ff78d30> >>> pat.match('abc_abcd') >>> pat.match('9') <_sre.SRE_Match object at 0x7ff78cd8> >>> pat.match('-') >>> pat.match('a-') >>> pat.match('a-d') <_sre.SRE_Match object at 0x7ff78d30> >>> pat.match('a_d') >>>
Care for beta test? http://people.fedoraproject.org/~jmoskovc/system-config-network-1.5.95-1.fc10.noarch.rpm http://people.fedoraproject.org/~jmoskovc/system-config-network-tui-1.5.95-1.fc10.noarch.rpm
system-config-network-1.5.95-1.fc10 has been submitted as an update for Fedora 10. http://admin.fedoraproject.org/updates/system-config-network-1.5.95-1.fc10
system-config-network-1.5.95-1.fc10 has been pushed to the Fedora 10 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update system-config-network'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F10/FEDORA-2008-11472
system-config-network-1.5.95-1.fc10 has been pushed to the Fedora 10 stable repository. If problems still persist, please make note of it in this bug report.