summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@cvs.openbsd.org>2020-02-26 11:46:52 +0000
committerDarren Tucker <dtucker@cvs.openbsd.org>2020-02-26 11:46:52 +0000
commitfb45ee0a45364eeff0ab5dbbff8f2fd9f27266f9 (patch)
treef13b8fee3136ce0f9816115c17d50262d60232dd /usr.bin
parent80fee1cd1e94d1e7aed2538b0efb5412e2227e6f (diff)
Have sftp reject "-1" in the same way as ssh(1) and scp(1) do instead
of accepting and silently ignoring it since protocol 1 support has been removed. Spotted by shivakumar2696 at gmail.com, ok deraadt@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/ssh/sftp.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/usr.bin/ssh/sftp.c b/usr.bin/ssh/sftp.c
index 025102e9cbb..667540fc86f 100644
--- a/usr.bin/ssh/sftp.c
+++ b/usr.bin/ssh/sftp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp.c,v 1.197 2020/01/23 07:10:22 dtucker Exp $ */
+/* $OpenBSD: sftp.c,v 1.198 2020/02/26 11:46:51 dtucker Exp $ */
/*
* Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
*
@@ -2330,7 +2330,7 @@ main(int argc, char **argv)
{
int in, out, ch, err, tmp, port = -1;
char *host = NULL, *user, *cp, *file2 = NULL;
- int debug_level = 0, sshver = 2;
+ int debug_level = 0;
char *file1 = NULL, *sftp_server = NULL;
char *ssh_program = _PATH_SSH_PROGRAM, *sftp_direct = NULL;
const char *errstr;
@@ -2395,12 +2395,10 @@ main(int argc, char **argv)
debug_level++;
break;
case '1':
- sshver = 1;
- if (sftp_server == NULL)
- sftp_server = _PATH_SFTP_SERVER;
+ fatal("SSH protocol v.1 is no longer supported");
break;
case '2':
- sshver = 2;
+ /* accept silently */
break;
case 'a':
global_aflag = 1;
@@ -2505,7 +2503,6 @@ main(int argc, char **argv)
addargs(&args, "-l");
addargs(&args, "%s", user);
}
- addargs(&args, "-oProtocol %d", sshver);
/* no subsystem if the server-spec contains a '/' */
if (sftp_server == NULL || strchr(sftp_server, '/') == NULL)