summaryrefslogtreecommitdiffstats
path: root/iutil.py
diff options
context:
space:
mode:
authorMatt Wilson <msw@redhat.com>1999-10-20 20:00:48 +0000
committerMatt Wilson <msw@redhat.com>1999-10-20 20:00:48 +0000
commitf1f119f6bf884eef7c61f1508910035ecf91e271 (patch)
treef5508af26a017b6b72ac113e4ebad66eb46f32d5 /iutil.py
parent984aa82ed809db177d1140ff89d2e2597aef5b51 (diff)
downloadanaconda-f1f119f6bf884eef7c61f1508910035ecf91e271.tar.gz
anaconda-f1f119f6bf884eef7c61f1508910035ecf91e271.tar.xz
anaconda-f1f119f6bf884eef7c61f1508910035ecf91e271.zip
fixed for sillyness
Diffstat (limited to 'iutil.py')
-rw-r--r--iutil.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/iutil.py b/iutil.py
index 0cca8728a..cbe049ee9 100644
--- a/iutil.py
+++ b/iutil.py
@@ -34,11 +34,14 @@ def execWithRedirect(command, argv, stdin = 0, stdout = 1, stderr = 2,
stderr = getfd(stderr)
if not os.access (root + command, os.X_OK):
- raise RuntimeError, command + " can not be run"
+ if not os.access (command, os.X_OK):
+ raise RuntimeError, command + " can not be run"
+ else:
+ root = ""
childpid = os.fork()
if (not childpid):
- if (root != '/'): isys.chroot (root)
+ if (root and root != '/'): isys.chroot (root)
if type(stdin) == type("a"):
stdin == os.open(stdin, os.O_RDONLY)
@@ -71,13 +74,16 @@ def execWithRedirect(command, argv, stdin = 0, stdout = 1, stderr = 2,
def execWithCapture(command, argv, searchPath = 0, root = '/', stdin = 0):
if not os.access (root + command, os.X_OK):
- raise RuntimeError, command + " can not be run"
-
+ if not os.access (command, os.X_OK):
+ raise RuntimeError, command + " can not be run"
+ else:
+ root = ""
+
(read, write) = os.pipe()
childpid = os.fork()
if (not childpid):
- if (root != '/'): isys.chroot (root)
+ if (root and root != '/'): isys.chroot (root)
os.dup2(write, 1)
if stdin: