From 54fb9acbdd482115713b7804821db2d70aecb341 Mon Sep 17 00:00:00 2001
From: Peymaneh Nejad
Date: Thu, 22 Jul 2021 08:09:04 +0200
Subject: [PATCH] Use getpass.getuser() to determine user login
---
dangerzone/container.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dangerzone/container.py b/dangerzone/container.py
index 98da8ac..9757606 100644
--- a/dangerzone/container.py
+++ b/dangerzone/container.py
@@ -5,6 +5,7 @@ import sys
import pipes
import shutil
import os
+import getpass
# What is the container runtime for this platform?
if platform.system() == "Darwin":
@@ -39,7 +40,7 @@ def exec_container(args):
# In Tails, tell the container runtime to download over Tor
if (
platform.system() == "Linux"
- and os.getlogin() == "amnesia"
+ and getpass.getuser() == "amnesia"
and os.getuid() == 1000
):
env = os.environ.copy()