summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen2001-03-06 20:28:22 +0000
committerEric Andersen2001-03-06 20:28:22 +0000
commit07f2f3917a08eea89953c8f0c3f1bc6ef52879b4 (patch)
tree035d812d3aad71068af810ccaa93f0b25895c1e8
parent1a046d5f9dd627711a6d212963beae3354b68374 (diff)
downloadbusybox-07f2f3917a08eea89953c8f0c3f1bc6ef52879b4.zip
busybox-07f2f3917a08eea89953c8f0c3f1bc6ef52879b4.tar.gz
Close open files before calling builtin_exec(). I've tested this
and it fixes bug #1121. -Erik
-rw-r--r--lash.c1
-rw-r--r--sh.c1
-rw-r--r--shell/lash.c1
3 files changed, 3 insertions, 0 deletions
diff --git a/lash.c b/lash.c
index 077cb11..57d969e 100644
--- a/lash.c
+++ b/lash.c
@@ -300,6 +300,7 @@ static int builtin_exec(struct child_prog *child)
if (child->argv[1] == NULL)
return EXIT_SUCCESS; /* Really? */
child->argv++;
+ close_all();
pseudo_exec(child);
/* never returns */
}
diff --git a/sh.c b/sh.c
index 077cb11..57d969e 100644
--- a/sh.c
+++ b/sh.c
@@ -300,6 +300,7 @@ static int builtin_exec(struct child_prog *child)
if (child->argv[1] == NULL)
return EXIT_SUCCESS; /* Really? */
child->argv++;
+ close_all();
pseudo_exec(child);
/* never returns */
}
diff --git a/shell/lash.c b/shell/lash.c
index 077cb11..57d969e 100644
--- a/shell/lash.c
+++ b/shell/lash.c
@@ -300,6 +300,7 @@ static int builtin_exec(struct child_prog *child)
if (child->argv[1] == NULL)
return EXIT_SUCCESS; /* Really? */
child->argv++;
+ close_all();
pseudo_exec(child);
/* never returns */
}