lib.py add function for drop_privileges.