Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URL parsing regression #3817

Closed
arewx opened this issue Apr 30, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@arewx
Copy link

commented Apr 30, 2019

I did this

[xiaomen@localhost bin]$ ls
c_rehash curl curl-config openssl
[xiaomen@localhost bin]$ ./curl -V
curl 7.64.1 (x86_64-pc-linux-gnu) libcurl/7.64.1 OpenSSL/1.0.2r zlib/1.2.11 libssh2/1.8.2
Release-Date: 2019-03-27
Protocols: dict file ftp ftps gopher http https rtsp scp sftp smb smbs telnet tftp
Features: AsynchDNS Debug HTTPS-proxy IPv6 Largefile libz NTLM NTLM_WB SSL TLS-SRP TrackMemory UnixSockets
[xiaomen@localhost bin]$ ./curl --url sftp://root:SYS2009health@[fe80::20c:29ff:fe9c:409b%eth0] -T ../file_dx -k
curl: (3) URL using bad/illegal format or missing URL
[xiaomen@localhost bin]$ ping6 fe80::20c:29ff:fe9c:409b%eth0
PING fe80::20c:29ff:fe9c:409b%eth0(fe80::20c:29ff:fe9c:409b) 56 data bytes
64 bytes from fe80::20c:29ff:fe9c:409b: icmp_seq=1 ttl=64 time=5.42 ms
64 bytes from fe80::20c:29ff:fe9c:409b: icmp_seq=2 ttl=64 time=0.231 ms
64 bytes from fe80::20c:29ff:fe9c:409b: icmp_seq=3 ttl=64 time=0.263 ms
64 bytes from fe80::20c:29ff:fe9c:409b: icmp_seq=4 ttl=64 time=0.316 ms
64 bytes from fe80::20c:29ff:fe9c:409b: icmp_seq=5 ttl=64 time=0.318 ms
^C
--- fe80::20c:29ff:fe9c:409b%eth0 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4857ms
rtt min/avg/max/mdev = 0.231/1.309/5.421/2.056 ms
[xiaomen@localhost bin]$

But
[xiaomen@localhost bin]$ ls
c_rehash curl curl-config openssl
[xiaomen@localhost bin]$ ./curl -V
curl 7.60.0 (x86_64-pc-linux-gnu) libcurl/7.60.0 OpenSSL/1.0.2r zlib/1.2.11 libssh2/1.8.2
Release-Date: 2018-05-16
Protocols: dict file ftp ftps gopher http https rtsp scp sftp smb smbs telnet tftp
Features: AsynchDNS Debug TrackMemory IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP UnixSockets HTTPS-proxy
[xiaomen@localhost bin]$ ./curl --url sftp://root:SYS2009health@[fe80::20c:29ff:fe9c:409b%eth0] -T ../file_dx -k
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 3897 0 0 100 3897 0 22789 --:--:-- --:--:-- --:--:-- 23618
100 3897 0 0 100 3897 0 22789 --:--:-- --:--:-- --:--:-- 22789
[xiaomen@localhost bin]$
Why curl-7.60.0 can upload files successfully and curl-7.64.1 fails

I expected the following

curl/libcurl version

expect file could uploaded success
[curl -V output]
curl 7.64.1 (x86_64-pc-linux-gnu) libcurl/7.64.1 OpenSSL/1.0.2r zlib/1.2.11 libssh2/1.8.2
Release-Date: 2019-03-27
Protocols: dict file ftp ftps gopher http https rtsp scp sftp smb smbs telnet tftp
Features: AsynchDNS Debug HTTPS-proxy IPv6 Largefile libz NTLM NTLM_WB SSL TLS-SRP TrackMemory UnixSockets

operating system

ALL

@bagder bagder changed the title https://github.com/curl/curl/issues/3408 URL parsing regression Apr 30, 2019

@bagder

This comment has been minimized.

Copy link
Member

commented Apr 30, 2019

  1. comparing with ping is a bad idea since ping doesn't deal with URLs
  2. a scope id in a URL is written as '%25[id]'
  3. this is a regression in the sense that we did handle this before

@bagder bagder self-assigned this Apr 30, 2019

bagder added a commit that referenced this issue Apr 30, 2019

urlapi: strip off scope id from numerical IPv6 addresses
... to make the host name "usable". Store the scope id and put it back
when extracting a URL out of it.

Fixes #3817

bagder added a commit that referenced this issue May 2, 2019

urlapi: strip off scope id from numerical IPv6 addresses
... to make the host name "usable". Store the scope id and put it back
when extracting a URL out of it.

Also makes curl_url_set() syntax check CURLUPART_HOST.

Fixes #3817
Closes #3822

@bagder bagder closed this in bdb2dbc May 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.