summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2009-08-13 01:11:19 +0000
committerdjm <djm@openbsd.org>2009-08-13 01:11:19 +0000
commitbc28bc524fedecea1f6efb668cea5cd66ade814c (patch)
tree797c86807e8fe1e05aeb317d2ddb85a30c5f5f5d
parentregression test for port number parsing. written as part of the a2port (diff)
downloadwireguard-openbsd-bc28bc524fedecea1f6efb668cea5cd66ade814c.tar.xz
wireguard-openbsd-bc28bc524fedecea1f6efb668cea5cd66ade814c.zip
Swizzle options: "-P sftp_server_path" moves to "-D sftp_server_path",
add "-P port" to match scp(1). Fortunately, the -P option is only really used by our regression scripts. part of larger patch from carlosvsilvapt@gmail.com for his Google Summer of Code work; ok deraadt markus
-rw-r--r--usr.bin/ssh/sftp.119
-rw-r--r--usr.bin/ssh/sftp.c10
2 files changed, 18 insertions, 11 deletions
diff --git a/usr.bin/ssh/sftp.1 b/usr.bin/ssh/sftp.1
index d47ab1573ae..6cec52ae1c4 100644
--- a/usr.bin/ssh/sftp.1
+++ b/usr.bin/ssh/sftp.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: sftp.1,v 1.71 2009/08/12 06:31:42 jmc Exp $
+.\" $OpenBSD: sftp.1,v 1.72 2009/08/13 01:11:19 djm Exp $
.\"
.\" Copyright (c) 2001 Damien Miller. All rights reserved.
.\"
@@ -22,7 +22,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: August 12 2009 $
+.Dd $Mdocdate: August 13 2009 $
.Dt SFTP 1
.Os
.Sh NAME
@@ -35,10 +35,11 @@
.Op Fl B Ar buffer_size
.Op Fl b Ar batchfile
.Op Fl c Ar cipher
+.Op Fl D Ar sftp_server_path
.Op Fl F Ar ssh_config
.Op Fl i Ar identity_path
.Op Fl o Ar ssh_option
-.Op Fl P Ar sftp_server_path
+.Op Fl P Ar port
.Op Fl R Ar num_requests
.Op Fl S Ar program
.Op Fl s Ar subsystem | sftp_server
@@ -140,6 +141,11 @@ flag).
Selects the cipher to use for encrypting the data transfers.
This option is directly passed to
.Xr ssh 1 .
+.It Fl D Ar sftp_server_path
+Connect directly to a local sftp server
+(rather than via
+.Xr ssh 1 ) .
+This option may be useful in debugging the client and server.
.It Fl F Ar ssh_config
Specifies an alternative
per-user configuration file for
@@ -215,11 +221,8 @@ For full details of the options listed below, and their possible values, see
.It UserKnownHostsFile
.It VerifyHostKeyDNS
.El
-.It Fl P Ar sftp_server_path
-Connect directly to a local sftp server
-(rather than via
-.Xr ssh 1 ) .
-This option may be useful in debugging the client and server.
+.It Fl P Ar port
+Specifies the port to connect to on the remote host.
.It Fl q
Quiet mode: disables the progress meter as well as warning and
diagnostic messages from
diff --git a/usr.bin/ssh/sftp.c b/usr.bin/ssh/sftp.c
index 09d3a25c8dc..904c4e6b6ea 100644
--- a/usr.bin/ssh/sftp.c
+++ b/usr.bin/ssh/sftp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp.c,v 1.108 2009/08/12 00:13:00 djm Exp $ */
+/* $OpenBSD: sftp.c,v 1.109 2009/08/13 01:11:19 djm Exp $ */
/*
* Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
*
@@ -1660,7 +1660,8 @@ main(int argc, char **argv)
ll = SYSLOG_LEVEL_INFO;
infile = stdin;
- while ((ch = getopt(argc, argv, "1246hqvCc:i:o:s:S:b:B:F:P:R:")) != -1) {
+ while ((ch = getopt(argc, argv,
+ "1246hqvCc:D:i:o:s:S:b:B:F:P:R:")) != -1) {
switch (ch) {
/* Passed through to ssh(1) */
case '4':
@@ -1679,6 +1680,9 @@ main(int argc, char **argv)
showprogress = 0;
addargs(&args, "-%c", ch);
break;
+ case 'P':
+ addargs(&args, "-oPort %s", optarg);
+ break;
case 'v':
if (debug_level < 3) {
addargs(&args, "-v");
@@ -1711,7 +1715,7 @@ main(int argc, char **argv)
batchmode = 1;
addargs(&args, "-obatchmode yes");
break;
- case 'P':
+ case 'D':
sftp_direct = optarg;
break;
case 'R':