diff options
author | Colin Watson <cjwatson@debian.org> | 2019-10-09 22:59:48 +0100 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2019-10-09 23:39:39 +0100 |
commit | 767ee84d3465b6d244a9108de5c167a9ab866df9 (patch) | |
tree | 69b14ef6a62d7f133298a21d2ad6046f130b7801 /sftp.c | |
parent | ddeaf9ee7d5c6612b88f1c4a83fc6fbccb93bf60 (diff) | |
parent | efef12825b9582c1710da3b7e50135870963d4f4 (diff) |
New upstream release (8.1p1)
Diffstat (limited to 'sftp.c')
-rw-r--r-- | sftp.c | 29 |
1 files changed, 16 insertions, 13 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sftp.c,v 1.190 2019/01/21 22:50:42 tb Exp $ */ | 1 | /* $OpenBSD: sftp.c,v 1.195 2019/10/02 00:42:30 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org> | 3 | * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org> |
4 | * | 4 | * |
@@ -53,7 +53,6 @@ typedef void EditLine; | |||
53 | #include <stdio.h> | 53 | #include <stdio.h> |
54 | #include <string.h> | 54 | #include <string.h> |
55 | #include <unistd.h> | 55 | #include <unistd.h> |
56 | #include <stdarg.h> | ||
57 | 56 | ||
58 | #ifdef HAVE_UTIL_H | 57 | #ifdef HAVE_UTIL_H |
59 | # include <util.h> | 58 | # include <util.h> |
@@ -284,9 +283,7 @@ help(void) | |||
284 | "df [-hi] [path] Display statistics for current directory or\n" | 283 | "df [-hi] [path] Display statistics for current directory or\n" |
285 | " filesystem containing 'path'\n" | 284 | " filesystem containing 'path'\n" |
286 | "exit Quit sftp\n" | 285 | "exit Quit sftp\n" |
287 | "get [-afPpRr] remote [local] Download file\n" | 286 | "get [-afpR] remote [local] Download file\n" |
288 | "reget [-fPpRr] remote [local] Resume download file\n" | ||
289 | "reput [-fPpRr] [local] remote Resume upload file\n" | ||
290 | "help Display this help text\n" | 287 | "help Display this help text\n" |
291 | "lcd path Change local directory to 'path'\n" | 288 | "lcd path Change local directory to 'path'\n" |
292 | "lls [ls-options [path]] Display local directory listing\n" | 289 | "lls [ls-options [path]] Display local directory listing\n" |
@@ -297,10 +294,12 @@ help(void) | |||
297 | "lumask umask Set local umask to 'umask'\n" | 294 | "lumask umask Set local umask to 'umask'\n" |
298 | "mkdir path Create remote directory\n" | 295 | "mkdir path Create remote directory\n" |
299 | "progress Toggle display of progress meter\n" | 296 | "progress Toggle display of progress meter\n" |
300 | "put [-afPpRr] local [remote] Upload file\n" | 297 | "put [-afpR] local [remote] Upload file\n" |
301 | "pwd Display remote working directory\n" | 298 | "pwd Display remote working directory\n" |
302 | "quit Quit sftp\n" | 299 | "quit Quit sftp\n" |
300 | "reget [-fpR] remote [local] Resume download file\n" | ||
303 | "rename oldpath newpath Rename remote file\n" | 301 | "rename oldpath newpath Rename remote file\n" |
302 | "reput [-fpR] local [remote] Resume upload file\n" | ||
304 | "rm path Delete remote file\n" | 303 | "rm path Delete remote file\n" |
305 | "rmdir path Remove remote directory\n" | 304 | "rmdir path Remove remote directory\n" |
306 | "symlink oldpath newpath Symlink remote file\n" | 305 | "symlink oldpath newpath Symlink remote file\n" |
@@ -2189,7 +2188,7 @@ interactive_loop(struct sftp_conn *conn, char *file1, char *file2) | |||
2189 | el_set(el, EL_BIND, "^I", "ftp-complete", NULL); | 2188 | el_set(el, EL_BIND, "^I", "ftp-complete", NULL); |
2190 | /* enable ctrl-left-arrow and ctrl-right-arrow */ | 2189 | /* enable ctrl-left-arrow and ctrl-right-arrow */ |
2191 | el_set(el, EL_BIND, "\\e[1;5C", "em-next-word", NULL); | 2190 | el_set(el, EL_BIND, "\\e[1;5C", "em-next-word", NULL); |
2192 | el_set(el, EL_BIND, "\\e[5C", "em-next-word", NULL); | 2191 | el_set(el, EL_BIND, "\\e\\e[C", "em-next-word", NULL); |
2193 | el_set(el, EL_BIND, "\\e[1;5D", "ed-prev-word", NULL); | 2192 | el_set(el, EL_BIND, "\\e[1;5D", "ed-prev-word", NULL); |
2194 | el_set(el, EL_BIND, "\\e\\e[D", "ed-prev-word", NULL); | 2193 | el_set(el, EL_BIND, "\\e\\e[D", "ed-prev-word", NULL); |
2195 | /* make ^w match ksh behaviour */ | 2194 | /* make ^w match ksh behaviour */ |
@@ -2388,7 +2387,6 @@ main(int argc, char **argv) | |||
2388 | size_t num_requests = DEFAULT_NUM_REQUESTS; | 2387 | size_t num_requests = DEFAULT_NUM_REQUESTS; |
2389 | long long limit_kbps = 0; | 2388 | long long limit_kbps = 0; |
2390 | 2389 | ||
2391 | ssh_malloc_init(); /* must be called before any mallocs */ | ||
2392 | /* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */ | 2390 | /* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */ |
2393 | sanitise_stdfd(); | 2391 | sanitise_stdfd(); |
2394 | msetlocale(); | 2392 | msetlocale(); |
@@ -2528,12 +2526,17 @@ main(int argc, char **argv) | |||
2528 | port = tmp; | 2526 | port = tmp; |
2529 | break; | 2527 | break; |
2530 | default: | 2528 | default: |
2529 | /* Try with user, host and path. */ | ||
2531 | if (parse_user_host_path(*argv, &user, &host, | 2530 | if (parse_user_host_path(*argv, &user, &host, |
2532 | &file1) == -1) { | 2531 | &file1) == 0) |
2533 | /* Treat as a plain hostname. */ | 2532 | break; |
2534 | host = xstrdup(*argv); | 2533 | /* Try with user and host. */ |
2535 | host = cleanhostname(host); | 2534 | if (parse_user_host_port(*argv, &user, &host, NULL) |
2536 | } | 2535 | == 0) |
2536 | break; | ||
2537 | /* Treat as a plain hostname. */ | ||
2538 | host = xstrdup(*argv); | ||
2539 | host = cleanhostname(host); | ||
2537 | break; | 2540 | break; |
2538 | } | 2541 | } |
2539 | file2 = *(argv + 1); | 2542 | file2 = *(argv + 1); |