Additional logging in ssh-agent

This commit is contained in:
Manoj Ampalam 2016-07-01 11:47:51 -07:00
parent 071b0d49e5
commit 0a7741d45d

View File

@ -138,21 +138,23 @@ generate_user_token(wchar_t* user) {
if (AllocateLocallyUniqueId(&sourceContext.SourceIdentifier) != TRUE) if (AllocateLocallyUniqueId(&sourceContext.SourceIdentifier) != TRUE)
goto done; goto done;
if (ret = LsaLogonUser(lsa_handle, if (ret = LsaLogonUser(lsa_handle,
&originName, &originName,
Network, Network,
auth_package_id, auth_package_id,
logon_info, logon_info,
logon_info_size, logon_info_size,
NULL, NULL,
&sourceContext, &sourceContext,
(PVOID*)&pProfile, (PVOID*)&pProfile,
&cbProfile, &cbProfile,
&logonId, &logonId,
&token, &token,
&quotas, &quotas,
&subStatus) != STATUS_SUCCESS) &subStatus) != STATUS_SUCCESS) {
debug("LsaRegisterLogonProcess failed");
goto done; goto done;
}
done: done:
if (lsa_handle) if (lsa_handle)
@ -193,13 +195,13 @@ int process_authagent_request(struct sshbuf* request, struct sshbuf* response, s
if (MultiByteToWideChar(CP_UTF8, 0, user, user_len + 1, wuser, MAX_USER_NAME_LEN) == 0 || if (MultiByteToWideChar(CP_UTF8, 0, user, user_len + 1, wuser, MAX_USER_NAME_LEN) == 0 ||
(token = generate_user_token(wuser)) == 0) { (token = generate_user_token(wuser)) == 0) {
debug("unable to generate user token"); debug("unable to generate token for user %ls", wuser);
goto done; goto done;
} }
if (SHGetKnownFolderPath(&FOLDERID_Profile, 0, token, &wuser_home) != S_OK || if (SHGetKnownFolderPath(&FOLDERID_Profile, 0, token, &wuser_home) != S_OK ||
pubkey_allowed(key, wuser, wuser_home) != 1) { pubkey_allowed(key, wuser, wuser_home) != 1) {
debug("given public key is not mapped to user %ls", wuser); debug("given public key is not mapped to user %ls (profile:%ls)", wuser, wuser_home);
goto done; goto done;
} }