[GnuPG.confirm_key] Set 700 mode for temp. key home

This commit is contained in:
Piotr F. Mieszkowski 2022-04-26 18:41:33 +02:00
parent a82ff9f3f1
commit 71afd6ed05
1 changed files with 2 additions and 1 deletions

View File

@ -82,7 +82,8 @@ def confirm_key( content, email ):
if not os.path.exists(tmpkeyhome):
break
os.mkdir(tmpkeyhome)
# let only the owner access the directory, otherwise gpg would complain
os.mkdir(tmpkeyhome, mode=0o700)
localized_env = os.environ.copy()
localized_env["LANG"] = "C"
p = subprocess.Popen( build_command(tmpkeyhome, '--import', '--batch'), stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=localized_env )