Fix invocation of builtin shell to have proper argc and argv.
authorMatt Kraai <kraai@debian.org>
Thu, 17 May 2001 03:54:37 +0000 (03:54 -0000)
committerMatt Kraai <kraai@debian.org>
Thu, 17 May 2001 03:54:37 +0000 (03:54 -0000)
chroot.c
coreutils/chroot.c

index bae9cd75702288f662db639518f287bc2556ea30..c10df7a7c8cc35d0597e652feec7c52b0c31dd84 100644 (file)
--- a/chroot.c
+++ b/chroot.c
@@ -54,7 +54,9 @@ int chroot_main(int argc, char **argv)
                        prog = "/bin/sh";
                execlp(prog, prog, NULL);
 #else
-               shell_main(argc, argv);
+               char shell[] = "/bin/sh";
+               char *shell_argv[2] = { shell, NULL };
+               shell_main(1, shell_argv);
                return EXIT_SUCCESS;
 #endif
        }
index bae9cd75702288f662db639518f287bc2556ea30..c10df7a7c8cc35d0597e652feec7c52b0c31dd84 100644 (file)
@@ -54,7 +54,9 @@ int chroot_main(int argc, char **argv)
                        prog = "/bin/sh";
                execlp(prog, prog, NULL);
 #else
-               shell_main(argc, argv);
+               char shell[] = "/bin/sh";
+               char *shell_argv[2] = { shell, NULL };
+               shell_main(1, shell_argv);
                return EXIT_SUCCESS;
 #endif
        }