Displaying 1 result from an estimated 1 matches for "bc1b94f".
Did you mean:
bc1b7ff
2008 Jul 13
1
bunch of small fixes
...y
/usr/lib/klibc/bin/chroot / /bin/pwd
/home/max
./src/klibc/usr/utils/static/chroot / pwd
/
Cc: Colin Watson <cjwatson at ubuntu.com>
Signed-off-by: maximilian attems <max at stro.at>
diff --git a/usr/utils/chroot.c b/usr/utils/chroot.c
index e3e6791..bc1b94f 100644
--- a/usr/utils/chroot.c
+++ b/usr/utils/chroot.c
@@ -16,8 +16,13 @@ int main(int argc, char *argv[], char *envp[])
return 1;
}
- if (execve(argv[2], argv + 2, envp) == -1) {
- perror("execve");
+ if (chdir("/") == -1) {
+ perror("chdir");
+ return 1;...