Use getpass.getuser() to determine user login

This commit is contained in:
Peymaneh Nejad 2021-07-22 08:09:04 +02:00
parent e3dc7988e9
commit 54fb9acbdd

View file

@ -5,6 +5,7 @@ import sys
import pipes import pipes
import shutil import shutil
import os import os
import getpass
# What is the container runtime for this platform? # What is the container runtime for this platform?
if platform.system() == "Darwin": if platform.system() == "Darwin":
@ -39,7 +40,7 @@ def exec_container(args):
# In Tails, tell the container runtime to download over Tor # In Tails, tell the container runtime to download over Tor
if ( if (
platform.system() == "Linux" platform.system() == "Linux"
and os.getlogin() == "amnesia" and getpass.getuser() == "amnesia"
and os.getuid() == 1000 and os.getuid() == 1000
): ):
env = os.environ.copy() env = os.environ.copy()