commit:     0c51ddd4f3f9c96149750445cc68c00ed8829404
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 23 01:57:07 2015 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Wed Dec 23 01:57:07 2015 +0000
URL:        https://gitweb.gentoo.org/proj/sandbox.git/commit/?id=0c51ddd4

libsandbox: add wrappers for execveat & execvpe

Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>

 libsandbox/symbols.h.in             |  2 ++
 libsandbox/wrapper-funcs/execveat.c | 13 +++++++++++++
 libsandbox/wrapper-funcs/execvpe.c  | 12 ++++++++++++
 3 files changed, 27 insertions(+)

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"

Reply via email to