Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/ftp document https support, mentioning certificates ...



details:   https://anonhg.NetBSD.org/src/rev/1ec3f1770405
branches:  trunk
changeset: 783450:1ec3f1770405
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Dec 22 16:57:09 2012 +0000

description:
document https support, mentioning certificates are not validated, and obey
https_proxy.

diffstat:

 usr.bin/ftp/cmds.c   |   6 +++---
 usr.bin/ftp/cmdtab.c |   5 +++--
 usr.bin/ftp/fetch.c  |  10 ++++++----
 usr.bin/ftp/ftp.1    |  32 +++++++++++++++++++++++++++++---
 usr.bin/ftp/main.c   |   6 ++++--
 5 files changed, 45 insertions(+), 14 deletions(-)

diffs (192 lines):

diff -r d98c960917ef -r 1ec3f1770405 usr.bin/ftp/cmds.c
--- a/usr.bin/ftp/cmds.c        Sat Dec 22 08:12:26 2012 +0000
+++ b/usr.bin/ftp/cmds.c        Sat Dec 22 16:57:09 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cmds.c,v 1.134 2012/01/15 20:43:24 christos Exp $      */
+/*     $NetBSD: cmds.c,v 1.135 2012/12/22 16:57:09 christos Exp $      */
 
 /*-
  * Copyright (c) 1996-2009 The NetBSD Foundation, Inc.
@@ -96,7 +96,7 @@
 #if 0
 static char sccsid[] = "@(#)cmds.c     8.6 (Berkeley) 10/9/94";
 #else
-__RCSID("$NetBSD: cmds.c,v 1.134 2012/01/15 20:43:24 christos Exp $");
+__RCSID("$NetBSD: cmds.c,v 1.135 2012/12/22 16:57:09 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -2675,7 +2675,7 @@
                return;
        }
 
-#define        OPTIONINDENT ((int) sizeof("http_proxy"))
+#define        OPTIONINDENT ((int) sizeof("https_proxy"))
        if (argc == 1) {
                for (o = optiontab; o->name != NULL; o++) {
                        fprintf(ttyout, "%-*s\t%s\n", OPTIONINDENT,
diff -r d98c960917ef -r 1ec3f1770405 usr.bin/ftp/cmdtab.c
--- a/usr.bin/ftp/cmdtab.c      Sat Dec 22 08:12:26 2012 +0000
+++ b/usr.bin/ftp/cmdtab.c      Sat Dec 22 16:57:09 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cmdtab.c,v 1.51 2009/04/12 10:18:52 lukem Exp $        */
+/*     $NetBSD: cmdtab.c,v 1.52 2012/12/22 16:57:09 christos Exp $     */
 
 /*-
  * Copyright (c) 1996-2009 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
 #if 0
 static char sccsid[] = "@(#)cmdtab.c   8.4 (Berkeley) 10/9/94";
 #else
-__RCSID("$NetBSD: cmdtab.c,v 1.51 2009/04/12 10:18:52 lukem Exp $");
+__RCSID("$NetBSD: cmdtab.c,v 1.52 2012/12/22 16:57:09 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -298,6 +298,7 @@
        { "anonpass",   NULL },
        { "ftp_proxy",  NULL },
        { "http_proxy", NULL },
+       { "https_proxy",NULL },
        { "no_proxy",   NULL },
        { "pager",      NULL },
        { "prompt",     NULL },
diff -r d98c960917ef -r 1ec3f1770405 usr.bin/ftp/fetch.c
--- a/usr.bin/ftp/fetch.c       Sat Dec 22 08:12:26 2012 +0000
+++ b/usr.bin/ftp/fetch.c       Sat Dec 22 16:57:09 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fetch.c,v 1.199 2012/12/21 18:07:36 christos Exp $     */
+/*     $NetBSD: fetch.c,v 1.200 2012/12/22 16:57:09 christos Exp $     */
 
 /*-
  * Copyright (c) 1997-2009 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: fetch.c,v 1.199 2012/12/21 18:07:36 christos Exp $");
+__RCSID("$NetBSD: fetch.c,v 1.200 2012/12/22 16:57:09 christos Exp $");
 #endif /* not lint */
 
 /*
@@ -482,7 +482,7 @@
 /*
  * Retrieve URL, via a proxy if necessary, using HTTP.
  * If proxyenv is set, use that for the proxy, otherwise try ftp_proxy or
- * http_proxy as appropriate.
+ * http_proxy/https_proxy as appropriate.
  * Supports HTTP redirects.
  * Returns 1 on failure, 0 on completed xfer, -1 if ftp connection
  * is still open (e.g, ftp xfer with trailing /)
@@ -625,7 +625,9 @@
                int hasleading;
 
                if (proxyenv == NULL) {
-                       if (IS_HTTP_TYPE(urltype))
+                       if (urltype == HTTPS_URL_T)
+                               proxyenv = getoptionvalue("https_proxy");
+                       if (proxyenv == NULL && IS_HTTP_TYPE(urltype))
                                proxyenv = getoptionvalue("http_proxy");
                        else if (urltype == FTP_URL_T)
                                proxyenv = getoptionvalue("ftp_proxy");
diff -r d98c960917ef -r 1ec3f1770405 usr.bin/ftp/ftp.1
--- a/usr.bin/ftp/ftp.1 Sat Dec 22 08:12:26 2012 +0000
+++ b/usr.bin/ftp/ftp.1 Sat Dec 22 16:57:09 2012 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: ftp.1,v 1.133 2012/04/08 22:00:38 wiz Exp $
+.\"    $NetBSD: ftp.1,v 1.134 2012/12/22 16:57:10 christos Exp $
 .\"
 .\" Copyright (c) 1996-2010 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -57,7 +57,7 @@
 .\"
 .\"    @(#)ftp.1       8.3 (Berkeley) 10/9/94
 .\"
-.Dd March 5, 2010
+.Dd December 22, 2012
 .Dt FTP 1
 .Os
 .Sh NAME
@@ -1325,7 +1325,7 @@
 .Ar value
 are not given, display all of the options and their values.
 The currently supported options are:
-.Bl -tag -width "http_proxy" -offset indent
+.Bl -tag -width "https_proxy" -offset indent
 .It Cm anonpass
 Defaults to
 .Ev $FTPANONPASS
@@ -1335,6 +1335,9 @@
 .It Cm http_proxy
 Defaults to
 .Ev $http_proxy .
+.It Cm https_proxy
+Defaults to
+.Ev $https_proxy .
 .It Cm no_proxy
 Defaults to
 .Ev $no_proxy .
@@ -1742,6 +1745,29 @@
 (and optionally
 .Sq password )
 is in the URL, use them for the first attempt to authenticate.
+.\" https://[user[:password]@]host[:port]/path
+.It Li https:// Ns Oo Ar user Ns Oo Li \&: Ns Ar password Oc Ns Li \&@ Oc \
+Ns Ar host Ns Oo Li \&: Ns Ar port Oc Ns Li / Ns Ar path
+An
+.Tn HTTPS
+URL, retrieved using the
+.Tn HTTPS
+protocol.
+If
+.Ic "set https_proxy"
+is defined, it is used as a URL to an
+.Tn HTTPS
+proxy server.
+If
+.Tn HTTPS
+authorization is required to retrieve
+.Ar path ,
+and
+.Sq user
+(and optionally
+.Sq password )
+is in the URL, use them for the first attempt to authenticate.
+There is currently no certificate validation and verification.
 .\" file:///path
 .It Li file:/// Ns Ar path
 A local URL, copied from
diff -r d98c960917ef -r 1ec3f1770405 usr.bin/ftp/main.c
--- a/usr.bin/ftp/main.c        Sat Dec 22 08:12:26 2012 +0000
+++ b/usr.bin/ftp/main.c        Sat Dec 22 16:57:09 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.121 2012/12/21 18:07:36 christos Exp $      */
+/*     $NetBSD: main.c,v 1.122 2012/12/22 16:57:10 christos Exp $      */
 
 /*-
  * Copyright (c) 1996-2009 The NetBSD Foundation, Inc.
@@ -98,7 +98,7 @@
 #if 0
 static char sccsid[] = "@(#)main.c     8.6 (Berkeley) 10/9/94";
 #else
-__RCSID("$NetBSD: main.c,v 1.121 2012/12/21 18:07:36 christos Exp $");
+__RCSID("$NetBSD: main.c,v 1.122 2012/12/22 16:57:10 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -126,6 +126,7 @@
 
 #define        FTP_PROXY       "ftp_proxy"     /* env var with FTP proxy location */
 #define        HTTP_PROXY      "http_proxy"    /* env var with HTTP proxy location */
+#define        HTTPS_PROXY     "https_proxy"   /* env var with HTTPS proxy location */
 #define        NO_PROXY        "no_proxy"      /* env var with list of non-proxied
                                         * hosts, comma or space separated */
 
@@ -488,6 +489,7 @@
        setupoption("anonpass",         getenv("FTPANONPASS"),  anonpass);
        setupoption("ftp_proxy",        getenv(FTP_PROXY),      "");
        setupoption("http_proxy",       getenv(HTTP_PROXY),     "");
+       setupoption("https_proxy",      getenv(HTTPS_PROXY),    "");
        setupoption("no_proxy",         getenv(NO_PROXY),       "");
        setupoption("pager",            getenv("PAGER"),        DEFAULTPAGER);
        setupoption("prompt",           getenv("FTPPROMPT"),    DEFAULTPROMPT);



Home | Main Index | Thread Index | Old Index