1
mirror of https://github.com/rapid7/metasploit-payloads synced 2025-01-14 17:37:27 +01:00

cleanup flag conversion

use simpler conversion of bit flags to
quasi-boolean values. just a little space saved and easier to read hopefully

MSP-12356
This commit is contained in:
David Maloney 2015-05-06 09:54:36 -05:00
parent 39d1860f7d
commit df1181fe32

View File

@ -291,21 +291,12 @@ JET_ERR read_user(jetState *ntdsState, ntdsColumns *accountColumns, decryptedPEK
if (readStatus != JET_errSuccess){
return readStatus;
}
if (accountControl & NTDS_ACCOUNT_DISABLED){
userAccount->accountDisabled = TRUE;
}
if (accountControl & NTDS_ACCOUNT_LOCKED){
userAccount->accountLocked = TRUE;
}
if (accountControl & NTDS_ACCOUNT_NO_PASS){
userAccount->noPassword = TRUE;
}
if (accountControl & NTDS_ACCOUNT_PASS_EXPIRED){
userAccount->passExpired = TRUE;
}
if (accountControl & NTDS_ACCOUNT_PASS_NO_EXPIRE){
userAccount->passNoExpire = TRUE;
}
userAccount->accountDisabled = !!(accountControl & NTDS_ACCOUNT_DISABLED);
userAccount->accountLocked = !!(accountControl & NTDS_ACCOUNT_LOCKED);
userAccount->noPassword = !!(accountControl & NTDS_ACCOUNT_NO_PASS);
userAccount->passExpired = !!(accountControl & NTDS_ACCOUNT_PASS_EXPIRED);
userAccount->passNoExpire = !!(accountControl & NTDS_ACCOUNT_PASS_NO_EXPIRE);
// Grab the Logon Count here
readStatus = JetRetrieveColumn(ntdsState->jetSession, ntdsState->jetTable, accountColumns->logonCount.columnid, &userAccount->logonCount, sizeof(userAccount->logonCount), &columnSize, 0, NULL);
if (readStatus != JET_errSuccess){