Stefan Reiter c4c4b5a3ef auth: 'crypt' is not thread safe
According to crypt(3):
"crypt places its result in a static storage area, which will be
overwritten by subsequent calls to crypt. It is not safe to call crypt
from multiple threads simultaneously."

This means that multiple login calls as a PBS-realm user can collide and
produce intermittent authentication failures. A visible case is for
file-restore, where VMs with many disks lead to just as many auth-calls
at the same time, as the GUI tries to expand each tree element on load.

Instead, use the thread-safe variant 'crypt_r', which places the result
into a pre-allocated buffer of type 'crypt_data'. The C struct is laid
out according to 'lib/crypt.h.in' and the man page mentioned above.

Use the opportunity and make both arguments to the rust 'crypt' function
take a &[u8].

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2021-07-12 18:38:48 +02:00
..
2021-07-03 21:44:13 +02:00
2021-07-09 15:17:53 +02:00
2021-07-12 17:26:49 +02:00
2021-07-09 15:32:12 +02:00
2021-07-06 15:11:52 +02:00
2021-01-26 09:54:55 +01:00
2021-07-09 15:17:52 +02:00
2021-07-06 12:00:14 +02:00
2021-07-12 18:38:48 +02:00
2021-07-07 14:37:47 +02:00