44 lines
1.1 KiB
Plaintext
44 lines
1.1 KiB
Plaintext
--- execute_cmd.c.mm 2008-04-22 14:03:07.000000000 +0000
|
|
+++ execute_cmd.c 2008-04-28 01:38:19.000000000 +0000
|
|
@@ -24,6 +24,7 @@
|
|
#endif /* _AIX && RISC6000 && !__GNUC__ */
|
|
|
|
#include <stdio.h>
|
|
+#include <paths.h>
|
|
#include "chartypes.h"
|
|
#include "bashtypes.h"
|
|
#if !defined (_MINIX) && defined (HAVE_SYS_FILE_H)
|
|
@@ -4013,6 +4014,23 @@ shell_execve (command, args, env)
|
|
/* We have committed to attempting to execute the contents of this file
|
|
as shell commands. */
|
|
|
|
+#if 1
|
|
+ larray = strvec_len(args) + 1;
|
|
+ args = strvec_resize(args, larray + 1);
|
|
+
|
|
+ for (i = larray - 1; i; i--)
|
|
+ args[i] = args[i - 1];
|
|
+
|
|
+ args[0] = savestring(_PATH_BSHELL);
|
|
+ args[1] = command;
|
|
+ args[larray] = (char *)0;
|
|
+
|
|
+ SETOSTYPE (0); /* Some systems use for USG/POSIX semantics */
|
|
+ execve ("/bin/sh", args, env);
|
|
+ SETOSTYPE (1);
|
|
+
|
|
+ internal_error (_("%s: cannot execute: %s"), command, strerror (errno));
|
|
+#else
|
|
initialize_subshell ();
|
|
|
|
set_sigint_handler ();
|
|
@@ -4055,6 +4073,8 @@ shell_execve (command, args, env)
|
|
|
|
longjmp (subshell_top_level, 1);
|
|
/*NOTREACHED*/
|
|
+#endif
|
|
+ return (EX_NOEXEC);
|
|
}
|
|
|
|
static int
|