mirror of
https://github.com/PowerShell/Win32-OpenSSH.git
synced 2025-07-27 07:54:50 +02:00
sshd enabling changes
This commit is contained in:
parent
64531446fa
commit
0e1f1c1cb3
2
auth.c
2
auth.c
@ -647,7 +647,7 @@ auth_openfile(const char *file, struct passwd *pw, int strict_modes,
|
||||
int fd;
|
||||
FILE *f;
|
||||
|
||||
#ifdef WIN32_FIXME
|
||||
#if(0)def WIN32_FIXME
|
||||
if ((fd = WSHELPwopen(file, O_RDONLY|O_NONBLOCK)) == -1) {
|
||||
#else
|
||||
if ((fd = open(file, O_RDONLY|O_NONBLOCK)) == -1) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.24720.0
|
||||
VisualStudioVersion = 14.0.23107.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ssh", "ssh.vcxproj", "{74E69D5E-A1EF-46EA-9173-19A412774104}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
@ -97,6 +97,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sshd", "sshd.vcxproj", "{F5
|
||||
{05E1115F-8529-46D0-AAAF-52A404CE79A7} = {05E1115F-8529-46D0-AAAF-52A404CE79A7}
|
||||
{8F9D3B74-8D33-448E-9762-26E8DCC6B2F4} = {8F9D3B74-8D33-448E-9762-26E8DCC6B2F4}
|
||||
{DD483F7D-C553-4740-BC1A-903805AD0174} = {DD483F7D-C553-4740-BC1A-903805AD0174}
|
||||
{0D02F0F0-013B-4EE3-906D-86517F3822C0} = {0D02F0F0-013B-4EE3-906D-86517F3822C0}
|
||||
{8660C2FE-9874-432D-B047-E042BB41DBE0} = {8660C2FE-9874-432D-B047-E042BB41DBE0}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
|
@ -75,21 +75,25 @@
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(OpenSSH-Bin-Path)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
|
||||
<IncludePath>$(OpenSSH-Src-Path)contrib\win32\win32compat\inc;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(OpenSSH-Bin-Path)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
|
||||
<IncludePath>$(OpenSSH-Src-Path)contrib\win32\win32compat\inc;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(OpenSSH-Bin-Path)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
|
||||
<IncludePath>$(OpenSSH-Src-Path)contrib\win32\win32compat\inc;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(OpenSSH-Bin-Path)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
|
||||
<IncludePath>$(OpenSSH-Src-Path)contrib\win32\win32compat\inc;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
@ -106,7 +110,7 @@
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>bcrypt.lib;Userenv.lib;Ws2_32.lib;Secur32.lib;Shlwapi.lib;openbsd_compat.lib;libssh.lib;win32compat.lib;libeay32.lib;Netapi32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>win32iocompat.lib;bcrypt.lib;Userenv.lib;Ws2_32.lib;Secur32.lib;Shlwapi.lib;openbsd_compat.lib;libssh.lib;win32compat.lib;libeay32.lib;Netapi32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(OpenSSH-Lib-Path)$(Platform)\$(Configuration);$(OpenSSL-Win32-Debug-Path)lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>
|
||||
</Link>
|
||||
@ -129,7 +133,7 @@
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>bcrypt.lib;Userenv.lib;Ws2_32.lib;Secur32.lib;Shlwapi.lib;openbsd_compat.lib;libssh.lib;win32compat.lib;libeay32.lib;Netapi32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>win32iocompat.lib;bcrypt.lib;Userenv.lib;Ws2_32.lib;Secur32.lib;Shlwapi.lib;openbsd_compat.lib;libssh.lib;win32compat.lib;libeay32.lib;Netapi32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(OpenSSH-Lib-Path)$(Platform)\$(Configuration);$(OpenSSL-x64-Debug-Path)lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>
|
||||
</Link>
|
||||
@ -155,7 +159,7 @@
|
||||
<GenerateDebugInformation>No</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalDependencies>bcrypt.lib;Userenv.lib;Ws2_32.lib;Secur32.lib;Shlwapi.lib;openbsd_compat.lib;libssh.lib;win32compat.lib;libeay32.lib;Netapi32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>win32iocompat.lib;bcrypt.lib;Userenv.lib;Ws2_32.lib;Secur32.lib;Shlwapi.lib;openbsd_compat.lib;libssh.lib;win32compat.lib;libeay32.lib;Netapi32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(OpenSSH-Lib-Path)$(Platform)\$(Configuration);$(OpenSSL-Win32-Release-Path)lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>
|
||||
</Link>
|
||||
@ -182,7 +186,7 @@
|
||||
<GenerateDebugInformation>No</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalDependencies>bcrypt.lib;Userenv.lib;Ws2_32.lib;Secur32.lib;Shlwapi.lib;openbsd_compat.lib;libssh.lib;win32compat.lib;libeay32.lib;Netapi32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>win32iocompat.lib;bcrypt.lib;Userenv.lib;Ws2_32.lib;Secur32.lib;Shlwapi.lib;openbsd_compat.lib;libssh.lib;win32compat.lib;libeay32.lib;Netapi32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(OpenSSH-Lib-Path)$(Platform)\$(Configuration);$(OpenSSL-x64-Release-Path)lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>
|
||||
</Link>
|
||||
|
@ -115,5 +115,5 @@ int w32_allocate_fd_for_handle(HANDLE h);
|
||||
#define WSHELPAddChildToWatch(a) w32_temp_AddChildToWatch((a))
|
||||
#define sfd_to_handle(a) w32_fd_to_handle((a))
|
||||
#define allocate_sfd(a) w32_allocate_fd_for_handle((a))
|
||||
#define WSHELPwopen(a) w32_open((a))
|
||||
//#define WSHELPwopen(a, b) w32_open((a, b))
|
||||
|
||||
|
@ -35,7 +35,7 @@
|
||||
|
||||
int startup_handler(void)
|
||||
{
|
||||
WSHELPinitialize();
|
||||
//WSHELPinitialize();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -884,8 +884,9 @@ collect_children(void)
|
||||
|
||||
if (s->pid)
|
||||
CloseHandle(process);
|
||||
int WSHELPDelChildToWatch (HANDLE processtowatch);
|
||||
WSHELPDelChildToWatch (process); // take the process off from watch list in select mux
|
||||
/*TODO - fix this*/
|
||||
//int WSHELPDelChildToWatch (HANDLE processtowatch);
|
||||
//WSHELPDelChildToWatch (process); // take the process off from watch list in select mux
|
||||
}
|
||||
}
|
||||
} while (i > 0);
|
||||
|
17
session.c
17
session.c
@ -661,21 +661,21 @@ do_exec_no_pty(Session *s, const char *command)
|
||||
sockin[1] = allocate_sfd((int)wfdtocmd); // put the std input handle in our global general handle table
|
||||
}
|
||||
else
|
||||
socketpair(sockin);
|
||||
pipe(sockin);
|
||||
#endif
|
||||
|
||||
socketpair(sockout);
|
||||
socketpair(sockerr);
|
||||
pipe(sockout);
|
||||
pipe(sockerr);
|
||||
|
||||
debug3("sockin[0]: %d sockin[1]: %d", sockin[0], sockin[1]);
|
||||
debug3("sockout[0]: %d sockout[1]: %d", sockout[0], sockout[1]);
|
||||
debug3("sockerr[0]: %d sockerr[1]: %d", sockerr[0], sockerr[1]);
|
||||
|
||||
#ifndef WIN32_PRAGMA_REMCON
|
||||
if ( (s -> is_subsystem) || (s ->ttyfd == -1))
|
||||
crlf_sfd(sockin[1]);
|
||||
// if ( (s -> is_subsystem) || (s ->ttyfd == -1))
|
||||
//crlf_sfd(sockin[1]);
|
||||
|
||||
crlf_sfd(sockout[1]);
|
||||
// crlf_sfd(sockout[1]);
|
||||
|
||||
if ( (s -> is_subsystem) || (s ->ttyfd == -1))
|
||||
#endif
|
||||
@ -1006,8 +1006,9 @@ do_exec_no_pty(Session *s, const char *command)
|
||||
s -> processId = pi.dwProcessId;
|
||||
|
||||
// Add the child process created to select mux so that during our select data call we know if the process has exited
|
||||
int WSHELPAddChildToWatch ( HANDLE processtowatch);
|
||||
WSHELPAddChildToWatch ( pi.hProcess);
|
||||
/* TODO - fix thi s*/
|
||||
//int WSHELPAddChildToWatch ( HANDLE processtowatch);
|
||||
//WSHELPAddChildToWatch ( pi.hProcess);
|
||||
|
||||
/*
|
||||
* Set interactive/non-interactive mode.
|
||||
|
10
sshd.c
10
sshd.c
@ -1602,7 +1602,7 @@ server_accept_loop(int *sock_in, int *sock_out, int *newsock, int *config_s)
|
||||
sighup_restart();
|
||||
if (fdset != NULL)
|
||||
free(fdset);
|
||||
#ifndef WIN32_FIXME
|
||||
#if(1)//ndef WIN32_FIXME
|
||||
fdset = xcalloc(howmany(maxfd + 1, NFDBITS),
|
||||
sizeof(fd_mask));
|
||||
#else
|
||||
@ -1968,15 +1968,16 @@ main(int ac, char **av)
|
||||
|
||||
SetConsoleCtrlHandler(CtrlHandlerRoutine, TRUE);
|
||||
|
||||
w32posix_initialize();
|
||||
//authctxt -> hTokenLsa_ = NULL;
|
||||
|
||||
WSHELPinitialize();
|
||||
/*WSHELPinitialize();
|
||||
|
||||
allocate_standard_descriptor(STDIN_FILENO);
|
||||
allocate_standard_descriptor(STDOUT_FILENO);
|
||||
allocate_standard_descriptor(STDERR_FILENO);
|
||||
|
||||
sfd_start = 3;
|
||||
sfd_start = 3;*/
|
||||
|
||||
/*
|
||||
* Initialize log.
|
||||
@ -2192,7 +2193,8 @@ main(int ac, char **av)
|
||||
* Win32 only.
|
||||
*/
|
||||
|
||||
WSHELPinitialize();
|
||||
//WSHELPinitialize();
|
||||
w32posix_initialize();
|
||||
|
||||
/*
|
||||
* Handle install and uninstall service options
|
||||
|
Loading…
x
Reference in New Issue
Block a user