1
0
mirror of /repos/baseimage-docker.git synced 2025-12-31 08:11:29 +01:00

Add USER, GROUP, UID, GID and SHELL to restricted env variables

This commit is contained in:
Bernard Potocki 2014-06-18 17:29:02 +02:00
parent 5b403fe06c
commit 18a7fe26ec

View File

@ -73,7 +73,7 @@ def import_envvars(clear_existing_environment = True, override_existing_environm
def export_envvars(to_dir = True): def export_envvars(to_dir = True):
shell_dump = "" shell_dump = ""
for name, value in os.environ.items(): for name, value in os.environ.items():
if name == 'HOME': if name in ['HOME', 'USER', 'GROUP', 'UID', 'GID', 'SHELL']:
break break
if to_dir: if to_dir:
with open("/etc/container_environment/" + name, "w") as f: with open("/etc/container_environment/" + name, "w") as f: