Skip to content

Commit 716befa

Browse files
committed
Merge
2 parents 5bd9d2a + f990092 commit 716befa

File tree

16 files changed

+604
-542
lines changed

16 files changed

+604
-542
lines changed

contrib/win32/openssh/Win32-OpenSSH.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 14
4-
VisualStudioVersion = 14.0.23107.0
4+
VisualStudioVersion = 14.0.25420.1
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ssh", "ssh.vcxproj", "{74E69D5E-A1EF-46EA-9173-19A412774104}"
77
ProjectSection(ProjectDependencies) = postProject

contrib/win32/openssh/version.rc

0 Bytes
Binary file not shown.

contrib/win32/win32compat/console.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
#define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x4
4747
#endif
4848

49-
HANDLE hInputConsole = NULL;
5049
HANDLE hOutputConsole = NULL;
5150
DWORD dwSavedAttributes = 0;
5251
WORD wStartingAttributes = 0;

contrib/win32/win32compat/inc/w32posix.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ int w32_getaddrinfo(const char *, const char *,
8888
const struct addrinfo *, struct addrinfo **);
8989
FILE* w32_fopen_utf8(const char *, const char *);
9090
int w32_ftruncate(int fd, off_t length);
91+
char* w32_programdir();
92+
9193

9294
/* Shutdown constants */
9395
#define SHUT_WR SD_SEND

contrib/win32/win32compat/misc.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,3 +141,27 @@ utf16_to_utf8(const wchar_t* utf16) {
141141
return NULL;
142142
return utf8;
143143
}
144+
145+
static char* s_programdir = NULL;
146+
char* w32_programdir() {
147+
if (s_programdir != NULL)
148+
return s_programdir;
149+
150+
if ((s_programdir = utf16_to_utf8(_wpgmptr)) == NULL)
151+
return NULL;
152+
153+
/* null terminate after directory path */
154+
{
155+
char* tail = s_programdir + strlen(s_programdir);
156+
while (tail > s_programdir && *tail != '\\' && *tail != '/')
157+
tail--;
158+
159+
if (tail > s_programdir)
160+
*tail = '\0';
161+
else
162+
*tail = '.'; /* current directory */
163+
}
164+
165+
return s_programdir;
166+
167+
}

contrib/win32/win32compat/pwd.c

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -202,48 +202,6 @@ w32_getpwuid(uid_t uid) {
202202
return ret;
203203
}
204204

205-
/* given a access token, find the domain name of user account of the access token */
206-
int GetDomainFromToken ( HANDLE *hAccessToken, UCHAR *domain, DWORD dwSize)
207-
{
208-
UCHAR InfoBuffer[1000],username[200];
209-
PTOKEN_USER pTokenUser = (PTOKEN_USER)InfoBuffer;
210-
DWORD dwInfoBufferSize,dwAccountSize = 200, dwDomainSize = dwSize;
211-
SID_NAME_USE snu;
212-
213-
domain[0] = '\0' ;
214-
GetTokenInformation(*hAccessToken,TokenUser,InfoBuffer,
215-
1000, &dwInfoBufferSize);
216-
217-
LookupAccountSid(NULL, pTokenUser->User.Sid, (LPSTR)username,
218-
&dwAccountSize,(LPSTR)domain, &dwDomainSize, &snu);
219-
return 0;
220-
}
221-
222-
/*
223-
* Retrieve user homedir from token, save it in static string
224-
* and return pointer to this string.
225-
*
226-
* userName - user's name (IN)
227-
* token - logon user's token (IN)
228-
*
229-
* RETURNS: pointer to static string with homedir or NULL if fails.
230-
*/
231-
232-
#define SET_USER_ENV(folder_id, evn_variable) do { \
233-
if (SHGetKnownFolderPath(&folder_id,0,token,&path) == S_OK) \
234-
{ \
235-
SetEnvironmentVariableW(evn_variable, path); \
236-
CoTaskMemFree(path); \
237-
} \
238-
} while (0)
239-
240-
/*
241-
* Temporary getpwuid implementaion of Windows. This should be replaced with getpw_currentuser
242-
*/
243-
244-
245-
246-
247205

248206
/* TODO - this is moved from realpath.c in openbsdcompat. Review and finalize its position*/
249207

0 commit comments

Comments
 (0)