Commit Graph

241 Commits

Author SHA1 Message Date
bagajjal 54824dd72e
Administrator non en-us OS. (#488) 2021-03-25 14:25:42 -07:00
bagajjal 2539e60536
fix HKEY_LOCAL_MACHINE\SOFTWARE\OpenSSH registry permissions (#484) 2021-03-22 19:17:33 -07:00
bagajjal bc7adf5a84
Allow users to configure custom shell arguments (#480) 2021-03-03 18:05:25 -08:00
Scott Bennett 8ab565c53f
Prevent duplicated login message (#426) 2020-04-02 14:34:30 -07:00
Bryan Berns 106db2baac
Make w32_rename() Atomic For Files (#438) 2020-04-02 10:17:27 -07:00
bagajjal 901f123915
conExitRawMode() - set in_raw_mode to 0 2020-04-01 22:02:28 -07:00
Scott Bennett a228c2fbaa
Reset console after exiting raw mode (#425) 2020-04-01 21:59:19 -07:00
bagajjal 0516e2d619
Fix cursor scroll issue for downlevel OS (#430) 2020-03-16 16:27:57 -07:00
bagajjal 6b1af6abaa
Fix to pipe shell commands. (#429)
Fix to pipe shell commands.
Fix random test failures
2020-02-28 18:06:18 +00:00
bagajjal 0bd3eb973b
remove CREATE_NO_WINDOW
Interactive sftp is broken.
2019-12-17 17:00:49 -08:00
bagajjal ac41232677
Match user force command (pty) (#421) 2019-12-17 14:11:40 -08:00
Bryan Berns 2c2ac97333 Add Long File Name Support (#400) 2019-12-17 12:40:36 -08:00
Oldřich Jedlička 2736cb7b0c Resolve local user name same as machine name to <user_name aka machine_name>\<user_name aka machine_name> 2019-12-16 16:44:07 -08:00
Bryan Berns 7dd58ed31f Allow Use Of Non-ASCII Character In SSH Client Passwords (#322)
* Allow Use Of Non-ASCII Character In SSH Client Passwords
2019-12-12 14:33:05 -08:00
bugale 17c9c6dbb3 Using the Y viewport for setting cursor correctly (#368)
[shellhost] - fix cursor position, Y viewport.
2019-12-12 14:32:17 -08:00
sasdf 1b9b599f60 Change /dev/null to NUL (#403)
1) Change /dev/null to NUL.
2) Add logic to check for NULL_DEVICE_WIN in fileio.c and misc.c
2019-12-12 14:30:11 -08: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
bagajjal 9b327de3e7
While spawning sshd process, use DETACHED_PROCESS flag 2019-12-09 11:51:24 -08:00
Bryan Berns 25588ffb7a Potential Bug When First Character In Path Is Unicode (#398)
Fix is_absolute_path() to ignore non-ASCII values.
2019-12-09 11:31:22 -08:00
bagajjal 8cf6003bac
CreateProcess with CREATE_NO_WINDOW flag (#413)
* createProcess() should spawn a new process with an invisible console window.
2019-12-09 10:54:18 -08:00
bagajjal 34608f3d29
Read VTSequence from console (#412)
Use console win32 API to read the VTSequence for keystrokes on client-side.
2019-12-05 13:20:04 -08:00
bagajjal 9e42eb0c76
Update logic to identify console conpty support (#411)
conpty identity logic.
2019-12-02 10:57:03 -08:00
Ed Schaller a4ea7dcced Fix comparison between wchar and ptr (#401) 2019-11-15 22:49:38 -08:00
Manoj Ampalam 7ae6defce8
Added support for AuthorizedKeysCommand and AuthorizedPrincipalsCommand (#409) 2019-11-15 10:51:45 -08:00
Manoj Ampalam 754f7b4885 Ported v8.1 changes 2019-11-01 12:20:04 -07:00
bagajjal 0d93457a2e Added compression support vai Zlib (#404) 2019-11-01 10:57:34 -07:00
Manoj Ampalam aaf11e2149
Fixed various unhandled failure paths in Kerb GSS/SSPI adapter (#393) 2019-10-10 11:42:28 -07:00
Manoj Ampalam 9cc51aa7e4
Fixed issue around incorrect handling of Handle and CredHandle types in Kerb GSS/SSPI adapter code
Prior logic was using a common variable to encapsulate both these types and doing a runtime check based on GetTokenInformation call to determine the actual underlying type. These two types are not guaranteed to have different values and any conflict could result in a random crash that would be nearly impossible to debug.
2019-09-10 14:38:16 -07:00
Bryan Berns 8346fc0d43 Correct Unicode Path Handling (#388)
Adjusted realpath() to use _wfullpath() to handle cases where paths may contain unicode characters.
Addresses PowerShell/Win32-OpenSSH#1401.
2019-07-16 11:42:02 -07:00
Bryan Berns b68e74d05c Address GSSAPI Crash When Non-Domain User Is Specified (#385)
Updated gss_release_cred() to test if passed structure is actually a logon token and, if so, release the data properly.
Addresses PowerShell/Win32-OpenSSH#1405
2019-06-27 11:00:57 -07:00
Bryan Berns 3d35b912a7 Updated Permissions Check For SidHistory (#375)
- Updated check_secure_file_permission() to perform a reverse lookups on the trustee SID within the file security descriptor to account for multiple SIDs that actually point to the same user.
- Updated permissions message to display the resolved SID to help with end user debugging.

Addresses: PowerShell/Win32-OpenSSH#1342
2019-06-10 12:30:11 -07:00
Manoj Ampalam 7ed284f878
Ported v8.0 changes 2019-05-24 23:08:06 -07:00
bugale c9c6da0bee Added keystroke mapping Shift+Tab in shellhost (#367) 2019-05-21 14:03:53 -07:00
Bryan Berns 18884b29fd Addressed Thread Hanging Issue (#374)
- Replaced TerminateThread() call with an interrupt routine to gracefully call _endthreadex(0).
- Resolves https://github.com/PowerShell/Win32-OpenSSH/issues/1338.
2019-05-21 13:56:59 -07:00
Bryan Berns 44ba5483cd Enable PKCS11 Support (#331)
- Enable use of PKCS11 library files by adjusting central configuration file.
- Modified dlsym() to return a void pointer instead of an int which is consistent with POSIX. The previous return type caused an issue with 32-bit builds with PKCS11 enabled.
2019-05-21 13:36:24 -07:00
Manoj Ampalam bfd4ddf194
Account for dev/null being reported as a terminal handle
https://github.com/PowerShell/Win32-OpenSSH/issues/1330

Issue: open(dev/nul) returns a handle is passes isatty() test (i.e its being treated as a terminal handle by OS). This handle seems to work fine for as a console handle for console APIs, except when NUL is explicitly redirected. 
This works
ssh -n target hostname

but this hangs due to a deadlock from writing a log entry on a console API failure
ssh -n target hostname < NUL

Fix: Ignore console API failures when the handle is being reported as invalid.
2019-05-21 13:25:49 -07:00
Bryan Berns 22cc95e986 Fixed fileio_fdopen() to simply return the file descriptor for non-disk file types
Addresses issue where an error message in SCP (server side) was not being returned to the pipe which causes the process to hang.  Resolves: https://github.com/PowerShell/Win32-OpenSSH/issues/1345
2019-05-21 13:22:54 -07:00
Chris Spencer 3449eb2152 Added dlerror() and fixed issue with dlopen() handling UTF-8 filenames
dlerror() is supposed to return a char *, but currently returns a
DWORD. Reimplement it using the Win32 FormatMessage function.
Correctly handle UTF-8 filenames in the Win32 implementation of dlopen()
2019-05-21 13:02:53 -07:00
Bryan Berns 959cbe3265 Allow Console Output In UTF-8 (#378)
- Address issue where console output does not display UTF-8 string properly.
- Resolves https://github.com/PowerShell/Win32-OpenSSH/issues/1225
2019-05-20 14:51:05 -07:00
Bryan Berns 2abb7748a9 Address Renaming Issue With exFAT File Systems (#381)
- Updated Win32 error translation table to translate ERROR_INVALID_FUNCTION as EOPNOTSUPP which in turn allows the SFTP rename capability to failover to rename() when link()/unlink() combination does not work due to the volume not supporting it.
- Addressed file security descriptor with no defined DACL.
PowerShell/Win32-OpenSSH#1357
2019-03-25 09:53:23 -07:00
Manoj Ampalam 68ad673db4
Workaround for PTY regressions
Changes from #353 enabled closing of previously duplicated Console handles - this is causing TTY rendering issues in ssh.exe.
Added a workaround for now to skip closing Console handles.
2019-01-11 12:19:39 -08:00
Bryan Berns 2f551d4535 Kerberos SSPI Support Via GSSAPI
Added an implementation of GSSAPI interface to support Kerberos SSPI within OpenSSH. This is only a partial definition of the full GSSAPI specification since OpenSSH only requires a subset of the overall GSSAPI functionality.
2019-01-08 20:29:58 -08:00
Manoj Ampalam 495db5b7e4
Fixes to ssh-agent issues
PowerShell/Win32-OpenSSH#1263
Issue: ssh-agent is using default sign algorithm, without considering related flags in request
Fix: parse flags and consider sign algorithm input

PowerShell/Win32-OpenSSH#1234
Issue: ssh-agent has old logic to lookup sshd account
Fix: remove this redundant logic
2019-01-05 13:16:51 -08:00
Yan Tesis c6fa13b82e Fix listing agent keys with forwarded agent (#363)
Gracefully fail SSH1 agent requests
2019-01-04 23:44:34 -08:00
Yanbing 54b0ce9b56
fix of issue 1290 (#358)
Fix processid assignment, memory leak and handle leaks on conpty session.
2018-11-16 15:36:31 -08:00
Manoj Ampalam 83bff88b24
Fix Console handle leaks (#357)
Issue: Earlier change missed "return" calls that will end up ignoring singleton logic and re-running console handle generation logic multiple times, leaking previously created handles in the process.

Fix: Add the missing "return" calls
2018-11-15 13:33:22 -08:00
bagajjal 4666c11e0e
Use kernerl32.dll instead of kernelbase.dll for checking conpty support (#356) 2018-11-14 14:49:24 -08:00
Manoj Ampalam 5faac25142
Fixes to PTY session regressions
With recent changes, PTY sessions are no longer working. The issue is due to TTY code in ssh.exe assuming that stdin and stdout are console handles. The reality could be different since these handles always are dup'ed or closed for other reasons.
Fix involves extracting console handles via CreateFile(CONIN\CONOUT).
2018-11-07 12:30:57 -08:00
bagajjal 6cacff8a74 dynamically check for conpty support (#352) 2018-11-07 12:29:29 -08:00
Yanbing a75116b6f8 Fix of 1211 and 1082 (#349)
PowerShell/Win32-OpenSSH#1211
PowerShell/Win32-OpenSSH#1082

Added support for posix_spawnp that executes the command directly instead of appending path. (SH_ASKPASS and proxy command use this). Refactored posix spawn commandline building logic to automatically account for Windows CRT escaping rules on all arguments.
2018-11-05 12:22:20 -08:00