summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/sftp.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* typos in comments; GHPR#180 from Ville Skyttädjm2021-04-031-2/+2
|
* highly polished whitespace, mostly fixing spaces-for-tab and baddjm2021-04-031-2/+2
| | | | indentation on continuation lines. Prompted by GHPR#185
* Use new limits@openssh.com protocol extension to let the client selectdjm2021-03-311-6/+3
| | | | | | | | | | | good limits based on what the server supports. Split the download and upload buffer sizes to allow them to be chosen independently. In practice (and assuming upgraded sftp/sftp-server at each end), this increases the download buffer 32->64KiB and the upload buffer 32->255KiB. Patches from Mike Frysinger; ok dtucker@
* don't try to use timespeccmp(3) directly as a qsort(3) comparisondjm2021-01-081-4/+7
| | | | | | | | function - it returns 0/1 and not the -1/0/1 that qsort expectes. fixes sftp "ls -ltr" under some circumstances. Based on patch by Masahiro Matsuya via bz3248.
* shuffle a few utility functions into sftp-client.c; from Jakub Jelendjm2020-12-041-53/+5
|
* whitespace; no code changedjm2020-10-291-2/+2
|
* use the new variant log macros instead of prepending __func__ anddjm2020-10-181-2/+2
| | | | appending ssh_err(r) manually; ok markus@
* Allow full range of UIDs and GIDs for sftp chown and chgrp on 32bitdtucker2020-10-041-6/+6
| | | | | platforms instead of being limited by LONG_MAX. bz#3206, found by booking00 at sina.cn, ok markus@
* allow -A to explicitly enable agent forwarding in scp and sftp. Thedjm2020-08-031-4/+7
| | | | | default remains to not forward an agent, even when ssh_config enables it. ok jmc dtucker markus
* sort -N and add it to usage();jmc2020-04-031-2/+2
|
* Add a flag to re-enable verbose output when in batch mode;djm2020-04-031-3/+9
| | | | requested in bz3135; ok dtucker
* Have sftp reject "-1" in the same way as ssh(1) and scp(1) do insteaddtucker2020-02-261-7/+4
| | | | | of accepting and silently ignoring it since protocol 1 support has been removed. Spotted by shivakumar2696 at gmail.com, ok deraadt@
* Replace all calls to signal(2) with a wrapper around sigaction(2).dtucker2020-01-231-13/+13
| | | | | | This wrapper blocks all other signals during the handler preventing races between handlers, and sets SA_RESTART which should reduce the potential for short read/write operations.
* fix a race condition in the SIGCHILD handler that could turn indjm2019-11-011-4/+7
| | | | to a kill(-1); bz3084, reported by Gao Rui, ok dtucker@
* remove some duplicate #includesdjm2019-10-021-2/+1
|
* Fix a typo and make <esc><right> move right to the closest end of a wordtb2019-07-101-2/+2
| | | | | | just like <esc><left> moves left to the closest beginning of a word. ok djm
* from tim:jmc2019-06-191-5/+5
| | | | | | | | | | | | | | | | | | - for reput, it is remote-path which is optional, not local-path - sync help from deraadt: - prefer -R and undocument -r (but add a comment for future editors) from schwarze: - prefer -p and undocument -P (as above. the comment was schwarze's too) more: - add the -f flag to reput and reget - sort help (i can;t remember who suggested this originally) djm and deraadt were ok with earlier versions of this; tim and schwarze ok
* Check for user@host when parsing sftp target. This allows user@[1.2.3.4]dtucker2019-06-071-6/+11
| | | | to work without a path in addition to with one. bz#2999, ok djm@
* Replace calls to ssh_malloc_init() by a static init of malloc_options.otto2019-06-061-2/+1
| | | | Prepares for changes in the way malloc is initialized. ok guenther@ dtucker@
* Add a -J option as a shortcut for -o Proxyjump= to scp(1) and sftp(1)tb2019-01-211-7/+7
| | | | | | to match ssh(1)'s interface. ok djm
* Add "-h" flag to sftp chown/chgrp/chmod commands to request they dodjm2019-01-161-8/+35
| | | | | | | not follow symlinks. Requires recently-committed lsetstat@openssh.com extension on the server side. ok markus@ dtucker@
* use path_absolute() for pathname checks; from Manoj Ampalamdjm2018-11-161-4/+4
|
* support a prefix of '@' to suppress echo of sftp batch commands;djm2018-11-161-25/+31
| | | | bz#2926; ok dtucker@
* Add FALLTHROUGH comments where appropriate. Patch from jjelen at redhatdtucker2018-09-071-1/+3
| | | | via bz#2687.
* Since the previous commit, ssh regress test sftp-chroot was failing.bluhm2018-04-261-4/+6
| | | | | | | | The sftp program terminated with the wrong exit code as sftp called fatal() instad of exit(0). So when the sigchld handler waits for the child, remember that it was found. Then don't expect that main() can wait again. OK dtucker@
* notify user immediately when underlying ssh process dies;djm2018-04-131-1/+20
| | | | patch from Thomas Kuthan in bz2719; ok dtucker@
* lots of typos in comments/docs. Patch from Karsten Weiss after checkingdjm2018-04-101-2/+2
| | | | with codespell tool (https://github.com/lucasdemarchi/codespell)
* allow "cd" and "lcd" commands with no explicit path argument.djm2017-11-031-11/+21
| | | | | | | lcd will change to the local user's home directory as usual. cd will change to the starting directory for session (because the protocol offers no way to obtain the remote user's home directory). bz#2760 ok dtucker@
* Add URI support to ssh, sftp and scp. For example ssh://user@hostmillert2017-10-211-27/+31
| | | | | | | or sftp://user@host/path. The connection parameters described in draft-ietf-secsh-scp-sftp-ssh-uri-04 are not implemented since the ssh fingerprint format in the draft uses md5 with no way to specify the hash function type. OK djm@
* implement sorting for globbed ls; bz#2649 ok dtucker@djm2017-06-101-3/+47
|
* remove -1 / -2 options; pointed out by jmc@djm2017-05-021-2/+2
|
* fix division by zero crash in "df" output when server returns zerodjm2017-02-151-16/+24
| | | | total filesystem blocks/inodes. Spotted by Guido Vranken; ok dtucker@
* Install a signal handler for tty-generated signals and wait for themillert2016-10-181-1/+16
| | | | | | ssh child to suspend before suspending sftp. This lets ssh restore the terminal mode as needed when it is suspended at the password prompt. OK dtucker@
* Add MAXIMUM(), MINIMUM(), and ROUNDUP() to misc.h, then use those definitionsderaadt2016-09-121-10/+9
| | | | | rather than pulling <sys/param.h> and unknown namespace pollution. ok djm markus dtucker
* constify a few functions' arguments; patch from Jakub Jelen bz#2581djm2016-07-221-14/+15
|
* To prevent screwing up terminal settings when printing to theschwarze2016-05-251-20/+26
| | | | | | | | | | | | | | | | | | | | | terminal, for ASCII and UTF-8, escape bytes not forming characters and bytes forming non-printable characters with vis(3) VIS_OCTAL. For other character sets, abort printing of the current string in these cases. In particular, * let scp(1) respect the local user's LC_CTYPE locale(1); * sanitize data received from the remote host; * sanitize filenames, usernames, and similar data even locally; * take character display widths into account for the progressmeter. This is believed to be sufficient to keep the local terminal safe on OpenBSD, but bad things can still happen on other systems with state-dependent locales because many places in the code print unencoded ASCII characters into the output stream. Using feedback from djm@ and martijn@, various aspects discussed with many others. deraadt@ says it should go in now, i probably already hesitated too long
* whitespace at EOLdjm2016-04-081-4/+4
|
* Add a function to enable security-related malloc_options. With and okdtucker2016-02-151-1/+2
| | | | deraadt@, something similar has been in the snaps for a while.
* Do not cast result of malloc/calloc/realloc* if stdlib.h is in scopederaadt2015-08-201-3/+3
| | | | ok krw millert
* Reduce use of <sys/param.h> and transition to <limits.h> throughout.deraadt2015-01-201-3/+4
| | | | ok djm markus
* update sftp client and server to new buffer API.djm2015-01-141-2/+3
| | | | pretty much just mechanical changes; with & ok markus
* Prefer setvbuf() to setlinebuf() for portability; ok deraadt@millert2014-11-261-3/+3
|
* correct options in usage(); from mancha1 AT zoho.comdjm2014-10-061-6/+6
|
* djm how did you make a typo like that...deraadt2014-08-201-2/+2
|
* ~-expand lcd pathsdjm2014-08-191-1/+4
|
* more useful error message when GLOB_NOSPACE occurs;djm2014-07-091-8/+16
| | | | bz#2254, patch from Orion Poplawski
* Zap extra whitespace.logan2014-05-051-2/+2
| | | | OK from djm@ and dtucker@
* Don't attempt to append a nul quote char to the filename. Should preventdtucker2014-04-291-2/+2
| | | | | fatal'ing with "el_insertstr failed" when there's a single quote char somewhere in the string. bz#2238, ok markus@
* Move nulling of variable next to where it's freed. ok markus@dtucker2014-04-291-2/+2
|
* Sort the sftp command list.logan2014-04-221-3/+3
| | | | OK from djm@