]> git.proxmox.com Git - proxmox-backup.git/commit
auth: request a write lock when exposing the `LockedTfaConfig`
authorStefan Sterz <s.sterz@proxmox.com>
Fri, 12 Apr 2024 12:31:56 +0000 (14:31 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 24 Apr 2024 19:28:11 +0000 (21:28 +0200)
commit0b449fe8285e66f909f2f80093806faaf6f22f58
tree4a688f0475a8ebb99b89750eee64a2e40c36d522
parenta819f056c28037bf5c2594e58df96f73f7bc4217
auth: request a write lock when exposing the `LockedTfaConfig`

this function is called every time a user tries to log in to check
whether a tfa challenge is required. since the tfa config may need to
be written by the auth api (e.g. when a recovery key is used) this
needs to use a write lock instead of a read lock in order to avoid
potential races.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
src/auth.rs