mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-28 16:24:39 +02:00
upstream: Check for user@host when parsing sftp target. This
allows user@[1.2.3.4] to work without a path in addition to with one. bz#2999, ok djm@ OpenBSD-Commit-ID: d989217110932490ba8ce92127a9a6838878928b
This commit is contained in:
parent
0323d9b619
commit
25e3bccbaa
17
sftp.c
17
sftp.c
@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: sftp.c,v 1.191 2019/06/06 05:13:13 otto Exp $ */
|
/* $OpenBSD: sftp.c,v 1.192 2019/06/07 03:47:12 dtucker Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
|
* Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
|
||||||
*
|
*
|
||||||
@ -2527,12 +2527,17 @@ main(int argc, char **argv)
|
|||||||
port = tmp;
|
port = tmp;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
/* Try with user, host and path. */
|
||||||
if (parse_user_host_path(*argv, &user, &host,
|
if (parse_user_host_path(*argv, &user, &host,
|
||||||
&file1) == -1) {
|
&file1) == 0)
|
||||||
/* Treat as a plain hostname. */
|
break;
|
||||||
host = xstrdup(*argv);
|
/* Try with user and host. */
|
||||||
host = cleanhostname(host);
|
if (parse_user_host_port(*argv, &user, &host, NULL)
|
||||||
}
|
== 0)
|
||||||
|
break;
|
||||||
|
/* Treat as a plain hostname. */
|
||||||
|
host = xstrdup(*argv);
|
||||||
|
host = cleanhostname(host);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
file2 = *(argv + 1);
|
file2 = *(argv + 1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user