including useridentity when creating clientowner

This commit is contained in:
Olga Kornievskaia 2011-09-30 16:36:30 -04:00
parent c90811be75
commit fc6ac77f28

View file

@ -483,6 +483,14 @@ int nfs41_client_owner(
DWORD length;
const ULONGLONG time_created = GetTickCount64();
int status;
char username[UNLEN + 1];
DWORD len = UNLEN + 1;
if (!GetUserNameA(username, &len)) {
status = GetLastError();
eprintf("GetUserName() failed with %d\n", status);
goto out;
}
/* owner.verifier = "time created" */
memcpy(owner->co_verifier, &time_created, sizeof(time_created));
@ -506,6 +514,12 @@ int nfs41_client_owner(
goto out_hash;
}
if (!CryptHashData(hash, (const BYTE*)username, (DWORD)strlen(username), 0)) {
status = GetLastError();
eprintf("CryptHashData() failed with %d\n", status);
goto out_hash;
}
if (!CryptHashData(hash, (const BYTE*)name, (DWORD)strlen(name), 0)) {
status = GetLastError();
eprintf("CryptHashData() failed with %d\n", status);