summaryrefslogtreecommitdiff
path: root/sftp-server.c
Commit message (Collapse)AuthorAgeFilesLines
* upstream: fix double words ok dtucker@jsg@openbsd.org2023-04-171-2/+2
| | | | OpenBSD-Commit-ID: 44d3223902fbce5276422bdc8063ab72a4078489
* upstream: fix memory leak in process_read() path; Spotted by Jamesdjm@openbsd.org2023-03-071-2/+2
| | | | | | Robinson in GHPR363; ok markus@ OpenBSD-Commit-ID: cdc2d98e6478b7e7f3a36976845adae3820429d8
* upstream: Fix typo in fatal error message.dtucker@openbsd.org2022-11-091-2/+2
| | | | | | Patch from vapier at chromium.org. OpenBSD-Commit-ID: 8a0c164a6a25eef0eedfc30df95bfa27644e35cf
* upstream: extend sftp-common.c:extend ls_file() to support supplieddjm@openbsd.org2022-09-191-2/+3
| | | | | | user/group names; ok markus@ OpenBSD-Commit-ID: c70c70498b1fdcf158531117e405b6245863bfb0
* upstream: sftp-server(8): add a "users-groups-by-id@openssh.com"djm@openbsd.org2022-09-191-1/+61
| | | | | | | | | | | | extension request that allows the client to obtain user/group names that correspond to a set of uids/gids. Will be used to make directory listings more useful and consistent in sftp(1). ok markus@ OpenBSD-Commit-ID: 7ebabde0bcb95ef949c4840fe89e697e30df47d3
* upstream: correct error valuedjm@openbsd.org2022-09-171-2/+2
| | | | OpenBSD-Commit-ID: 780efcbad76281f11f14b2a5ff04eb6db3dfdad4
* upstream: sftp-server: support home-directory requestdjm@openbsd.org2022-08-121-1/+30
| | | | | | | | | | | Add support to the sftp-server for the home-directory extension defined in draft-ietf-secsh-filexfer-extensions-00. This overlaps a bit with the existing expand-path@openssh.com, but uses a more official protocol name, and so is a bit more likely to be implemented by non-OpenSSH clients. From Mike Frysinger, ok dtucker@ OpenBSD-Commit-ID: bfc580d05cc0c817831ae7ecbac4a481c23566ab
* upstream: add support for the "corp-data" protocol extension todjm@openbsd.org2022-03-311-1/+93
| | | | | | | allow server-side copies to be performed without having to go via the client. Patch by Mike Frysinger, ok dtucker@ OpenBSD-Commit-ID: 00aa510940fedd66dab1843b58682de4eb7156d5
* upstream: mark const string array contents const too, i.e. staticdjm@openbsd.org2022-02-021-2/+2
| | | | | | const char *array => static const char * const array from Mike Frysinger OpenBSD-Commit-ID: a664e31ea6a795d7c81153274a5f47b22bdc9bc1
* upstream: use status error message to communicate ~user expansiondjm@openbsd.org2022-01-141-2/+3
| | | | | | | | | | failures; provides better experience for scp in sftp mode, where ~user paths are more likely to be used; spotted jsg, feedback jsg & deraadt ok jsg & markus (forgot to include this file in previous commit) OpenBSD-Commit-ID: d37cc4c8c861ce48cd6ea9899e96aaac3476847b
* upstream: "void" functions should not return anything. From Tim Ricedtucker@openbsd.org2022-01-121-1/+1
| | | | | | via -portable. OpenBSD-Commit-ID: ce6616304f4c9881b46413e616b226c306830e2a
* Make USL compilers happyTim Rice2022-01-101-1/+1
| | | | UX:acomp: ERROR: "sftp-server.c", line 567: void function cannot return value
* upstream: add a variant of send_status() that allows overriding thedjm@openbsd.org2022-01-081-4/+11
| | | | | | default, generic error message. feedback/ok markus & jsg OpenBSD-Commit-ID: 81f251e975d759994131b717ee7c0b439659c40f
* upstream: spelling ok dtucker@jsg@openbsd.org2022-01-011-3/+3
| | | | OpenBSD-Commit-ID: bfc7ba74c22c928de2e257328b3f1274a3dfdf19
* Put poll.h inside ifdef HAVE_POLL_H.Darren Tucker2021-11-181-0/+2
|
* upstream: check for POLLHUP as well as POLLIN, handle transient IOdjm@openbsd.org2021-11-181-7/+15
| | | | | | errors as well as half-close on the output side; ok deraadt millert OpenBSD-Commit-ID: de5c5b9939a37476d256328cbb96305bdecf511e
* upstream: match .events with .fd betterderaadt@openbsd.org2021-11-181-5/+7
| | | | OpenBSD-Commit-ID: 77eef212ca0add905949532af390164489c5984b
* upstream: convert select() to poll() ok djmderaadt@openbsd.org2021-11-181-22/+16
| | | | OpenBSD-Commit-ID: b53e4940ff10dd24f8d16e8db8ef1970015d7ead
* upstream: improve error message when trying to expand a ~user pathdjm@openbsd.org2021-11-101-2/+2
| | | | | | | | for a user that doesn't exist; better matches what the shell does ok deraadt@ OpenBSD-Commit-ID: 1ddefa3c3a78b69ce13d1b8f67bc9f2cefd23ad6
* upstream: Plug a couple of minor mem leaks. From beldmit atdtucker@openbsd.org2021-11-061-1/+2
| | | | | | gmail.com via github PR#283, ok markus@ OpenBSD-Commit-ID: ec1fa7d305d46226861c3ca6fb9c9beb2ada2892
* upstream: SFTP protocol extension to allow the server to expanddjm@openbsd.org2021-08-101-1/+62
| | | | | | | | | | ~-prefixed paths, in particular ~user ones. Allows scp in sftp mode to accept these paths, like scp in rcp mode does. prompted by and much discussion deraadt@ ok markus@ OpenBSD-Commit-ID: 7d794def9e4de348e1e777f6030fc9bafdfff392
* Check for RLIMIT_NOFILE before trying to use it.Darren Tucker2021-08-021-2/+2
|
* upstream: the limits@openssh.com extension was incorrectly markeddjm@openbsd.org2021-06-061-2/+2
| | | | | | | as an operation that writes to the filesystem, which made it unavailable in sftp-server read-only mode. Spotted by Hector Martin via bz3318 OpenBSD-Commit-ID: f054465230787e37516c4b57098fc7975e00f067
* wrap struct rlimit in HAVE_GETRLIMIT tooDamien Miller2021-04-071-0/+2
|
* wrap getrlimit call in HAVE_GETRLIMIT; bz3291Damien Miller2021-04-071-0/+2
|
* upstream: highly polished whitespace, mostly fixing spaces-for-tabdjm@openbsd.org2021-04-031-3/+3
| | | | | | and bad indentation on continuation lines. Prompted by GHPR#185 OpenBSD-Commit-ID: e5c81f0cbdcc6144df1ce468ec1bac366d8ad6e9
* upstream: unused variabledjm@openbsd.org2021-04-031-2/+2
| | | | OpenBSD-Commit-ID: 85f6a394c8e0f60d15ecddda75176f112007b205
* upstream: do not advertise protocol extensions that have beendjm@openbsd.org2021-04-011-33/+53
| | | | | | disallowed by the command-line options (e.g. -p/-P/-R); ok dtucker@ OpenBSD-Commit-ID: 3a8a76b3f5131741aca4b41bfab8d101c9926205
* upstream: increase maximum SSH2_FXP_READ to match the maximumdjm@openbsd.org2021-03-191-24/+38
| | | | | | | | packet size. 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@ OpenBSD-Commit-ID: 4e67d60d81bde7b84a742b4ee5a34001bdf80d9c
* upstream: don't let logging clobber errno before usedjm@openbsd.org2021-03-191-4/+6
| | | | OpenBSD-Commit-ID: ce6cca370005c270c277c51c111bb6911e1680ec
* upstream: sftp-server: implement limits@openssh.com extensiondjm@openbsd.org2021-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@ OpenBSD-Commit-ID: f96293221e5aa24102d9bf30e4f4ef04d5f4fb51
* upstream: sftp: add missing lsetstat@openssh.com documentationdjm@openbsd.org2021-02-171-1/+2
| | | | | | patch from Mike Frysinger OpenBSD-Commit-ID: 9c114db88d505864075bfe7888b7c8745549715b
* upstream: use the new variant log macros instead of prependingdjm@openbsd.org2020-10-181-64/+57
| | | | | | __func__ and appending ssh_err(r) manually; ok markus@ OpenBSD-Commit-ID: 1f14b80bcfa85414b2a1a6ff714fb5362687ace8
* upstream: log error message for process_write() write failuresdjm@openbsd.org2020-07-171-4/+5
| | | | OpenBSD-Commit-ID: f733d7b3b05e3c68967dc18dfe39b9e8fad29851
* upstream: better terminology for permissions; feedback & ok markus@djm@openbsd.org2020-06-221-16/+16
| | | | OpenBSD-Commit-ID: ffb220b435610741dcb4de0e7fc68cbbdc876d2c
* upstream: add a local implementation of BSD realpath() fordjm@openbsd.org2019-07-081-2/+4
| | | | | | | | sftp-server use ahead of OpenBSD's realpath changing to match POSIX; ok deraadt@ (thanks for snaps testing) OpenBSD-Commit-ID: 4f8cbf7ed8679f6237264301d104ecec64885d55
* upstream: When system calls indicate an error they return -1, notderaadt@openbsd.org2019-07-051-12/+12
| | | | | | | | some arbitrary 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. OpenBSD-Commit-ID: 48081f00db7518e3b712a49dca06efc2a5428075
* upstream: Replace calls to ssh_malloc_init() by a static init ofotto@openbsd.org2019-06-081-2/+1
| | | | | | | malloc_options. Prepares for changes in the way malloc is initialized. ok guenther@ dtucker@ OpenBSD-Commit-ID: 154f4e3e174f614b09f792d4d06575e08de58a6b
* upstream: add support for a "lsetstat@openssh.com" extension. Thisdjm@openbsd.org2019-01-171-1/+66
| | | | | | | | | | replicates the 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@ OpenBSD-Commit-ID: f7234f6e90db19655d55d936a115ee4ccb6aaf80
* upstream: static on global vars, const on handler tables that containdjm@openbsd.org2019-01-031-7/+7
| | | | | | function pointers; from Mike Frysinger OpenBSD-Commit-ID: 7ef2305e50d3caa6326286db43cf2cfaf03960e0
* upstream: make UID available as a %-expansion everywhere that thedjm@openbsd.org2018-06-011-3/+5
| | | | | | | | username is 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@ OpenBSD-Commit-ID: c7e912b0213713316cb55db194b3a6415b3d4b95
* upstream commitdjm@openbsd.org2017-04-041-3/+3
| | | | | | | disallow creation (of empty files) in read-only mode; reported by Michal Zalewski, feedback & ok deraadt@ Upstream-ID: 5d9c8f2fa8511d4ecf95322994ffe73e9283899b
* upstream commitderaadt@openbsd.org2016-09-121-3/+2
| | | | | | | | Add MAXIMUM(), MINIMUM(), and ROUNDUP() to misc.h, then use those definitions rather than pulling <sys/param.h> and unknown namespace pollution. ok djm markus dtucker Upstream-ID: 712cafa816c9f012a61628b66b9fbd5687223fb8
* Move prctl PR_SET_DUMPABLE into platform.c.Darren Tucker2016-06-091-8/+2
| | | | | This should make it easier to add additional platform support such as Solaris (bz#2584).
* upstream commitdtucker@openbsd.org2016-02-161-1/+2
| | | | | | | Add a function to enable security-related malloc_options. With and ok deraadt@, something similar has been in the snaps for a while. Upstream-ID: 43a95523b832b7f3b943d2908662191110c380ed
* Support Illumos/Solaris fine-grained privilegesDamien Miller2016-01-081-0/+3
| | | | | | | Includes a pre-auth privsep sandbox and several pledge() emulations. bz#2511, patch by Alex Wilson. ok dtucker@
* upstream commitlogan@openbsd.org2015-11-171-4/+4
| | | | | | | | | | 1) Use xcalloc() instead of xmalloc() to check for potential overflow. (Feedback from both mmcc@ and djm@) 2) move set_size just before the for loop. (suggested by djm@) OK djm@ Upstream-ID: 013534c308187284756c3141f11d2c0f33c47213
* upstream commitderaadt@openbsd.org2015-08-211-3/+3
| | | | | | | Do not cast result of malloc/calloc/realloc* if stdlib.h is in scope ok krw millert Upstream-ID: 5e50ded78cadf3841556649a16cc4b1cb6c58667
* upstream commitderaadt@openbsd.org2015-04-291-3/+3
| | | | | rename xrealloc() to xreallocarray() since it follows that form. ok djm
* Remove duplicate include of pwd.h. bz#2337, patch from Mordy Ovits.Darren Tucker2015-04-151-1/+0
|