sshd enabling changes

This commit is contained in:
Manoj Ampalam 2016-03-10 15:18:09 -08:00
parent 64531446fa
commit 0e1f1c1cb3
8 changed files with 31 additions and 22 deletions

2
auth.c
View File

@ -647,7 +647,7 @@ auth_openfile(const char *file, struct passwd *pw, int strict_modes,
int fd; int fd;
FILE *f; FILE *f;
#ifdef WIN32_FIXME #if(0)def WIN32_FIXME
if ((fd = WSHELPwopen(file, O_RDONLY|O_NONBLOCK)) == -1) { if ((fd = WSHELPwopen(file, O_RDONLY|O_NONBLOCK)) == -1) {
#else #else
if ((fd = open(file, O_RDONLY|O_NONBLOCK)) == -1) { if ((fd = open(file, O_RDONLY|O_NONBLOCK)) == -1) {

View File

@ -1,7 +1,7 @@
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14 # Visual Studio 14
VisualStudioVersion = 14.0.24720.0 VisualStudioVersion = 14.0.23107.0
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ssh", "ssh.vcxproj", "{74E69D5E-A1EF-46EA-9173-19A412774104}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ssh", "ssh.vcxproj", "{74E69D5E-A1EF-46EA-9173-19A412774104}"
ProjectSection(ProjectDependencies) = postProject 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} {05E1115F-8529-46D0-AAAF-52A404CE79A7} = {05E1115F-8529-46D0-AAAF-52A404CE79A7}
{8F9D3B74-8D33-448E-9762-26E8DCC6B2F4} = {8F9D3B74-8D33-448E-9762-26E8DCC6B2F4} {8F9D3B74-8D33-448E-9762-26E8DCC6B2F4} = {8F9D3B74-8D33-448E-9762-26E8DCC6B2F4}
{DD483F7D-C553-4740-BC1A-903805AD0174} = {DD483F7D-C553-4740-BC1A-903805AD0174} {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} {8660C2FE-9874-432D-B047-E042BB41DBE0} = {8660C2FE-9874-432D-B047-E042BB41DBE0}
EndProjectSection EndProjectSection
EndProject EndProject

View File

@ -75,21 +75,25 @@
<LinkIncremental>true</LinkIncremental> <LinkIncremental>true</LinkIncremental>
<OutDir>$(OpenSSH-Bin-Path)$(Platform)\$(Configuration)\</OutDir> <OutDir>$(OpenSSH-Bin-Path)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir> <IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
<IncludePath>$(OpenSSH-Src-Path)contrib\win32\win32compat\inc;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental> <LinkIncremental>true</LinkIncremental>
<OutDir>$(OpenSSH-Bin-Path)$(Platform)\$(Configuration)\</OutDir> <OutDir>$(OpenSSH-Bin-Path)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir> <IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
<IncludePath>$(OpenSSH-Src-Path)contrib\win32\win32compat\inc;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental> <LinkIncremental>false</LinkIncremental>
<OutDir>$(OpenSSH-Bin-Path)$(Platform)\$(Configuration)\</OutDir> <OutDir>$(OpenSSH-Bin-Path)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir> <IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
<IncludePath>$(OpenSSH-Src-Path)contrib\win32\win32compat\inc;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental> <LinkIncremental>false</LinkIncremental>
<OutDir>$(OpenSSH-Bin-Path)$(Platform)\$(Configuration)\</OutDir> <OutDir>$(OpenSSH-Bin-Path)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir> <IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
<IncludePath>$(OpenSSH-Src-Path)contrib\win32\win32compat\inc;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup> </PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile> <ClCompile>
@ -106,7 +110,7 @@
<Link> <Link>
<SubSystem>Console</SubSystem> <SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation> <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> <AdditionalLibraryDirectories>$(OpenSSH-Lib-Path)$(Platform)\$(Configuration);$(OpenSSL-Win32-Debug-Path)lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput> <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>
</Link> </Link>
@ -129,7 +133,7 @@
<Link> <Link>
<SubSystem>Console</SubSystem> <SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation> <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> <AdditionalLibraryDirectories>$(OpenSSH-Lib-Path)$(Platform)\$(Configuration);$(OpenSSL-x64-Debug-Path)lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput> <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>
</Link> </Link>
@ -155,7 +159,7 @@
<GenerateDebugInformation>No</GenerateDebugInformation> <GenerateDebugInformation>No</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences> <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> <AdditionalLibraryDirectories>$(OpenSSH-Lib-Path)$(Platform)\$(Configuration);$(OpenSSL-Win32-Release-Path)lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput> <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>
</Link> </Link>
@ -182,7 +186,7 @@
<GenerateDebugInformation>No</GenerateDebugInformation> <GenerateDebugInformation>No</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences> <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> <AdditionalLibraryDirectories>$(OpenSSH-Lib-Path)$(Platform)\$(Configuration);$(OpenSSL-x64-Release-Path)lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput> <ForceFileOutput>MultiplyDefinedSymbolOnly</ForceFileOutput>
</Link> </Link>

View File

@ -115,5 +115,5 @@ int w32_allocate_fd_for_handle(HANDLE h);
#define WSHELPAddChildToWatch(a) w32_temp_AddChildToWatch((a)) #define WSHELPAddChildToWatch(a) w32_temp_AddChildToWatch((a))
#define sfd_to_handle(a) w32_fd_to_handle((a)) #define sfd_to_handle(a) w32_fd_to_handle((a))
#define allocate_sfd(a) w32_allocate_fd_for_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))

View File

@ -35,7 +35,7 @@
int startup_handler(void) int startup_handler(void)
{ {
WSHELPinitialize(); //WSHELPinitialize();
return 0; return 0;
} }

View File

@ -884,8 +884,9 @@ collect_children(void)
if (s->pid) if (s->pid)
CloseHandle(process); CloseHandle(process);
int WSHELPDelChildToWatch (HANDLE processtowatch); /*TODO - fix this*/
WSHELPDelChildToWatch (process); // take the process off from watch list in select mux //int WSHELPDelChildToWatch (HANDLE processtowatch);
//WSHELPDelChildToWatch (process); // take the process off from watch list in select mux
} }
} }
} while (i > 0); } while (i > 0);

