diff options
Diffstat (limited to 'guts/execve.c')
-rw-r--r-- | guts/execve.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/guts/execve.c b/guts/execve.c index 1dda551..ccbc9c7 100644 --- a/guts/execve.c +++ b/guts/execve.c @@ -6,14 +6,19 @@ * wrap_execve(const char *filename, char *const *argv, char *const *envp) { * int rc = -1; */ + char * const *new_environ; /* note: we don't canonicalize this, because we are intentionally * NOT redirecting execs into the chroot environment. If you try * to execute /bin/sh, you get the actual /bin/sh, not * <CHROOT>/bin/sh. This allows use of basic utilities. This * design will likely be revisited. */ - pseudo_client_op(OP_EXEC, PSA_EXEC, 0, 0, filename, 0); - rc = real_execve(filename, argv, envp); + pseudo_client_op(OP_EXEC, PSA_EXEC, -1, 0, filename, 0); + if (!getenv("PSEUDO_RELOADED")) + new_environ = pseudo_setupenv(envp, getenv("PSEUDO_OPTS")); + else + new_environ = envp; + rc = real_execve(filename, argv, new_environ); /* return rc; * } |