Skip to content

Commit e99f750

Browse files
author
Pavel Roskin
committed
chroot can now call the builtin shell
1 parent ea824fb commit e99f750

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

Changelog

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
0.47pre
22

3+
* chroot can now call the builtin shell - Pavel Roskin <[email protected]>
34
* added 'renice' command -- thanks to Dave Cinege <[email protected]>
45
* 'make install' now creates relative symlinks, and added a new
56
'make install-hardlinks' target to (tada) install hardlinks.

chroot.c

+5
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,15 @@ int chroot_main(int argc, char **argv)
4747
prog = *argv;
4848
execvp(*argv, argv);
4949
} else {
50+
#ifndef BB_SH
5051
prog = getenv("SHELL");
5152
if (!prog)
5253
prog = "/bin/sh";
5354
execlp(prog, prog, NULL);
55+
#else
56+
shell_main(argc, argv);
57+
exit (0);
58+
#endif
5459
}
5560
fatalError("cannot execute %s: %s\n", prog, strerror(errno));
5661

coreutils/chroot.c

+5
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,15 @@ int chroot_main(int argc, char **argv)
4747
prog = *argv;
4848
execvp(*argv, argv);
4949
} else {
50+
#ifndef BB_SH
5051
prog = getenv("SHELL");
5152
if (!prog)
5253
prog = "/bin/sh";
5354
execlp(prog, prog, NULL);
55+
#else
56+
shell_main(argc, argv);
57+
exit (0);
58+
#endif
5459
}
5560
fatalError("cannot execute %s: %s\n", prog, strerror(errno));
5661

0 commit comments

Comments
 (0)