View File

@ -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 sockin[1] = allocate_sfd((int)wfdtocmd); // put the std input handle in our global general handle table
} }
else else
socketpair(sockin); pipe(sockin);
#endif #endif
socketpair(sockout); pipe(sockout);
socketpair(sockerr); pipe(sockerr);
debug3("sockin[0]: %d sockin[1]: %d", sockin[0], sockin[1]); debug3("sockin[0]: %d sockin[1]: %d", sockin[0], sockin[1]);
debug3("sockout[0]: %d sockout[1]: %d", sockout[0], sockout[1]); debug3("sockout[0]: %d sockout[1]: %d", sockout[0], sockout[1]);
debug3("sockerr[0]: %d sockerr[1]: %d", sockerr[0], sockerr[1]); debug3("sockerr[0]: %d sockerr[1]: %d", sockerr[0], sockerr[1]);
#ifndef WIN32_PRAGMA_REMCON #ifndef WIN32_PRAGMA_REMCON
if ( (s -> is_subsystem) || (s ->ttyfd == -1)) // if ( (s -> is_subsystem) || (s ->ttyfd == -1))
crlf_sfd(sockin[1]); //crlf_sfd(sockin[1]);
crlf_sfd(sockout[1]); // crlf_sfd(sockout[1]);
if ( (s -> is_subsystem) || (s ->ttyfd == -1)) if ( (s -> is_subsystem) || (s ->ttyfd == -1))
#endif #endif
@ -1006,8 +1006,9 @@ do_exec_no_pty(Session *s, const char *command)
s -> processId = pi.dwProcessId; 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 // 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); /* TODO - fix thi s*/
WSHELPAddChildToWatch ( pi.hProcess); //int WSHELPAddChildToWatch ( HANDLE processtowatch);
//WSHELPAddChildToWatch ( pi.hProcess);
/* /*
* Set interactive/non-interactive mode. * Set interactive/non-interactive mode.

10
sshd.c
View File

@ -1602,7 +1602,7 @@ server_accept_loop(int *sock_in, int *sock_out, int *newsock, int *config_s)
sighup_restart(); sighup_restart();
if (fdset != NULL) if (fdset != NULL)
free(fdset); free(fdset);
#ifndef WIN32_FIXME #if(1)//ndef WIN32_FIXME
fdset = xcalloc(howmany(maxfd + 1, NFDBITS), fdset = xcalloc(howmany(maxfd + 1, NFDBITS),
sizeof(fd_mask)); sizeof(fd_mask));
#else #else
@ -1968,15 +1968,16 @@ main(int ac, char **av)
SetConsoleCtrlHandler(CtrlHandlerRoutine, TRUE); SetConsoleCtrlHandler(CtrlHandlerRoutine, TRUE);
w32posix_initialize();
//authctxt -> hTokenLsa_ = NULL; //authctxt -> hTokenLsa_ = NULL;
WSHELPinitialize(); /*WSHELPinitialize();
allocate_standard_descriptor(STDIN_FILENO); allocate_standard_descriptor(STDIN_FILENO);
allocate_standard_descriptor(STDOUT_FILENO); allocate_standard_descriptor(STDOUT_FILENO);
allocate_standard_descriptor(STDERR_FILENO); allocate_standard_descriptor(STDERR_FILENO);
sfd_start = 3; sfd_start = 3;*/
/* /*
* Initialize log. * Initialize log.
@ -2192,7 +2193,8 @@ main(int ac, char **av)
* Win32 only. * Win32 only.
*/ */
WSHELPinitialize(); //WSHELPinitialize();
w32posix_initialize();
/* /*
* Handle install and uninstall service options * Handle install and uninstall service options