diff options
author | Pavel Roskin <proski@gnu.org> | 2000-07-24 20:15:30 +0000 |
---|---|---|
committer | Pavel Roskin <proski@gnu.org> | 2000-07-24 20:15:30 +0000 |
commit | e99f7500e0475bcef25f3125efdf847c7382c58f (patch) | |
tree | 4752e95bbd3116b181c02e52f71500f952597cf3 | |
parent | ea824fb9370c41756a75b70698b6222b3386f6c5 (diff) | |
download | busybox-w32-e99f7500e0475bcef25f3125efdf847c7382c58f.tar.gz busybox-w32-e99f7500e0475bcef25f3125efdf847c7382c58f.tar.bz2 busybox-w32-e99f7500e0475bcef25f3125efdf847c7382c58f.zip |
chroot can now call the builtin shell
-rw-r--r-- | Changelog | 1 | ||||
-rw-r--r-- | chroot.c | 5 | ||||
-rw-r--r-- | coreutils/chroot.c | 5 |
3 files changed, 11 insertions, 0 deletions
@@ -1,5 +1,6 @@ | |||
1 | 0.47pre | 1 | 0.47pre |
2 | 2 | ||
3 | * chroot can now call the builtin shell - Pavel Roskin <proski@gnu.org> | ||
3 | * added 'renice' command -- thanks to Dave Cinege <dcinege@psychosis.com> | 4 | * added 'renice' command -- thanks to Dave Cinege <dcinege@psychosis.com> |
4 | * 'make install' now creates relative symlinks, and added a new | 5 | * 'make install' now creates relative symlinks, and added a new |
5 | 'make install-hardlinks' target to (tada) install hardlinks. | 6 | 'make install-hardlinks' target to (tada) install hardlinks. |
@@ -47,10 +47,15 @@ int chroot_main(int argc, char **argv) | |||
47 | prog = *argv; | 47 | prog = *argv; |
48 | execvp(*argv, argv); | 48 | execvp(*argv, argv); |
49 | } else { | 49 | } else { |
50 | #ifndef BB_SH | ||
50 | prog = getenv("SHELL"); | 51 | prog = getenv("SHELL"); |
51 | if (!prog) | 52 | if (!prog) |
52 | prog = "/bin/sh"; | 53 | prog = "/bin/sh"; |
53 | execlp(prog, prog, NULL); | 54 | execlp(prog, prog, NULL); |
55 | #else | ||
56 | shell_main(argc, argv); | ||
57 | exit (0); | ||
58 | #endif | ||
54 | } | 59 | } |
55 | fatalError("cannot execute %s: %s\n", prog, strerror(errno)); | 60 | fatalError("cannot execute %s: %s\n", prog, strerror(errno)); |
56 | 61 | ||
diff --git a/coreutils/chroot.c b/coreutils/chroot.c index 9b1a5a82d..e8ce53973 100644 --- a/coreutils/chroot.c +++ b/coreutils/chroot.c | |||
@@ -47,10 +47,15 @@ int chroot_main(int argc, char **argv) | |||
47 | prog = *argv; | 47 | prog = *argv; |
48 | execvp(*argv, argv); | 48 | execvp(*argv, argv); |
49 | } else { | 49 | } else { |
50 | #ifndef BB_SH | ||
50 | prog = getenv("SHELL"); | 51 | prog = getenv("SHELL"); |
51 | if (!prog) | 52 | if (!prog) |
52 | prog = "/bin/sh"; | 53 | prog = "/bin/sh"; |
53 | execlp(prog, prog, NULL); | 54 | execlp(prog, prog, NULL); |
55 | #else | ||
56 | shell_main(argc, argv); | ||
57 | exit (0); | ||
58 | #endif | ||
54 | } | 59 | } |
55 | fatalError("cannot execute %s: %s\n", prog, strerror(errno)); | 60 | fatalError("cannot execute %s: %s\n", prog, strerror(errno)); |
56 | 61 | ||