summaryrefslogtreecommitdiff
path: root/usr.bin/ftp
diff options
context:
space:
mode:
authorJeremie Courreges-Anglas <jca@cvs.openbsd.org>2019-12-09 00:45:35 +0000
committerJeremie Courreges-Anglas <jca@cvs.openbsd.org>2019-12-09 00:45:35 +0000
commit05f9cdae2e35578636231c7ea6b3da62121200f6 (patch)
tree3ccd0a37a101e2c39aa73cb203ce67ce57c802f9 /usr.bin/ftp
parent59a849047bf1a5434c14f88c82136f24461f9b9f (diff)
With NOSSL let url_get() print a nice error message for https urls
Input from deraadt@
Diffstat (limited to 'usr.bin/ftp')
-rw-r--r--usr.bin/ftp/fetch.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/usr.bin/ftp/fetch.c b/usr.bin/ftp/fetch.c
index 7f55a7b0deb..c795c701291 100644
--- a/usr.bin/ftp/fetch.c
+++ b/usr.bin/ftp/fetch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fetch.c,v 1.182 2019/12/08 23:43:53 jca Exp $ */
+/* $OpenBSD: fetch.c,v 1.183 2019/12/09 00:45:34 jca Exp $ */
/* $NetBSD: fetch.c,v 1.14 1997/08/18 10:20:20 lukem Exp $ */
/*-
@@ -240,14 +240,16 @@ url_get(const char *origline, const char *proxyenv, const char *outfile, int las
#ifndef SMALL
scheme = FILE_URL;
#endif /* !SMALL */
-#ifndef NOSSL
} else if (strncasecmp(newline, HTTPS_URL, sizeof(HTTPS_URL) - 1) == 0) {
+#ifndef NOSSL
host = newline + sizeof(HTTPS_URL) - 1;
ishttpsurl = 1;
+#else
+ errx(1, "%s: No HTTPS support", newline);
+#endif /* !NOSSL */
#ifndef SMALL
scheme = HTTPS_URL;
#endif /* !SMALL */
-#endif /* !NOSSL */
} else
errx(1, "url_get: Invalid URL '%s'", newline);
@@ -1266,10 +1268,7 @@ auto_fetch(int argc, char *argv[], char *outfile)
* Try HTTP URL-style arguments first.
*/
if (strncasecmp(url, HTTP_URL, sizeof(HTTP_URL) - 1) == 0 ||
-#ifndef NOSSL
- /* even if we compiled without SSL, url_get will check */
strncasecmp(url, HTTPS_URL, sizeof(HTTPS_URL) -1) == 0 ||
-#endif /* !NOSSL */
strncasecmp(url, FILE_URL, sizeof(FILE_URL) - 1) == 0) {
redirect_loop = 0;
retried = 0;