From 7c272fb951e1d545e79b6480ca716ca0eb23664e Mon Sep 17 00:00:00 2001 From: jmk-foofus Date: Sat, 17 Feb 2024 20:42:57 -0500 Subject: [PATCH] If another thread tested the last password for a user and selected the next account, other threads should work on that new account as well when ready. This fixes an old bug where after the first user was done, we started processing users in parallel rather than sequentially. --- src/medusa.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/medusa.c b/src/medusa.c index 635a53d..472b91a 100644 --- a/src/medusa.c +++ b/src/medusa.c @@ -1179,6 +1179,11 @@ int getNextNormalCredSet(sLogin *_psLogin, sCredentialSet *_psCredSet) { _psLogin->psUser = NULL; } + /* if another thread has already selected the next user, process that user */ + else if ((_psLogin->psServer->psHost->psUserCurrent->iPassStatus != PL_DONE) && (_psLogin->psServer->psHost->psUserCurrent->iPassStatus != PASS_AUDIT_COMPLETE)) + { + _psLogin->psUser = _psLogin->psServer->psHost->psUserCurrent; + } else { _psLogin->psUser = _psLogin->psServer->psHost->psUserCurrent->psUserNext;