GNU bug report logs -
#10410
guile: uri module confused by domain names starting with numbers, ipv6 addresses
Previous Next
Reported by: Daniel Hartwig <mandyke <at> gmail.com>
Date: Fri, 30 Dec 2011 10:18:02 UTC
Severity: normal
Tags: patch
Found in version 2.0.3
Done: Andy Wingo <wingo <at> pobox.com>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 10410 in the body.
You can then email your comments to 10410 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
guile-devel <at> gnu.org, bug-guile <at> gnu.org
:
bug#10410
; Package
guile
.
(Fri, 30 Dec 2011 10:18:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Daniel Hartwig <mandyke <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
guile-devel <at> gnu.org, bug-guile <at> gnu.org
.
(Fri, 30 Dec 2011 10:18:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Package: guile
Version: 2.0.3
Tags: patch
X-Debbugs-CC: guile-devel <at> gnu.org
Hello
I have noticed that the (web uri) module does not handle domain names
that start with numbers:
scheme@(guile-user)> (string->uri "http://123.com")
$1 = #f
scheme@(guile-user)> (build-uri 'http #:host "123.com")
web/uri.scm:85:6: In procedure build-uri:
web/uri.scm:85:6: Throw to key `uri-error' with args `("Expected valid
host: ~s" ("123.com"))'.
Also, `string->uri' does not handle ipv6 addresses:
scheme@(guile-user)> (string->uri "http://[2001:db8::1]")
$2 = #f
Attached patch implements support for domain names that start with
numbers by correcting the
regular expressions used by `valid-host?' as well as some related tests.
`string->uri' requires similar changes to support the ipv6 address
literals. I'm yet to found a very elegant way to do this though it is
easy enough to simply butcher `authority-pat'.
[0001-support-URIs-with-domain-names-starting-with-numbers.patch (text/x-patch, attachment)]
Information forwarded
to
bug-guile <at> gnu.org
:
bug#10410
; Package
guile
.
(Fri, 30 Dec 2011 16:31:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 10410 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On 30 December 2011 18:14, Daniel Hartwig <mandyke <at> gmail.com> wrote:
>
> `string->uri' requires similar changes to support the ipv6 address
> literals. I'm yet to found a very elegant way to do this though it is
> easy enough to simply butcher `authority-pat'.
So the issue was really with `parse-authority'.
The attached patch cleans this up with support for IPv6 (including
dotted-quad notation), fixes some typos in the tests, and adds new
tests.
With both patches applied the web-uri.test now passes for all tests
and I can finally do:
scheme@(guile-user)> (string->uri "http://[::ffff:192.0.2.1]/foo")
$2 = #<<uri> scheme: http userinfo: #f host: "[::ffff:192.0.2.1]"
port: #f path: "/foo" query: #f fragment: #f>
scheme@(guile-user)> (string->uri "http://123.com")
$3 = #<<uri> scheme: http userinfo: #f host: "123.com" port: #f path:
"" query: #f fragment: #f>
[0002-enhance-IPv6-support.patch (text/x-patch, attachment)]
Information forwarded
to
bug-guile <at> gnu.org
:
bug#10410
; Package
guile
.
(Wed, 22 Feb 2012 06:19:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 10410 <at> debbugs.gnu.org (full text, mbox):
Bumping this bug report as it is relevant to commit 1868309 which
recently addressed the issue with domain names starting with numbers.
> author Andy Wingo <wingo <at> pobox.com> 2012-02-21 16:42:53 (GMT)
> commit 1868309a9e34a04a5b3020e147d0ce029038b290 (patch) (side-by-side diff)
> ...
> (define ipv6-regexp
> - (make-regexp "^\\[([0-9a-fA-F:]+)\\]+"))
> + (make-regexp "^\\[([0-9a-fA-F:]+)\\]+$"))
Please compare this regexp to the one in the previously sent 0001
patch. You will note that the second "+" here matches values with
extraneous characters such as "[::1]]]".
Also, the character group does not include a "." which is valid in
ipv6 addresses with dotted-quad notation[1]. This is introduced by
the 0002 patch (see below).
0001 provides additional test cases handling domains names starting
with numbers as well.
Daniel Hartwig <mandyke <at> gmail.com> wrote:
> Also, `string->uri' does not handle ipv6 addresses:
>
> scheme@(guile-user)> (string->uri "http://[2001:db8::1]")
> $2 = #f
This issue remains outstanding and addressed in the 0002 patch with
test cases provided.
Regards
[1] http://tools.ietf.org/html/rfc1884#page-5
3. An alternative form that is sometimes more convenient when
dealing with a mixed environment of IPv4 and IPv6 nodes is
x:x:x:x:x:x:d.d.d.d, where the 'x's are the hexadecimal values
of the six high-order 16-bit pieces of the address, and the 'd's
are the decimal values of the four low-order 8-bit pieces of the
address (standard IPv4 representation). Examples:
0:0:0:0:0:0:13.1.68.3
0:0:0:0:0:FFFF:129.144.52.38
or in compressed form:
::13.1.68.3
::FFFF:129.144.52.38
Information forwarded
to
bug-guile <at> gnu.org
:
bug#10410
; Package
guile
.
(Wed, 20 Jun 2012 13:43:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 10410 <at> debbugs.gnu.org (full text, mbox):
Hi Daniel,
Daniel Hartwig <mandyke <at> gmail.com> skribis:
> I have noticed that the (web uri) module does not handle domain names
> that start with numbers:
>
> scheme@(guile-user)> (string->uri "http://123.com")
> $1 = #f
This one was fixed around commit 1868309a9e34a04a5b3020e147d0ce029038b290.
Thanks,
Ludo’.
Reply sent
to
Andy Wingo <wingo <at> pobox.com>
:
You have taken responsibility.
(Fri, 06 Jul 2012 12:17:04 GMT)
Full text and
rfc822 format available.
Notification sent
to
Daniel Hartwig <mandyke <at> gmail.com>
:
bug acknowledged by developer.
(Fri, 06 Jul 2012 12:17:04 GMT)
Full text and
rfc822 format available.
Message #19 received at 10410-done <at> debbugs.gnu.org (full text, mbox):
On Wed 22 Feb 2012 07:15, Daniel Hartwig <mandyke <at> gmail.com> writes:
> Bumping this bug report as it is relevant to commit 1868309 which
> recently addressed the issue with domain names starting with numbers.
Sorry for the long delay. I have applied your patches on my hasty
commits. There were a couple bugs that this brought out; for example on
my system, inet-pton does not expect the address to be surrounded by
[]. I fixed this to have the uri-host / build-uri #:host to never have
brackets.
WDYT? Marking as done as your code is in, with tests. Thanks very much
for the report and patch!
Andy
--
http://wingolog.org/
Information forwarded
to
bug-guile <at> gnu.org
:
bug#10410
; Package
guile
.
(Sat, 07 Jul 2012 04:07:02 GMT)
Full text and
rfc822 format available.
Message #22 received at 10410 <at> debbugs.gnu.org (full text, mbox):
On 6 July 2012 19:15, Andy Wingo <wingo <at> pobox.com> wrote:
> On Wed 22 Feb 2012 07:15, Daniel Hartwig <mandyke <at> gmail.com> writes:
>
>> Bumping this bug report as it is relevant to commit 1868309 which
>> recently addressed the issue with domain names starting with numbers.
>
> Sorry for the long delay.
Please, no :-) Your meticulous approach to maintenance is
commendable. All are confident of the eventuality of the next “serial
processing” session.
> I have applied your patches on my hasty
> commits. There were a couple bugs that this brought out; for example on
> my system, inet-pton does not expect the address to be surrounded by
> [].
Nice spot. Evidently when I originally looked in to this I did not
get much past string->uri and assumed the job done (*what* happened to
the actual task I was trying to complete then?!)
> I fixed this to have the uri-host / build-uri #:host to never have
> brackets.
Works well. One small nitpick, depending on what uri-host is defined
to be returning this may or may not differ from spec.:
host = IP-literal / IPv4address / reg-name
IP-literal = "[" ( IPv6address / IPvFuture ) "]"
In my intuition, a call to build-uri is naturally of the form:
(build-uri #:scheme 'http
#:host "[2001:db8::1]")
Though, for convenience, this begs for a predicate or two for
ip-literals and conversion from ip-literal->ipv6-address.
Anyway, working is better than not working, thanks :-)
Information forwarded
to
bug-guile <at> gnu.org
:
bug#10410
; Package
guile
.
(Sat, 07 Jul 2012 09:44:01 GMT)
Full text and
rfc822 format available.
Message #25 received at 10410 <at> debbugs.gnu.org (full text, mbox):
Hi Daniel,
Thanks for testing (& for the original patches :)
On Sat 07 Jul 2012 06:01, Daniel Hartwig <mandyke <at> gmail.com> writes:
> One small nitpick, depending on what uri-host is defined to be
> returning this may or may not differ from spec.:
>
> host = IP-literal / IPv4address / reg-name
>
> IP-literal = "[" ( IPv6address / IPvFuture ) "]"
>
> In my intuition, a call to build-uri is naturally of the form:
>
> (build-uri #:scheme 'http
> #:host "[2001:db8::1]")
Yeah it is a bit confusing. I think the thing to do is to consider the
brackets as part of how ip-literals are delimited within a URI, and not
part of the host itself. Thus it would be Guile's responsibility to add
them or remove them. But as you say, this goes against the RFC.
At the same time, I'd like to be able to always pass the result of
inet-ntop to build-uri #:host.
The internet is a messy place!
Andy
--
http://wingolog.org/
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sat, 04 Aug 2012 11:24:03 GMT)
Full text and
rfc822 format available.
This bug report was last modified 12 years and 318 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.