diff --git a/contrib/win32/openssh/Win32-OpenSSH.VC.db b/contrib/win32/openssh/Win32-OpenSSH.VC.db index abc8e44..2b7ed30 100644 Binary files a/contrib/win32/openssh/Win32-OpenSSH.VC.db and b/contrib/win32/openssh/Win32-OpenSSH.VC.db differ diff --git a/contrib/win32/win32compat/pwd.c b/contrib/win32/win32compat/pwd.c index 4e8242a..e5c9593 100644 --- a/contrib/win32/win32compat/pwd.c +++ b/contrib/win32/win32compat/pwd.c @@ -33,7 +33,6 @@ #include #include #include -#include #define SECURITY_WIN32 #include #include "inc\pwd.h" @@ -71,7 +70,6 @@ get_passwd(const char *user_utf8, LPWSTR user_sid) { wchar_t reg_path[MAX_PATH], profile_home[MAX_PATH]; HKEY reg_key = 0; int tmp_len = MAX_PATH; - PDOMAIN_CONTROLLER_INFOW pdc = NULL; errno = 0; @@ -100,26 +98,12 @@ get_passwd(const char *user_utf8, LPWSTR user_sid) { } if (user_sid == NULL) { - if (NetUserGetInfo(udom_utf16, uname_utf16, 23, &user_info) != NERR_Success) { - if (DsGetDcNameW(NULL, udom_utf16, NULL, NULL, DS_DIRECTORY_SERVICE_PREFERRED, &pdc) == ERROR_SUCCESS) { - if (NetUserGetInfo(pdc->DomainControllerName, uname_utf16, 23, &user_info) != NERR_Success || + if (NetUserGetInfo(udom_utf16, uname_utf16, 23, &user_info) != NERR_Success || ConvertSidToStringSidW(((LPUSER_INFO_23)user_info)->usri23_user_sid, &user_sid_local) == FALSE) { errno = ENOMEM; //?? goto done; - } } - else { - errno = ENOMEM; //?? - goto done; - } - } - else { - if (ConvertSidToStringSidW(((LPUSER_INFO_23)user_info)->usri23_user_sid, &user_sid_local) == FALSE) { - errno = ENOMEM; //?? - goto done; - } - } - user_sid = user_sid_local; + user_sid = user_sid_local; } if (swprintf(reg_path, MAX_PATH, L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList\\%ls", user_sid) == MAX_PATH || @@ -151,8 +135,6 @@ done: LocalFree(user_sid_local); if (reg_key) RegCloseKey(reg_key); - if (pdc) - NetApiBufferFree(pdc); return ret; } diff --git a/scp.c b/scp.c index 38aed10..5d17447 100644 --- a/scp.c +++ b/scp.c @@ -1135,18 +1135,15 @@ main(int argc, char **argv) throughlocal = 1; break; case 'o': - addargs(&remote_remote_args, "-%c", ch); - addargs(&remote_remote_args, "%s", optarg); - addargs(&args, "-%c", ch); - addargs(&args, "%s", optarg); - break; - case 'c': + case 'c': addargs(&remote_remote_args, "-%c", ch); addargs(&remote_remote_args, "%s", optarg); addargs(&args, "-%c", ch); addargs(&args, "%s", optarg); - cipher = xstrdup(optarg);; + cipher = malloc(strlen(optarg) + 1); + if (cipher) + strcpy(cipher, optarg); break; case 'i': addargs(&remote_remote_args, "-%c", ch); @@ -1154,7 +1151,9 @@ main(int argc, char **argv) addargs(&args, "-%c", ch); addargs(&args, "%s", optarg); - identity = xstrdup(optarg);; + identity = malloc(strlen(optarg) + 1); + if (identity) + strcpy(identity, optarg); break; case 'F': addargs(&remote_remote_args, "-%c", ch); @@ -1162,7 +1161,9 @@ main(int argc, char **argv) addargs(&args, "-%c", ch); addargs(&args, "%s", optarg); - ssh_config = xstrdup(optarg);; + ssh_config = malloc(strlen(optarg) + 1); + if (ssh_config) + strcpy(ssh_config, optarg); break; case 'P': addargs(&remote_remote_args, "-p"); @@ -1170,7 +1171,9 @@ main(int argc, char **argv) addargs(&args, "-p"); addargs(&args, "%s", optarg); - port = xstrdup(optarg);; + port = malloc(strlen(optarg) + 1); + if (port) + strcpy(port, optarg); break; case 'B': addargs(&remote_remote_args, "\"-oBatchmode yes\""); @@ -1358,7 +1361,7 @@ toremote(char *targ, int argc, char **argv) return; } - for (i = 0; i < argc - 1; i++) { + for (i = 0; i < argc - 1; i++) { src = colon(argv[i]); if (src && throughlocal) { /* extended remote to remote */ *src++ = 0;