summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/sftp-server.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* highly polished whitespace, mostly fixing spaces-for-tab and baddjm2021-04-031-3/+3
| | | | indentation on continuation lines. Prompted by GHPR#185
* unused variabledjm2021-04-031-2/+2
|
* do not advertise protocol extensions that have been disallowed bydjm2021-03-311-33/+53
| | | | the command-line options (e.g. -p/-P/-R); ok dtucker@
* increase maximum SSH2_FXP_READ to match the maximum packet size.djm2021-03-191-24/+38
| | | | | | Also handle zero-length reads that are borderline nonsensical but not explicitly banned by the spec. Based on patch from Mike Frysinger, feedback deraadt@ ok dtucker@
* don't let logging clobber errno before usedjm2021-03-161-4/+6
|
* sftp-server: implement limits@openssh.com extensiondjm2021-02-181-2/+41
| | | | | | | | | | This is a simple extension that allows the server to clearly communicate transfer limits it is imposing so the client doesn't have to guess, or force the user to manually tune. This is particularly useful when an attempt to use too large of a value causes the server to abort the connection. Patch from Mike Frysinger; ok dtucker@
* sftp: add missing lsetstat@openssh.com documentationdjm2021-02-121-1/+2
| | | | patch from Mike Frysinger
* use the new variant log macros instead of prepending __func__ anddjm2020-10-181-64/+57
| | | | appending ssh_err(r) manually; ok markus@
* log error message for process_write() write failuresdjm2020-07-171-4/+5
|
* better terminology for permissions; feedback & ok markus@djm2020-06-221-16/+16
|
* add a local implementation of BSD realpath() for sftp-server usedjm2019-07-051-2/+4
| | | | | | ahead of OpenBSD's realpath changing to match POSIX; ok deraadt@ (thanks for snaps testing)
* When system calls indicate an error they return -1, not some arbitraryderaadt2019-06-281-12/+12
| | | | | | value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
* 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 support for a "lsetstat@openssh.com" extension. This replicates thedjm2019-01-161-1/+66
| | | | | | | | functionality of the existing SSH2_FXP_SETSTAT operation but does not follow symlinks. Based on a patch from Bert Haverkamp in bz#2067 but with more attribute modifications supported. ok markus@ dtucker@
* static on global vars, const on handler tables that contain functiondjm2019-01-011-7/+7
| | | | pointers; from Mike Frysinger
* make UID available as a %-expansion everywhere that the username isdjm2018-06-011-3/+5
| | | | | | | available currently. In the client this is via %i, in the server %U (since %i was already used in the client in some places for this, but used for something different in the server); bz#2870, ok dtucker@
* disallow creation (of empty files) in read-only mode; reported bydjm2017-04-041-3/+3
| | | | Michal Zalewski, feedback & ok deraadt@
* Add MAXIMUM(), MINIMUM(), and ROUNDUP() to misc.h, then use those definitionsderaadt2016-09-121-3/+2
| | | | | rather than pulling <sys/param.h> and unknown namespace pollution. ok djm markus dtucker
* 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.
* 1) Use xcalloc() instead of xmalloc() to check for potential overflow.logan2015-11-161-4/+4
| | | | | | | (Feedback from both mmcc@ and djm@) 2) move set_size just before the for loop. (suggested by djm@) OK djm@
* Do not cast result of malloc/calloc/realloc* if stdlib.h is in scopederaadt2015-08-201-3/+3
| | | | ok krw millert
* rename xrealloc() to xreallocarray() since it follows that form.deraadt2015-04-241-3/+3
| | | | ok djm
* Reduce use of <sys/param.h> and transition to <limits.h> throughout.deraadt2015-01-201-5/+5
| | | | ok djm markus
* update sftp client and server to new buffer API.djm2015-01-141-252/+326
| | | | pretty much just mechanical changes; with & ok markus
* fix log message statvfs. ok djmdtucker2014-01-171-3/+3
|
* fsync@openssh.com protocol extension for sftp-serverdjm2013-10-171-1/+23
| | | | | | client support to allow calling fsync() faster successful transfer patch mostly by imorgan AT nas.nasa.gov; bz#1798 "fine" markus@ "grumble OK" deraadt@ "doesn't sound bad to me" millert@
* refactor client config code a little:djm2013-10-141-5/+20
| | | | | | | | | | | | add multistate option partsing to readconf.c, similar to servconf.c's existing code. move checking of options that accept "none" as an argument to readconf.c add a lowercase() function and use it instead of explicit tolower() in loops part of a larger diff that was ok markus@
* tweak previous;jmc2013-10-141-4/+5
| | | | ok djm
* add -Q, -P and -p to usage() before jmc@ catches medjm2013-10-101-2/+3
|
* Add ability to whitelist and/or blacklist sftp protocol requests by name.djm2013-10-091-190/+213
| | | | | | | Refactor dispatch loop and consolidate read-only mode checks. Make global variables static, since sftp-server is linked into sshd(8). ok dtucker@
* bye, bye xfree(); ok markus@djm2013-05-171-29/+29
|
* sftp-server.8: add argument name to -djmc2013-01-041-2/+3
| | | | | | sftp-server.c: add -d to usage() ok djm
* allow specification of an alternate start directory for sftp-server(8)djm2013-01-031-5/+18
| | | | "I like this" markus@
* the protocol version should be unsigned; bz#1913 reported by mb ATdjm2011-06-171-3/+3
| | | | smartftp.com
* add a protocol extension to support a hard link operation. It isdjm2010-12-041-1/+27
| | | | | | | available through the "ln" command in the client. The old "ln" behaviour of creating a symlink is available using its "-s" option or through the preexisting "symlink" command; based on a patch from miklos AT szeredi.hu in bz#1555; ok markus@
* umask should be parsed as octal. reported by candland AT xmission.com;djm2010-11-041-8/+8
| | | | ok markus@
* support '-h' (human-readable units) for sftp's ls command, just likedjm2010-01-131-2/+2
| | | | ls(1); ok dtucker@
* add a 'read-only' mode to sftp-server(8) that disables open in write modedjm2010-01-091-29/+74
| | | | and all other fs-modifying protocol methods. bz#430 ok dtucker@
* bz#1566 don't unnecessarily dup() in and out fds for sftp-server; ok markus@djm2010-01-041-3/+3
|
* sort flags.sobrado2009-10-171-2/+2
|
* check correct variable for error message, spotted by martynas@djm2009-08-311-2/+2
|
* allow setting an explicit umask on the commandline to override whateverdjm2009-08-271-3/+13
| | | | default the user has. bz#1229; ok dtucker@ deraadt@ markus@
* remove unused option character from getopt() optstring; ok markus@stevesk2009-04-141-2/+2
|
* allow the sftp chmod(2)-equivalent operation to set set[ug]id/stickydjm2008-06-261-4/+4
| | | | | | bits. Note that this only affects explicit setting of modes (e.g. via sftp(1)'s chmod command) and not file transfers. (bz#1310) ok deraadt@ at c2k8
* Extend 32bit -> 64bit values for statvfs extension missed in previous commit.dtucker2008-06-091-5/+5
|
* Add case for ENOSYS in errno_to_portable; ok deraadtdtucker2008-06-081-1/+4
|
* statvfs member fsid needs to be wider, increase it to 64 bits anddjm2008-06-071-4/+4
| | | | crank extension revision number to 2; prodded and ok dtucker@
* comment extension announcementdjm2008-05-181-1/+3
|
* introduce sftp extension methods statvfs@openssh.com anddjm2008-04-181-1/+74
| | | | | | | | | | | fstatvfs@openssh.com that implement statvfs(2)-like operations, based on a patch from miklos AT szeredi.hu (bz#1399) also add a "df" command to the sftp client that uses the statvfs@openssh.com to produce a df(1)-like display of filesystem space and inode utilisation ok markus@
* add an extension method "posix-rename@openssh.com" to perform POSIX atomicdjm2008-02-271-2/+25
| | | | | rename() operations. based on patch from miklos AT szeredi.hu in bz#1400; ok dtucker@ markus@