CVE-2021-20251 s4 auth: Prepare to make bad password count increment atomic
authorGary Lockyer <gary@catalyst.net.nz>
Wed, 27 Jan 2021 01:24:58 +0000 (14:24 +1300)
committerJule Anger <janger@samba.org>
Mon, 19 Sep 2022 04:02:12 +0000 (04:02 +0000)
commitd57c4ea959927bf340c6326029db5a11941538a6
tree952f306b6248a370c46fb1f78855e1dbb275fc74
parent2dc965ad1d85b3f77e734a74b52ce9049b5df536
CVE-2021-20251 s4 auth: Prepare to make bad password count increment atomic

To ensure that the bad password count is incremented atomically,
and that the successful logon accounting data is updated atomically,
without always opening a transaction, we will need to make a note
of all bad and successful passwords in a side-DB outside the
transaction lock.

This provides the functions needed for that and hooks them in
(future commits will handle errors and use the results).

Based on patches by Gary Lockyer <gary@catalyst.net.nz>

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14611

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit 408717242aad8adf4551f2394eee2d80a06c7e63)
source4/auth/sam.c