1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-22 06:50:18 +03:00

cryptsetup: lock ourselves into memory as long as we deal with passwords

This commit is contained in:
Lennart Poettering 2010-11-16 03:23:52 +01:00
parent 967072694d
commit b853f6e9d6

View File

@ -21,6 +21,7 @@
#include <string.h>
#include <errno.h>
#include <sys/mman.h>
#include <libcryptsetup.h>
@ -181,6 +182,9 @@ int main(int argc, char *argv[]) {
if (argc >= 6 && argv[5][0] && !streq(argv[5], "-"))
parse_options(argv[5]);
/* A delicious drop of snake oil */
mlockall(MCL_FUTURE);
if ((k = crypt_init(&cd, argv[3]))) {
log_error("crypt_init() failed: %s", strerror(-k));
goto finish;