Commit Graph

180 Commits

Author SHA1 Message Date
Tess Gauthier 24c095e785
add motw to scp and sftp (#614)
* add motw to scp and sftp

* retrigger appveyor

* fix motw for filepaths with unicode characters

* modify error handling

* add debug for appveyor

* modify motw method to use openssh method to open filestream

* fix return value for null fileStreamPath pointer

* fix spacing, comments, and failure message

* clean up mark of the web method

* incorporate MapUrlToZone for sftp & partially scp

* update scp for motw failure case

* Update contrib/win32/win32compat/misc.c

Co-authored-by: Paul Higinbotham <paulhi@microsoft.com>

* address pr review comments

* refactor failure handling in motw methods

* add CoUnitialize after CoInitializeEx call

* use urlmon.h constants for com instance

* update var name for consistency

Co-authored-by: Paul Higinbotham <paulhi@microsoft.com>
2022-09-08 11:55:10 -04:00
Balu Gajjala 9a85082806 V8.9 build errors, unit tests successful 2022-03-04 18:40:49 -08:00
Balu Gajjala ee54e6bd06 Merge upstream V8_9 2022-02-24 16:57:16 -08:00
djm@openbsd.org 541667fe6d upstream: mark const string array contents const too, i.e. static
const char *array => static const char * const array from Mike Frysinger

OpenBSD-Commit-ID: a664e31ea6a795d7c81153274a5f47b22bdc9bc1
2022-02-02 10:38:59 +11:00
djm@openbsd.org 1cd1b2eac3 upstream: use status error message to communicate ~user expansion
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
2022-01-14 14:40:34 +11:00
dtucker@openbsd.org 96da0946e4 upstream: "void" functions should not return anything. From Tim Rice
via -portable.

OpenBSD-Commit-ID: ce6616304f4c9881b46413e616b226c306830e2a
2022-01-12 09:35:50 +11:00
Tim Rice 61761340be Make USL compilers happy
UX:acomp: ERROR: "sftp-server.c", line 567: void function cannot return value
2022-01-10 11:07:04 -08:00
djm@openbsd.org 9acddcd591 upstream: add a variant of send_status() that allows overriding the
default, generic error message. feedback/ok markus & jsg

OpenBSD-Commit-ID: 81f251e975d759994131b717ee7c0b439659c40f
2022-01-08 18:38:49 +11:00
jsg@openbsd.org cb885178f3 upstream: spelling ok dtucker@
OpenBSD-Commit-ID: bfc7ba74c22c928de2e257328b3f1274a3dfdf19
2022-01-01 15:19:48 +11:00
Darren Tucker b544ce1ad4 Put poll.h inside ifdef HAVE_POLL_H. 2021-11-18 23:06:35 +11:00
djm@openbsd.org 1f3055d788 upstream: check for POLLHUP as well as POLLIN, handle transient IO
errors as well as half-close on the output side; ok deraadt millert

OpenBSD-Commit-ID: de5c5b9939a37476d256328cbb96305bdecf511e
2021-11-18 14:11:38 +11:00
deraadt@openbsd.org 092d29b232 upstream: match .events with .fd better
OpenBSD-Commit-ID: 77eef212ca0add905949532af390164489c5984b
2021-11-18 09:12:28 +11:00
deraadt@openbsd.org 8d642c9a90 upstream: convert select() to poll() ok djm
OpenBSD-Commit-ID: b53e4940ff10dd24f8d16e8db8ef1970015d7ead
2021-11-18 09:12:28 +11:00
djm@openbsd.org 6997a592ec upstream: improve error message when trying to expand a ~user path
for a user that doesn't exist; better matches what the shell does

ok deraadt@

OpenBSD-Commit-ID: 1ddefa3c3a78b69ce13d1b8f67bc9f2cefd23ad6
2021-11-10 17:32:18 +11:00
dtucker@openbsd.org eb1f63195a upstream: Plug a couple of minor mem leaks. From beldmit at
gmail.com via github PR#283, ok markus@

OpenBSD-Commit-ID: ec1fa7d305d46226861c3ca6fb9c9beb2ada2892
2021-11-06 21:56:09 +11:00
djm@openbsd.org 2ab864010e upstream: SFTP protocol extension to allow the server to expand
~-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
2021-08-10 12:47:46 +10:00
Darren Tucker 1e11fb2406 Check for RLIMIT_NOFILE before trying to use it. 2021-08-02 18:56:29 +10:00
vthiebaut10 0b73c4636d
Allow non-admin user processes to log message to ETW / log file (#513) 2021-06-11 16:56:04 -07:00
djm@openbsd.org d345d5811a upstream: the limits@openssh.com extension was incorrectly marked
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
2021-06-06 13:24:38 +10:00
bagajjal 46688b7bc0 Do not advertise fstatvfs 2021-05-14 11:46:28 -07:00
bagajjal 9dba3f91e4
Bagajjal/compile test v8.6 (#503)
Fixed compilation and test failures with V8.6.
2021-04-29 12:41:08 -07:00
bagajjal 9230781e2e Merge upstream V8_6 2021-04-21 11:30:22 -07:00
Damien Miller e7d0a285db wrap struct rlimit in HAVE_GETRLIMIT too 2021-04-07 08:50:38 +10:00
Damien Miller f283a6c2e0 wrap getrlimit call in HAVE_GETRLIMIT; bz3291 2021-04-07 08:20:59 +10:00
djm@openbsd.org 31d8d231eb upstream: highly polished whitespace, mostly fixing spaces-for-tab
and bad indentation on continuation lines. Prompted by GHPR#185

OpenBSD-Commit-ID: e5c81f0cbdcc6144df1ce468ec1bac366d8ad6e9
2021-04-03 17:23:02 +11:00
djm@openbsd.org 464ebc82aa upstream: unused variable
OpenBSD-Commit-ID: 85f6a394c8e0f60d15ecddda75176f112007b205
2021-04-03 16:30:17 +11:00
Balu Gajjala e2287c5cfa openssh-8.5
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEcWi5g4FaXu9ZpK39Kj9BTnNgYLoFAmA+KckACgkQKj9BTnNg
 YLoCExAAqxi83JFNUj+D0HdfM/eKas8dGtCXFzxtOA0yomKeeDUVoz1D96CdNLF8
 07mL78KAMErN2SfXEyzpS/2yoGa8wPflne/ADWJVIGKZK9cj8/fwvMrCUWp9PJOa
 CVQm2W8u3yBoEAxoi81S7WJjR5BY4Sv0LtQJW43VfD4bwYjBz8N72ecnr7LknFNL
 qJXYUu/OWtMLNsSrh2VigXJQgTA9cmJUrItRFamSsfWZGwilL0MpXLrkwcJa5DhO
 25PG3aeJSTX5txI/hl25EY5cyeJPQGX+6Nz9kJag50a7C9ZOCJHIbnle7dFcLsDP
 lCy3VoQnPxEOHe8kmNGLf1tGvv8AIqpJu1a31SlSnbqHEgHFC0XCPXZF0QWDGAaO
 kDt8j6XSCHYDyml5+nkZJBCP6xcx7eXyLJ2CxnNZBabbRGLb/Rj+jeCk9s+jWo/i
 UDgmlibbfjreYVgwuZhQV9QI9GB0Mlv+UjeeK55b2S7WnhuLsMLVrxDVQ1Zl4oR1
 ckOvXBMGrjMaLQTW9Q1xSV6C3PR1oAbVa09YUP0KSAthOu8L/tGY13kT4DwWm1W/
 JBOKzCk/JIfRuOpCrKSftwuj19JKOPYojW8kk10i/48RUq4TiCsCnTtBZI7VvFcB
 B28s/ZGRq/nETqHSRX63/WLr57lU54pq/+7THQA5iUyFhORPYk4=
 =npgJ
 -----END PGP SIGNATURE-----

pull V8.5 changes
2021-04-02 10:14:32 -07:00
djm@openbsd.org 6653c61202 upstream: do not advertise protocol extensions that have been
disallowed by the command-line options (e.g. -p/-P/-R); ok dtucker@

OpenBSD-Commit-ID: 3a8a76b3f5131741aca4b41bfab8d101c9926205
2021-04-01 09:19:36 +11:00
djm@openbsd.org 1269b8a686 upstream: increase maximum SSH2_FXP_READ to match the maximum
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
2021-03-19 13:20:32 +11:00
djm@openbsd.org 860b676044 upstream: don't let logging clobber errno before use
OpenBSD-Commit-ID: ce6cca370005c270c277c51c111bb6911e1680ec
2021-03-19 13:20:32 +11:00
djm@openbsd.org 788cbc5b74 upstream: sftp-server: implement limits@openssh.com extension
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
2021-02-18 13:17:43 +11:00
djm@openbsd.org 16eacdb016 upstream: sftp: add missing lsetstat@openssh.com documentation
patch from Mike Frysinger

OpenBSD-Commit-ID: 9c114db88d505864075bfe7888b7c8745549715b
2021-02-17 15:03:41 +11:00
djm@openbsd.org 816036f142 upstream: use the new variant log macros instead of prepending
__func__ and appending ssh_err(r) manually; ok markus@

OpenBSD-Commit-ID: 1f14b80bcfa85414b2a1a6ff714fb5362687ace8
2020-10-18 23:46:29 +11:00
djm@openbsd.org 287dc6396e upstream: log error message for process_write() write failures
OpenBSD-Commit-ID: f733d7b3b05e3c68967dc18dfe39b9e8fad29851
2020-07-17 13:52:46 +10:00
djm@openbsd.org fc270baf26 upstream: better terminology for permissions; feedback & ok markus@
OpenBSD-Commit-ID: ffb220b435610741dcb4de0e7fc68cbbdc876d2c
2020-06-22 16:11:14 +10:00
bagajjal a49bdce666
Port Unix bash tests (#410)
Leverage upstream test infrastructure to run against windows openssh binaries.
2019-12-09 15:12:46 -08:00
Manoj Ampalam 66b040a11e Merge branch 'V_8_1' of https://github.com/openssh/openssh-portable into latestw_all 2019-11-01 11:55:19 -07:00
djm@openbsd.org 569b650f93 upstream: add a local implementation of BSD realpath() for
sftp-server use ahead of OpenBSD's realpath changing to match POSIX;

ok deraadt@ (thanks for snaps testing)

OpenBSD-Commit-ID: 4f8cbf7ed8679f6237264301d104ecec64885d55
2019-07-08 11:44:49 +10:00
deraadt@openbsd.org 4d28fa78ab upstream: When system calls indicate an error they return -1, not
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
2019-07-05 11:10:39 +10:00
otto@openbsd.org 0323d9b619 upstream: Replace calls to ssh_malloc_init() by a static init of
malloc_options. Prepares for changes in the way malloc is initialized.  ok
guenther@ dtucker@

OpenBSD-Commit-ID: 154f4e3e174f614b09f792d4d06575e08de58a6b
2019-06-08 00:25:42 +10:00
Manoj Ampalam 7079aed39c Merge branch 'V_8_0' of https://github.com/openssh/openssh-portable 2019-05-22 14:18:23 -07:00
djm@openbsd.org dbbc7e0eab upstream: add support for a "lsetstat@openssh.com" extension. This
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
2019-01-17 11:08:13 +11:00
djm@openbsd.org 5bed70afce upstream: static on global vars, const on handler tables that contain
function pointers; from Mike Frysinger

OpenBSD-Commit-ID: 7ef2305e50d3caa6326286db43cf2cfaf03960e0
2019-01-03 10:25:37 +11:00
Manoj Ampalam 1ce9e2005d Merge branch 'V_7_8' of https://github.com/openssh/openssh-portable into cwb 2018-10-04 14:43:51 -07:00
djm@openbsd.org 9c935dd9bf upstream: make UID available as a %-expansion everywhere that the
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
2018-06-01 13:35:59 +10:00
bagajjal c9c715e707 Fix sftp scp file permission (#212)
PowerShell/Win32-OpenSSH#884
Convert the mode properly to file permissions.
If mode has "read" permission then we set the file permission to "read & execute"
If mode has "write" permission then we set the file permission to "Write & Modify"
Inherit the file permissions from the parent folder when sftp / scp creates the file on windows.
sftp - put & get.
scp - from local to remote windows machine.
2017-10-16 13:00:40 -07:00
djm@openbsd.org 4d827f0d75 upstream commit
disallow creation (of empty files) in read-only mode;
reported by Michal Zalewski, feedback & ok deraadt@

Upstream-ID: 5d9c8f2fa8511d4ecf95322994ffe73e9283899b
2017-04-04 10:26:01 +10:00
deraadt@openbsd.org 9136ec134c upstream commit
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
2016-09-12 13:46:29 +10:00
Darren Tucker 0fb7f59853 Move prctl PR_SET_DUMPABLE into platform.c.
This should make it easier to add additional platform support such as
Solaris (bz#2584).
2016-06-09 16:23:07 +10:00
dtucker@openbsd.org ffb1e7e896 upstream commit
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
2016-02-16 10:44:00 +11:00