proxmox-backup/src
Stefan Reiter acefa2bb6e 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>
(cherry picked from commit c4c4b5a3ef)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-20 10:02:01 +02:00
..
acme update proxmox-http dependency 2021-05-17 11:29:24 +02:00
api2 api: define and use REALM_ID_SCHEMA 2021-06-10 11:10:00 +02:00
backup backup: remove AsyncIndexReader 2021-06-08 09:42:46 +02:00
bin depend on proxmox 0.11.6 (changed make_tmp_file() return type) 2021-07-20 09:45:28 +02:00
client client/pull: log snapshots that are skipped because of time 2021-06-07 10:51:25 +02:00
config cleanup: factor out config::datastore::lock_config() 2021-06-04 09:04:14 +02:00
pxar fix #3393 (again): pxar/create: try to read xattrs/fcaps/acls by default 2021-06-30 11:22:04 +02:00
rrd clippy: more misc fixes 2021-01-26 09:54:55 +01:00
server server/prune_job: fix locking during prune jobs 2021-06-02 17:04:49 +02:00
tape tape/drive: fix logging when requesting media 2021-06-30 11:22:04 +02:00
tools subscription: set higher-level error to message instead of bailing 2021-07-09 12:48:03 +02:00
api2.rs file-restore: add binary and basic commands 2021-04-08 13:57:57 +02:00
auth_helpers.rs avoid chrono dependency, depend on proxmox 0.3.8 2020-09-15 07:12:57 +02:00
auth.rs auth: 'crypt' is not thread safe 2021-07-20 10:02:01 +02:00
backup.rs backup: remove AsyncIndexReader 2021-06-08 09:42:46 +02:00
buildcfg.rs file-restore: add debug mode with serial access 2021-05-07 10:00:12 +02:00
client.rs client: add VsockClient to connect to virtio-vsock VMs 2021-02-17 08:15:43 +01:00
config.rs hot-reload proxy certificate when updating via the API 2021-05-11 16:28:08 +02:00
lib.rs add acme client 2021-05-04 07:56:52 +02:00
server.rs proxmox-backup-proxy: fix leftover references on datastore removal 2021-06-04 08:22:53 +02:00
task.rs introduce TaskState trait 2020-10-12 14:11:57 +02:00
tools.rs tools: add AsyncLruCache as a wrapper around sync LruCache 2021-06-08 09:42:34 +02:00