aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2015-12-22 20:57:07 -0500
committerMike Frysinger <vapier@gentoo.org>2015-12-22 20:57:07 -0500
commit0c51ddd4f3f9c96149750445cc68c00ed8829404 (patch)
tree59ad2462a749b738e93e4b1de877c0167bf62b13
parentlibsandbox: fix alpha ptrace error setting (diff)
downloadsandbox-0c51ddd4f3f9c96149750445cc68c00ed8829404.tar.gz
sandbox-0c51ddd4f3f9c96149750445cc68c00ed8829404.tar.bz2
sandbox-0c51ddd4f3f9c96149750445cc68c00ed8829404.zip
libsandbox: add wrappers for execveat & execvpe
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r--libsandbox/symbols.h.in2
-rw-r--r--libsandbox/wrapper-funcs/execveat.c13
-rw-r--r--libsandbox/wrapper-funcs/execvpe.c12
3 files changed, 27 insertions, 0 deletions
diff --git a/libsandbox/symbols.h.in b/libsandbox/symbols.h.in
index e34b977..bdbce08 100644
--- a/libsandbox/symbols.h.in
+++ b/libsandbox/symbols.h.in
@@ -62,7 +62,9 @@ mkstemps64
#execlp
execv
execve
+execveat
execvp
+execvpe
fexecve
system
popen
diff --git a/libsandbox/wrapper-funcs/execveat.c b/libsandbox/wrapper-funcs/execveat.c
new file mode 100644
index 0000000..70ac0bd
--- /dev/null
+++ b/libsandbox/wrapper-funcs/execveat.c
@@ -0,0 +1,13 @@
+/*
+ * execve() wrapper.
+ *
+ * Copyright 1999-2015 Gentoo Foundation
+ * Licensed under the GPL-2
+ */
+
+#define WRAPPER_ARGS_PROTO int dirfd, const char *path, char *const argv[], char *const envp[], int flags
+#define WRAPPER_ARGS dirfd, path, argv, envp, flags
+#define EXEC_ARGS dirfd, path, argv, my_env, flags
+#define EXEC_MY_ENV
+#define EXEC_NO_PATH
+#include "__wrapper_exec.c"
diff --git a/libsandbox/wrapper-funcs/execvpe.c b/libsandbox/wrapper-funcs/execvpe.c
new file mode 100644
index 0000000..3402043
--- /dev/null
+++ b/libsandbox/wrapper-funcs/execvpe.c
@@ -0,0 +1,12 @@
+/*
+ * execvpe() wrapper.
+ *
+ * Copyright 1999-2015 Gentoo Foundation
+ * Licensed under the GPL-2
+ */
+
+#define WRAPPER_ARGS_PROTO const char *path, char *const argv[], char *const envp[]
+#define WRAPPER_ARGS path, argv, envp
+#define EXEC_ARGS path, argv, my_env
+#define EXEC_MY_ENV
+#include "__wrapper_exec.c"