mirror of
https://github.com/clearml/dropbear
synced 2025-01-31 02:46:58 +00:00
Fix for "-l" scp option
--HG-- extra : convert_revision : 700ba4c9a06b892fa9742bc8f3b6fe73a32f94f7
This commit is contained in:
parent
e089ee4d85
commit
70b7c24cb0
@ -143,12 +143,6 @@ void cli_getopts(int argc, char ** argv) {
|
||||
if (argv[i][0] == '-') {
|
||||
/* A flag *waves* */
|
||||
|
||||
if (strlen(argv[i]) > 2) {
|
||||
fprintf(stderr,
|
||||
"WARNING: Ignoring unknown argument '%s'\n", argv[i]);
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (argv[i][1]) {
|
||||
case 'p': /* remoteport */
|
||||
next = &cli_opts.remoteport;
|
||||
@ -205,6 +199,12 @@ void cli_getopts(int argc, char ** argv) {
|
||||
"WARNING: Ignoring unknown argument '%s'\n", argv[i]);
|
||||
break;
|
||||
} /* Switch */
|
||||
|
||||
/* Now we handle args where they might be "-luser" (no spaces)*/
|
||||
if (next && strlen(argv[i]) > 2) {
|
||||
*next = &argv[i][2];
|
||||
next = NULL;
|
||||
}
|
||||
|
||||
continue; /* next argument */
|
||||
|
||||
|
6
scp.c
6
scp.c
@ -178,8 +178,10 @@ do_cmd(char *host, char *remuser, char *cmd, int *fdin, int *fdout, int argc)
|
||||
close(pout[1]);
|
||||
|
||||
args.list[0] = ssh_program;
|
||||
if (remuser != NULL)
|
||||
addargs(&args, "-l%s", remuser);
|
||||
if (remuser != NULL) {
|
||||
addargs(&args, "-l");
|
||||
addargs(&args, "%s", remuser);
|
||||
}
|
||||
addargs(&args, "%s", host);
|
||||
addargs(&args, "%s", cmd);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user