Revert "urlapi: respect CURLU_ALLOW_SPACE and CURLU_NO_AUTHORITY for redirects"
No binary (build failed)
—
$ git checkout -f eef076baa696662c7393156a5b90b81042e83a17
Previous HEAD position was 954c7dfb91 sectransp.c: make the code c89 compatible
HEAD is now at eef076baa6 Revert "urlapi: respect CURLU_ALLOW_SPACE and CURLU_NO_AUTHORITY for redirects"
$ git clean -fdx
Removing Makefile.in
Removing aclocal.m4
Removing autom4te.cache/
Removing compile
Removing confdefs.h
Removing config.guess
Removing config.log
Removing config.sub
Removing configure
Removing conftest.c
Removing depcomp
Removing docs/Makefile.in
Removing docs/cmdline-opts/Makefile.in
Removing docs/examples/Makefile.in
Removing docs/libcurl/Makefile.in
Removing docs/libcurl/opts/Makefile.in
Removing include/Makefile.in
Removing include/curl/Makefile.in
Removing install-sh
Removing lib/Makefile.in
Removing lib/curl_config.h.in
Removing ltmain.sh
Removing m4/libtool.m4
Removing m4/ltoptions.m4
Removing m4/ltsugar.m4
Removing m4/ltversion.m4
Removing m4/lt~obsolete.m4
Removing missing
Removing packages/Makefile.in
Removing packages/vms/Makefile.in
Removing run-compiler
Removing scripts/Makefile.in
Removing src/Makefile.in
Removing test-driver
Removing tests/Makefile.in
Removing tests/certs/Makefile.in
Removing tests/certs/scripts/Makefile.in
Removing tests/data/Makefile.in
Removing tests/http/Makefile.in
Removing tests/http/clients/Makefile.in
Removing tests/libtest/Makefile.in
Removing tests/server/Makefile.in
Removing tests/unit/Makefile.in
$ autoreconf -fi
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
libtoolize: Remember to add 'LT_INIT' to configure.ac.
configure.ac:123: installing './compile'
configure.ac:439: installing './config.guess'
configure.ac:439: installing './config.sub'
configure.ac:123: installing './install-sh'
configure.ac:129: installing './missing'
docs/examples/Makefile.am: installing './depcomp'
parallel-tests: installing './test-driver'
$ bash -c find . -name config.guess -exec cp /usr/share/misc/config.guess {} \;
$ bash -c find . -name config.sub -exec cp /usr/share/misc/config.sub {} \;
$ chmod +x configure
$ ./configure --disable-shared --without-ssl --disable-docs
[TIMEOUT]
| @@ -618,8 +618,7 @@ static CURLUcode ipv6_parse(struct Curl_URL *u, char *hostname, | |
| } | |
| static CURLUcode hostname_check(struct Curl_URL *u, char *hostname, | |
| - | size_t hlen, /* length of hostname */ |
| - | unsigned int flags) |
| + | size_t hlen) /* length of hostname */ |
| { | |
| size_t len; | |
| DEBUGASSERT(hostname); | |
| @@ -629,10 +628,8 @@ static CURLUcode hostname_check(struct Curl_URL *u, char *hostname, | |
| else if(hostname[0] == '[') | |
| return ipv6_parse(u, hostname, hlen); | |
| else { | |
| - | static char bad_chars[] = " \r\n\t/:#?!@{}[]\\$\'\"^`*<>=;,+&()%"; |
| - | len = strcspn(hostname, (flags & CURLU_ALLOW_SPACE) |
| - | ? &bad_chars[1] /* space is allowed */ |
| - | : bad_chars); |
| + | /* letters from the second string are not ok */ |
| + | len = strcspn(hostname, " \r\n\t/:#?!@{}[]\\$\'\"^`*<>=;,+&()%"); |
| if(hlen != len) | |
| /* hostname with bad content */ | |
| return CURLUE_BAD_HOSTNAME; | |
| @@ -810,9 +807,8 @@ static CURLUcode parse_authority(struct Curl_URL *u, | |
| break; | |
| case HOST_NAME: | |
| result = urldecode_host(host); | |
| - | if(!result && !(flags & CURLU_NO_AUTHORITY)) |
| - | result = hostname_check(u, Curl_dyn_ptr(host), Curl_dyn_len(host), |
| - | flags); |
| + | if(!result) |
| + | result = hostname_check(u, Curl_dyn_ptr(host), Curl_dyn_len(host)); |
| break; | |
| case HOST_ERROR: | |
| result = CURLUE_OUT_OF_MEMORY; | |
| @@ -1898,7 +1894,7 @@ nomem: | |
| /* Skip hostname check, it's allowed to be empty. */ | |
| } | |
| else { | |
| - | if(!n || hostname_check(u, (char *)newp, n, flags)) { |
| + | if(!n || hostname_check(u, (char *)newp, n)) { |
| free((char *)newp); | |
| return CURLUE_BAD_HOSTNAME; | |
| } | |
| @@ -984,10 +984,6 @@ static const struct redircase set_url_list[] = { | |
| "../newpage", | |
| "http://user:[email protected]/newpage", | |
| 0, 0, CURLUE_OK}, | |
| - | {"http://user:[email protected]/path?query#frag", |
| - | "http://example org/", |
| - | "http://example org/", |
| - | 0, CURLU_ALLOW_SPACE, CURLUE_OK}, |
| {"http://user:[email protected]/path?query#frag", | |
| "http://?hi", | |
| "http:///?hi", | |