aboutsummaryrefslogtreecommitdiffstats
path: root/guts/execv.c
diff options
context:
space:
mode:
Diffstat (limited to 'guts/execv.c')
-rw-r--r--guts/execv.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/guts/execv.c b/guts/execv.c
index 8183442..cc37e0a 100644
--- a/guts/execv.c
+++ b/guts/execv.c
@@ -3,9 +3,17 @@
* guts/COPYRIGHT for information.
*
* static int
- * wrap_execv(const char *path, char *const *argv) {
+ * wrap_execv(const char *file, char *const *argv) {
* int rc = -1;
*/
+ /* 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, -1, -1, file, 0);
+
if (!pseudo_get_value("PSEUDO_RELOADED"))
pseudo_setupenv();
else {
@@ -17,7 +25,7 @@
* not much we can do about that.
*/
sigprocmask(SIG_SETMASK, &pseudo_saved_sigmask, NULL);
- rc = real_execv(path, argv);
+ rc = real_execv(file, argv);
/* return rc;
* }