mirror of
https://github.com/PowerShell/Win32-OpenSSH.git
synced 2025-07-21 21:14:51 +02:00
Fixes to some issues
This commit is contained in:
parent
6239a2847b
commit
bc83d7d29e
@ -90,7 +90,7 @@ BOOL WINAPI ctrl_c_handler(
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int wmain(int argc, wchar_t **argv) {
|
||||||
|
|
||||||
w32posix_initialize();
|
w32posix_initialize();
|
||||||
load_config();
|
load_config();
|
||||||
@ -108,7 +108,7 @@ int main(int argc, char **argv) {
|
|||||||
if (argc == 2) {
|
if (argc == 2) {
|
||||||
/*agent process is likely a spawned child*/
|
/*agent process is likely a spawned child*/
|
||||||
char* h = 0;
|
char* h = 0;
|
||||||
h += atoi(*(argv + 1));
|
h += _wtoi(*(argv + 1));
|
||||||
if (h != 0) {
|
if (h != 0) {
|
||||||
log_init("ssh-agent", config_log_level(), 1, 0);
|
log_init("ssh-agent", config_log_level(), 1, 0);
|
||||||
agent_start(FALSE, TRUE, h);
|
agent_start(FALSE, TRUE, h);
|
||||||
|
@ -552,7 +552,7 @@ int do_exec_windows(Session *s, const char *command, int pty) {
|
|||||||
memcpy(c, command, strlen(command));
|
memcpy(c, command, strlen(command));
|
||||||
c += strlen(command);
|
c += strlen(command);
|
||||||
}
|
}
|
||||||
*c == '\0';
|
*c = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
/* setup Environment varibles */
|
/* setup Environment varibles */
|
||||||
@ -561,7 +561,7 @@ int do_exec_windows(Session *s, const char *command, int pty) {
|
|||||||
char buf[128];
|
char buf[128];
|
||||||
char* laddr;
|
char* laddr;
|
||||||
|
|
||||||
if ((tmp == utf8_to_utf16(s->pw->pw_name)) != NULL)
|
if ((tmp = utf8_to_utf16(s->pw->pw_name)) == NULL)
|
||||||
fatal("%s, out of memory");
|
fatal("%s, out of memory");
|
||||||
SetEnvironmentVariableW(L"USERNAME", tmp);
|
SetEnvironmentVariableW(L"USERNAME", tmp);
|
||||||
free(tmp);
|
free(tmp);
|
||||||
@ -579,6 +579,7 @@ int do_exec_windows(Session *s, const char *command, int pty) {
|
|||||||
wchar_t wc = pw_dir_w[2];
|
wchar_t wc = pw_dir_w[2];
|
||||||
pw_dir_w[2] = L'\0';
|
pw_dir_w[2] = L'\0';
|
||||||
SetEnvironmentVariableW(L"HOMEDRIVE", pw_dir_w);
|
SetEnvironmentVariableW(L"HOMEDRIVE", pw_dir_w);
|
||||||
|
pw_dir_w[2] = wc;
|
||||||
}
|
}
|
||||||
|
|
||||||
snprintf(buf, sizeof buf, "%.50s %d %d",
|
snprintf(buf, sizeof buf, "%.50s %d %d",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user