Commit Graph

653 Commits

Author SHA1 Message Date
Bryan Berns d43856a300 Added Symbolic Link Support (#285)
Created readlink() implementation.
Separated, corrected lstat() implementation.
Added symlink file type indicator to returned request data.
2018-03-15 17:13:13 -07:00
Bryan Berns 0dc5a971bd Allow More Child Processes (#284)
- Added wait_for_multiple_objects_enhanced() function that can logically handle wait-any on many children (system resources permitting).
- Added unit tests for wait_for_multiple_objects_enhanced().
- Incorporated use of wait_for_multiple_objects_enhanced() into main signal handler.
- Upped max child processes to 500.
2018-03-14 11:10:27 -07:00
Yanbing fb1342f7e0
Add wildcard support for scp (#283)
1. Expand wildcard for input parameters
2.  add scp tests with wildcard
3. for debug mode, need to enable the log to local log file.
4. update the path to log file
2018-03-11 23:28:52 -07:00
Manoj Ampalam 9fe39c0c73
Fixed regression caused due to ETW support changes (#282)
Regression: Service is unable to start if "ssh" programdata directory is missing.
Reason: This is due to refactored changes around w32_programdir() that moved its initialization to within win32_posix_initialize. sshd_main() is relying on this call even before the POSIX layer gets initialized.
Fix: Reverted the refactoring changes and added comments to consolidate these changes later. Also removed directory creation logic in install-sshd.ps1 that masked this issue before.
2018-03-09 14:56:47 -08:00
Manoj Ampalam 2c559a2b6c
Added support for ETW based logging (#280)
https://github.com/PowerShell/Win32-OpenSSH/issues/95
2018-03-06 15:33:19 -08:00
Yanbing 50a4badb79
Test Fixes on down level OS (#279)
* Test Fixes on downlevel machines
1. Test fix to run on win7 and win8
2. Add -onecore parameter to start-opensshpackage in build helper script
3. Add copying of libcrypto.dll and libcrypto.pdb
4. Update the build number on appveyor.yml
2018-03-01 15:11:55 -08:00
Yanbing f46d8d1b30
build script update: use vs2017 if it exists; fall back to vs2015 if 2017 does not presents (#277)
* add NoOpenSSL and OneCore parameter for packaging

* update the log option so it can print out the build console log

* update script to use vs2017 if it exists

* update path to copy libcrypto.dll
2018-02-27 14:01:45 -08:00
Manoj Ampalam b3a3a5cc66
Multiple Fixes (#273)
PowerShell/Win32-OpenSSH#1065
Fix: In recent sshd architectural changes, post authentication changes that process user specific changes were missing in authenticated sshd worker. Added missing call.
PowerShell/Win32-OpenSSH#1052
Fix: getpwd* functions will now strip off domain of any local user account.
2018-02-21 10:09:18 -08:00
Manoj Ampalam e610a3d6d1 added work arounds for missing APIs 2018-02-21 07:18:42 -08:00
Manoj Ampalam 89cac52637
onboarding fileversion, productversion and softwareversion changes (#274)
Updated file version info:
FileVersionRaw : 7.6.0.0
ProductVersionRaw : 7.6.0.0
ProductName : OpenSSH for Windows
ProductVersion : OpenSSH_7.6p1 for Windows

Updated softwareversion - this would show up in protocol identification string and when doing ssh -V
OpenSSH_for_Windows_7.6
2018-02-20 23:02:04 -08:00
Manoj Ampalam 05d1975743
Added logic to spawn unauthenticated sshd workers to run in isolated … (#275)
Issue: All SSHD unauthenticated workers are currently running as "sshd". Any compromised worker can snoop into the process space of one other worker, steal authentication payload and elevate itself.
Fix: Added logic to spawn the unauthenticated workers under the context of run time unique security identities that will provide complete isolation between these worker processes.
2018-02-20 23:00:14 -08:00
Darren Tucker 265d88d4e6 Remove remaining now-obsolete cvs $Ids. 2018-02-15 20:06:19 +11:00
bagajjal fcead5ed76 Fixed issue with starting sshd in debug mode with a "./" (./sshd.exe -d)
PowerShell/Win32-OpenSSH#1045
2018-02-12 11:49:33 -08:00
Darren Tucker cdb10bd431 Add changelog entry for binary strip change. 2018-02-10 11:18:38 +11:00
Darren Tucker 937d96587d Don't strip binaries so debuginfo gets built.
Tell install not to strip binaries during package creation so that the
debuginfo package can be built.
2018-02-10 11:12:45 +11:00
Darren Tucker eb0865f330 Fix bogus dates in changelog. 2018-02-10 10:33:11 +11:00
Darren Tucker 7fbde1b34c Remove SSH1 from description. 2018-02-10 10:25:15 +11:00
Darren Tucker 9c34a76f09 Add support for compat-openssl10 build dep. 2018-02-10 10:23:00 +11:00
Darren Tucker 04f4e8193c Add leading zero so it'll work when rhel not set.
When rhel is not set it will error out with "bad if". Add leading zero
as per https://fedoraproject.org/wiki/Packaging:DistTag so it'll work
on non-RHEL.
2018-02-10 09:58:32 +11:00
Darren Tucker 12abd67a6a Update openssl-devel dependency. 2018-02-10 09:58:32 +11:00
nkadel b33e7645f8 Add mandir with-mandir' for RHEL 5 compatibility.
Activate '--mandir' and '--with-mandir' settings in setup for RHEL
5 compatibility.
2018-02-10 09:58:32 +11:00
nkadel 94f8bf360e Discard 'K5DIR' reporting.
It does not work inside 'mock' build environment.
2018-02-10 09:58:32 +11:00
nkadel bb7e54dbaf Add 'dist' to 'rel' for OS specific RPM names. 2018-02-10 09:58:32 +11:00
nkadel 87346f1f57 Add openssh-devel >= 0.9.8f for redhat spec file. 2018-02-10 09:58:32 +11:00
nkadel bec1478d71 Enhance BuildRequires for openssh-x11-askpass. 2018-02-10 09:58:32 +11:00
nkadel 3104fcbdd3 Always include x11-ssh-askpass SRPM.
Always include x11-ssh-askpass tarball in redhat SRPM, even if unused.
2018-02-10 09:58:32 +11:00
bagajjal b10f2232e5 fix lsa auth provider and minor bug fixes (#270)
https://github.com/PowerShell/Win32-OpenSSH/issues/1046
2018-02-02 15:45:32 -08:00
Manoj Ampalam 02d07309e2
Now logging sshd.pid at %programdata%\ssh (#269)
PowerShell/Win32-OpenSSH#982
2018-01-29 21:59:48 -08:00
Yanbing bad5548188
Test update
1. Move Start-SSHD-TestDaemon and Stop-SSHD-TestDaemon to commonUtils.psm1
2. Fix the timing issue when trying to read the log while it is still locked by the process.
3, Start the service to create the config fold if it is not there.
4. Skip authorizedkey and sshdconfig tests on win7 since the task scheduler cmdlets are not available on win7.
5. rename variables
2018-01-29 13:49:01 -08:00
Manoj Ampalam fd580e9d96
Allow remote session processes to break away from session job object
PowerShell/Win32-OpenSSH#1032
Issue: Ssh-shellhost.exe creates a job object and ties all its child processes to its lifetime. It does not allow the child processes to break away from this job. This restriction is unnecessary.
Fix: Modified job object to allow child processes to break away if they need to.
2018-01-26 15:22:23 -08:00
bagajjal b92b7c9480 fix the sshd_config and test related changes (#265)
fix the sshd_config and test related changes
2018-01-22 18:53:17 -08:00
bagajjal 973a7afc62
automated generation of cfg, logs folder and copy sshd_config (#264) 2018-01-22 16:55:42 -08:00
Yanbing 8f212f6b05
Cranked version 1.0.0.0 (#262)
Cranked version 1.0.0.0
2018-01-19 15:13:09 -08:00
bagajjal c85ba2b8c3 Separate binary path from cfg path and log path (#263)
Separate binary path from cfg path and log path, test update
2018-01-19 15:12:43 -08:00
Manoj Ampalam 88defae8c1
removed logic arround NTService\SSHD related checks (#261) 2018-01-18 10:46:52 -08:00
Manoj Ampalam 32ff0c2aed
Added support to autogen hostkeys at sshd service startup (#259)
* Added support to autogen hostkeys at sshd service startup
* Integrated latest changes to sshd_config
2018-01-17 08:52:10 -08:00
bagajjal 04c012c032 fix backspace (Control+?) in no-pty session (#257)
https://github.com/PowerShell/Win32-OpenSSH/issues/1011
2018-01-16 21:59:27 -08:00
bagajjal 1f636bd8dd removed extra ; remove m while sending color code (#255)
https://github.com/PowerShell/Win32-OpenSSH/issues/1005
2018-01-16 21:58:44 -08:00
Karl Itnic 97b74e8a10 Update socketio.c (#252)
Merged fix from https://github.com/PowerShell/openssh-portable/pull/252
2018-01-16 21:37:21 -08:00
Manoj Ampalam 5e0833f69d
Logfile add date (#260)
* add date in the log file in MM/DD/YYYY format

* changed date format in log file to bigendian ISO 8601 (YYYY-MM-DD) (#256)

The "madendian" MM/DD/YYYY format is not used outside the United States
(and rather irritating elsewhere)
2018-01-16 19:56:06 -08:00
bagajjal b62ae95cd2 add date in the log file in MM/DD/YYYY format (#253) 2018-01-16 19:48:06 -08:00
Manoj Ampalam fdd54b6334
Implement Unix styled privilege separation in Windows (#258)
OpenSSh privilege separation model - http://www.citi.umich.edu/u/provos/ssh/privsep.html 
Posix_spawn is implemented in POSIX adapter as an alternative to fork() that is heavily used in Privilege separation. 
Additional state info is added to sshd to accommodate distinguishing the various modes (privileged monitor, unprivileged child, authenticated child).
Required service state (like config and host keys) is transmitted over pipes from monitor to child processes.
Changes to installation scripts and tests to accomodate new architectural changes
2018-01-15 13:57:31 -08:00
bagajjal 8906783fa4
remove LsaNtStatusToWinError as onecore doesn't support this API (#249) 2017-12-07 12:50:16 -08:00
bagajjal 507fe3283a Support custom LSA auth provider (#246)
Support custom LSA auth provider
2017-12-07 11:12:29 -08:00
bagajjal ef55537c8b
Merge pull request #226 from PowerShell/mitigate_AltGR_#902
Fix non-US keyboard related issue and scp x86 debug build error
2017-12-05 12:58:47 -08:00
Yanbing 04a3e5ee68
Cranked version 0.0.24.0 (#248)
Cranked version 0.0.24.0
2017-12-04 13:03:54 -08:00
bagajjal 5e86ef04c8 sshd service shouldn't call sshd_main() while exiting (#247)
PowerShell/Win32-OpenSSH#957
2017-12-04 10:45:20 -08:00
Darren Tucker 6c8a246437 Replace mkinstalldirs with mkdir -p.
Check for MIKDIR_P and use it instead of mkinstalldirs.  Should fix "mkdir:
cannot create directory:... File exists" during "make install".
Patch from eb at emlix.com.
2017-12-01 17:13:34 +11:00
Darren Tucker 79226e5413 Remove RSA1 host key generation.
SSH1 support is now gone, remove SSH1 key generation.
Patch from eb at emlix.com.
2017-12-01 16:55:35 +11:00
Yanbing b7ee9e98e8 try loading advapi32.dll on machine where sspicli.dll does not presents (#244)
PowerShell/Win32-OpenSSH#965
2017-11-28 21:04:23 -08:00
Manoj Ampalam 6861ecaa41
Fixed service banary paths (#243)
PowerShell/Win32-OpenSSH#963
2017-11-28 21:03:10 -08:00
Yanbing 32efc3b06c
download previous pester version before the latest one got fixed. (#245) 2017-11-28 19:06:26 -08:00
bagajjal bcf9c5336f SFTP fix to download a very large file in chunks #863 (#227)
PowerShell/Win32-OpenSSH#863
2017-11-20 23:25:01 -08:00
Yanbing 495119e23f
Remove two properties from projects (#240) 2017-11-17 13:07:54 -08:00
Manoj Ampalam 549d532c09 Ported upstream changes 2017-11-16 14:08:23 -08:00
Yanbing 3f106fe653
Address code review feedback of PR 238 (#239)
Address feedback of PR 238
2017-11-15 13:10:54 -08:00
Yanbing a4cbd07812
Enable build for arm and arm64 (#238)
Enable build for arm and arm64
2017-11-14 17:22:02 -08:00
bagajjal 4fc40c0959 rename variable to NoLibressl 2017-11-07 16:07:16 -08:00
bagajjal 494faf24dd Enable libressl as default and to disable use the switch 2017-11-07 13:57:08 -08:00
Manoj Ampalam 4edff78b9d
Fixed issue in POSIX layer that could truncate write streams (#235)
PowerShell/Win32-OpenSSH#908
2017-11-06 21:38:14 -08:00
Manoj Ampalam c546971ca8
Fixed issue with ssh redirected stdin
PowerShell/Win32-OpenSSH#929
Issue: ReadThread prematurely returns on read io error. This results in APC never getting set and hence the corresponding fd is never set on select resulting the hang seen in issue 929.
Also removed the static instances storing sync io status, since there could be multiple sync fds operating at the same time. Moved the sync io status to w32_io object itself.
2017-11-03 13:16:23 -07:00
bagajjal dce738c33a fix the error code when we fail to open file (#232)
https://github.com/PowerShell/Win32-OpenSSH/issues/934
2017-11-02 22:37:50 -07:00
Yanbing 65751db59c
Cranked version 0.0.23.0 (#233)
Cranked version 0.0.23.0
2017-11-02 13:01:00 -07:00
bagajjal 28b486e0b0 fix the project files to refer to libcrypto.dll instead of libcrypto-41.dll (#231)
https://github.com/PowerShell/Win32-OpenSSH/issues/933
2017-10-31 11:44:10 -07:00
Shawn Iverson b2daa97b71 Fix misspelling in agent.c (#230) 2017-10-30 15:58:35 -07:00
bagajjal b3862103e4 support unicode characters from the ssh.exe (#228) 2017-10-30 15:50:08 -07:00
bagajjal beae9cad31 fix#902 and scp x86 debug build error 2017-10-20 10:21:17 -07:00
Yanbing d4069f2055 Cranked version 0.0.22.0 (#225)
Cranked version 0.0.22.0
2017-10-17 14:01:15 -07:00
Manoj Ampalam 21ebb53a30 Multiple fixes (#224)
PowerShell/Win32-OpenSSH#894
Added logic to profile path retrieval to consider environment variables in path read from registry
PowerShell/Win32-OpenSSH#883
Added flags to support libssh2 SFTP. These are No-Ops for now. We may support them later if needed. Added PowerShell/Win32-OpenSSH#915 to keep track of TODO work item
2017-10-17 12:29:13 -07:00
bagajjal 9555bd9e87 Fix the memset issue related to default cmd option (#223)
Fix the memset issue related to default cmd option
2017-10-16 19:03:02 -07:00
bagajjal 97959981f6 More fix of sftp scp file permission and test cases (#222)
More fix of sftp scp file permission and test cases
2017-10-16 14:46:37 -07: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
bagajjal 9c95d8e2bb allowing users to configure the default shell through windows registry (#215) 2017-10-16 10:45:11 -07:00
Manoj Ampalam 7a4a10a224 Secured permissions on logs folder and underlying logs (#221) 2017-10-12 22:46:26 -07:00
Yanbing 96235ad333 Added support (optional) for building for OneCore 2017-10-11 08:49:11 -07:00
Manoj Ampalam 6fba3a2ae9 Merge branch 'master' of https://github.com/openssh/openssh-portable into latestw 2017-10-03 14:32:45 -07:00
Manoj Ampalam 72093244f9 Added test cases for certificate authentication (#216) 2017-10-03 12:21:08 -07:00
Yanbing cd35668972 Cranked Version 0.0.21.0 (#214)
Cranked Version 0.0.21.0
2017-10-02 14:37:34 -07:00
Manoj Ampalam a348597468 Support SSH certificates (#213)
support certificate authentication
2017-10-02 12:39:12 -07:00
Damien Miller 35ff70a04d sync contrib/ssh-copy-id with upstream 2017-10-01 10:01:25 +11:00
Damien Miller 290843b8ed update version in RPM spec files 2017-10-01 09:59:19 +11:00
Yanbing e649e8f926 Fix for issue 888, 880 (#211)
fix for PowerShell/Win32-OpenSSH#888
Add systemid as FullAccessNeeded
fix for PowerShell/Win32-OpenSSH#880
2017-09-28 14:55:40 -07:00
Yanbing afb81c082d Some updates on shell-host.c (#210)
PowerShell/Win32-OpenSSH#893
Create pipe using default buffer size
Update buffer size when read and write file
change to use _wcsnicmp
printed out error when create pipe
added release of the memory
2017-09-27 14:32:30 -07:00
bagajjal 8747626b6a Multiple terminal related fixes
Fix the bugs -
PowerShell/Win32-OpenSSH#845
PowerShell/Win32-OpenSSH#865
PowerShell/Win32-OpenSSH#885
PowerShell/Win32-OpenSSH#886
Refer to the below URL
https://github.com/mintty/mintty/wiki/Keycodes#Editing_keys.md
2017-09-27 12:16:41 -07:00
Manoj Ampalam b327f0c48a Fix to Issue 698 and other misc changes (#208)
Fix to PowerShell/Win32-OpenSSH#698 - Create job object, add ssh-shellhost and ensure all its child process and tied to its lifetime.
Other changes include changes to debug* statements in posix adapter that may cause recursion/stack overflow issues.
2017-09-21 22:00:39 -07:00
bagajjal c8c6b0b04e fix scp build issue, fix new warning msg in posixcompat (#209) 2017-09-21 21:12:01 -07:00
Yanbing 18b1e5935b multiple fixes for win7 (#206)
1. fix some exception when appverifier is enabled on win7 (https://gitthub.com/PowerShell/Win32-OpenSSH/issues/872)
2. enable sshdconfig tests on win7(https://github.com/PowerShell/Win32-OpenSSH/issues/873)
3. fix for https://github.com/PowerShell/Win32-OpenSSH/issues/874 ( ReadFile does not return on win7 when no content in console )
4. Remove logging to console in Readthread because write hangs here since write thread already closed (https://github.com/PowerShell/Win32-OpenSSH/issues/879)
5. fix VCTargetsPath
2017-09-15 21:25:42 -07:00
Manoj Ampalam 879318721c Enabled Control Flow Guard on all binaries 2017-09-14 09:09:17 -07:00
Yanbing 3b517afc77 Cranked Version 0.0.20.0 (#205) 2017-09-05 13:42:39 -07:00
bagajjal 6e7210d3c1 fix the CRLF issue, review comments related to allow/deny user/groups#861
* fix the CRLF issue
* fixing the allow/deny group review comments
2017-09-05 12:41:46 -07:00
bagajjal a38dfedb68 removed code to fix forwardslash issue as it depends on the keyboard type (#201)
PowerShell/Win32-OpenSSH#858
2017-09-05 11:47:42 -07:00
bagajjal ab2aefff6d Fix allow/deny groups #816 (#203)
Fixing allow groups, deny groups. (PowerShell/Win32-OpenSSH#816)
Convert users, groups read from sshd_config to lowercase.
2017-09-01 14:53:12 -07:00
annulus e8a303673e OpenSSHUtils ProfilePath parsing issues (#192)
1. ignore the historical (.bak) profile entries from the registry
2. do not match against different profiles that share the beginning of their path
2017-09-01 10:29:02 -07:00
Ben Hillis 7f64fc729a SendKeyStrokeEx should set wRepeatCount = 1
https://github.com/PowerShell/Win32-OpenSSH/issues/853
2017-08-31 14:11:54 -07:00
Manoj Ampalam 4a5fe9ea92 Ported changes to support Windows 2017-08-28 09:49:42 -07:00
Manoj Ampalam 19d40e6668 Ported changes to support Windows 2017-08-28 00:32:51 -07:00
Manoj Ampalam 8666d7b71b cranked version to 0.0.19.0 2017-08-18 12:29:56 -07:00
bagajjal 5cbb8c9e52 Fix ctrl sequences (#196)
PowerShell/Win32-OpenSSH#850 - Fixed alt+shift+? control sequence at ssh client and ssh server side.
PowerShell/Win32-OpenSSH#849 - Fixed ctrl sequences (ctrl+pageup/ctrl+home, etc)...
2017-08-18 12:21:26 -07:00
Manoj Ampalam f8371cf5c6 Fix (#195)
PowerShell/Win32-OpenSSH#846
2017-08-17 12:31:35 -07:00
Manoj Ampalam fdb2b110b7 Fix (#194)
Issue is within msv1_0.dll (NTLM SSP provider). Working around by doing a fake login that populates internal state within msv1_0.dll so further S4U logons work as expected.
PowerShell/Win32-OpenSSH#727
2017-08-17 12:12:09 -07:00