Mlock variable in python

I am working on a password management application for linux and I am using Python for it.

For security reasons, I want to call a system call mlock‍‍to avoid replacing the password variable on the hard drive.

I noticed that python itself did not wrap this function.

so is there a way to avoid sharing?

thanks

+4
source share
1 answer

CPython , Python C, mlock , . str ( Py3.3 , str , , ), ctypes mlock - ctypes mlock, , mlock munlock. mlock , , ( mlock munlock , , , munlock : mlock/munlock - , ).

, mlock, , , mlock t216 > , .

mmap memoryview (mmap , memoryview , ctypes mlock ), ( getpass, str ).

, Python , ; , (, ), , .

+1

Source: https://habr.com/ru/post/1609276/


All Articles