Summary: | net-misc/curl-7.25.0-r1 USE=ipv6 - curl: (3) [globbing] error: bad range specification after pos 9 | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | DEMAINE Benoît-Pierre, aka DoubleHP <dhp_gentoo> |
Component: | Current packages | Assignee: | Anthony Basile <blueness> |
Status: | RESOLVED WONTFIX | ||
Severity: | normal | CC: | gregkh, jer |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://bugs.gentoo.org/show_bug.cgi?id=431314 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | /tmp/emerge--info |
Description
DEMAINE Benoît-Pierre, aka DoubleHP
2012-08-14 04:15:49 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. "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. 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. 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 ... |