Merge pull request #123 from pymnh/getuser

Use getpass.getuser() to determine user login
This commit is contained in:
Micah Lee 2021-08-06 11:46:19 -07:00 committed by GitHub
commit 7a4788f7a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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()