summaryrefslogtreecommitdiffstats
path: root/ipapython
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2011-04-26 15:51:34 -0400
committerSimo Sorce <ssorce@redhat.com>2011-04-27 11:25:37 -0400
commit000ba0531e2c650d337966790604e4600e814436 (patch)
tree2b6c6b8aa6cced8c35994f87cef7790291d5c722 /ipapython
parent660332a1627e158540c95b1a033374b5c048a03c (diff)
downloadfreeipa-000ba0531e2c650d337966790604e4600e814436.tar.gz
freeipa-000ba0531e2c650d337966790604e4600e814436.tar.xz
freeipa-000ba0531e2c650d337966790604e4600e814436.zip
ipautil: Preserve environment unless explicitly overridden by caller.
Fixes: https://fedorahosted.org/freeipa/ticket/1193
Diffstat (limited to 'ipapython')
-rw-r--r--ipapython/ipautil.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/ipapython/ipautil.py b/ipapython/ipautil.py
index 81719ccae..b5a0b9105 100644
--- a/ipapython/ipautil.py
+++ b/ipapython/ipautil.py
@@ -28,6 +28,7 @@ import logging
import subprocess
import random
import os, sys, traceback, readline
+import copy
import stat
import shutil
import urllib2
@@ -119,7 +120,9 @@ def run(args, stdin=None, raiseonerr=True,
p_err = None
if env is None:
- env={"PATH": "/bin:/sbin:/usr/kerberos/bin:/usr/kerberos/sbin:/usr/bin:/usr/sbin"}
+ # copy default env
+ env = copy.deepcopy(os.environ)
+ env["PATH"] = "/bin:/sbin:/usr/kerberos/bin:/usr/kerberos/sbin:/usr/bin:/usr/sbin"
if stdin:
p_in = subprocess.PIPE
if capture_output: