mirror of
https://github.com/clearml/dropbear
synced 2025-03-04 11:09:19 +00:00
- Work around rsync and scp parsing and modifying the user@host argument,
which break's dbclient's multihop syntax --HG-- extra : convert_revision : cf704125a4785278aeb79f62bf025638e1b28e4c
This commit is contained in:
parent
643626d546
commit
299d26dab7
@ -412,7 +412,20 @@ static void parse_multihop_hostname(const char* orighostarg, const char* argv0)
|
|||||||
char *last_hop = NULL;;
|
char *last_hop = NULL;;
|
||||||
char *remainder = NULL;
|
char *remainder = NULL;
|
||||||
|
|
||||||
userhostarg = m_strdup(orighostarg);
|
/* both scp and rsync parse a user@host argument
|
||||||
|
* and turn it into "-l user host". This breaks
|
||||||
|
* for our multihop syntax, so we suture it back together.
|
||||||
|
* This will break usernames that have both '@' and ',' in them,
|
||||||
|
* though that should be fairly uncommon. */
|
||||||
|
if (cli_opts.username
|
||||||
|
&& strchr(cli_opts.username, ',')
|
||||||
|
&& strchr(cli_opts.username, '@')) {
|
||||||
|
unsigned int len = strlen(orighostarg) + strlen(cli_opts.username) + 2;
|
||||||
|
userhostarg = m_malloc(len);
|
||||||
|
snprintf(userhostarg, len, "%s@%s", cli_opts.username, orighostarg);
|
||||||
|
} else {
|
||||||
|
userhostarg = m_strdup(orighostarg);
|
||||||
|
}
|
||||||
|
|
||||||
last_hop = strrchr(userhostarg, ',');
|
last_hop = strrchr(userhostarg, ',');
|
||||||
if (last_hop) {
|
if (last_hop) {
|
||||||
|
Loading…
Reference in New Issue
Block a user