Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 431310 - net-misc/curl-7.25.0-r1 USE=ipv6 - curl: (3) [globbing] error: bad range specification after pos 9
Summary: net-misc/curl-7.25.0-r1 USE=ipv6 - curl: (3) [globbing] error: bad range spec...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Anthony Basile
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-14 04:15 UTC by DEMAINE Benoît-Pierre, aka DoubleHP
Modified: 2012-08-22 00:35 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
/tmp/emerge--info (emerge--info,19.59 KB, text/plain)
2012-08-14 04:15 UTC, DEMAINE Benoît-Pierre, aka DoubleHP
Details

Note You need to log in before you can comment on or make changes to this bug.
Description DEMAINE Benoît-Pierre, aka DoubleHP 2012-08-14 04:15:49 UTC
Created attachment 321270 [details]
/tmp/emerge--info

dhp@uranus ~ $ curl -6 "http://[2a01:e35:8ba8:e140:201:3ff:fe0c:3d5b]"
curl: (3) [globbing] error: bad range specification after pos 9
dhp@uranus ~ $ curl -6 "http://[::1]"
curl: (3) [globbing] illegal character in range specification at pos 9
dhp@uranus ~ $ emerge -vp curl

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] net-misc/curl-7.25.0-r1  USE="idn ipv6 ssh ssl threads -ares -kerberos -ldap -static-libs -test" CURL_SSL="openssl -axtls -gnutls -nss -polarssl" 0 kB

Total: 1 package (1 reinstall), Size of downloads: 0 kB

 * IMPORTANT: 4 news items need reading for repository 'gentoo'.
 * Use eselect news to read news items.

dhp@uranus ~ $
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2012-08-14 13:11:46 UTC
Wouldn't it just work without the square brackets?

jer@wieneke $ curl -6 "http://[2a01:e35:8ba8:e140:201:3ff:fe0c:3d5b]"
curl: (3) [globbing] error: bad range specification after pos 9
jer@wieneke $ curl -6 "http://2a01:e35:8ba8:e140:201:3ff:fe0c:3d5b"
curl: (7) Failed to connect to 2a01:e35:8ba8:e140:201:3ff:fe0c:3d5b: Network is unreachable

At least in the second case, curl recognises the URL.
Comment 2 DEMAINE Benoît-Pierre, aka DoubleHP 2012-08-14 19:40:48 UTC
"http://[2a01:e35:8ba8:e140:201:3ff:fe0c:3d5b]" is what works in lynx and firefox.

When using your second line, I don't get the right content.
Comment 3 Greg Kubaryk 2012-08-15 01:55:30 UTC
From the manpage:

       -g, --globoff
              This option switches off the "URL globbing parser". When you set this option, you can specify URLs  that
              contain  the  letters {}[] without having them being interpreted by curl itself. Note that these letters
              are not normal legal URL contents but they should be encoded according to the URI standard.

Solution: Use -g

Hope this helps.
Comment 4 DEMAINE Benoît-Pierre, aka DoubleHP 2012-08-15 03:23:43 UTC
dhp@uranus ~ $ curl -g "http://fe80::201:3ff:fe0c:3d5b%eth0"
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
  <title>400 - Bad Request</title>
 </head>
 <body>
  <h1>400 - Bad Request</h1>
 </body>
</html>
dhp@uranus ~ $ curl -g 'http://fe80::201:3ff:fe0c:3d5b%eth0'
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
  <title>400 - Bad Request</title>
 </head>
 <body>
  <h1>400 - Bad Request</h1>
 </body>
</html>
dhp@uranus ~ $ curl -g 'http://[fe80::201:3ff:fe0c:3d5b%eth0]'
curl: (6) Could not resolve host: [fe80::201:3ff:fe0c:3d5b%eth0]; Name or service not known
dhp@uranus ~ $ curl -g 'http://[fe80::201:3ff:fe0c:3d5b%250]'
curl: (7) Failed to connect to fe80::201:3ff:fe0c:3d5b: Invalid argument
dhp@uranus ~ $ curl -g 'http://[fe80::201:3ff:fe0c:3d5b%251]'
curl: (7) Failed to connect to fe80::201:3ff:fe0c:3d5b: Network is unreachable
dhp@uranus ~ $ curl -g 'http://[fe80::201:3ff:fe0c:3d5b%252]'
curl: (7) Failed to connect to fe80::201:3ff:fe0c:3d5b: Network is unreachable
dhp@uranus ~ $

Works for me with 
'http://[fe80::201:3ff:fe0c:3d5b%256]'

'http://[fe80::201:3ff:fe0c:3d5b%eth0]'
works with firefox just fine, but gives an error with curl.

'http://fe80::201:3ff:fe0c:3d5b%eth0'
gives an HTML content, but not the good one, and ... I even wonder if this content is really generated by the server I think about.

Even with -g, curl does not accept conventional syntax, and seems to use a syntax similar to the one used in Windows (by NIC #), whereas on Gentoo, I was expecting curl to accept the BSD syntax (%ifname).

If ever you would close this bug with "WORKSFORME" or "CANTFIX", please update the manpage, to explain that curl uses a counter intuitive syntax. What is counter intuitive should for the least be documented. But the best fix would be to make curl accept conventional BSD syntax ...