Gentoo Archives: gentoo-commits

From: Mike Frysinger <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/sandbox:master commit in: libsandbox/, libsandbox/wrapper-funcs/
Date: Wed, 23 Dec 2015 01:57:26
Message-Id: 1450835827.0c51ddd4f3f9c96149750445cc68c00ed8829404.vapier@gentoo
1 commit: 0c51ddd4f3f9c96149750445cc68c00ed8829404
2 Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
3 AuthorDate: Wed Dec 23 01:57:07 2015 +0000
4 Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
5 CommitDate: Wed Dec 23 01:57:07 2015 +0000
6 URL: https://gitweb.gentoo.org/proj/sandbox.git/commit/?id=0c51ddd4
7
8 libsandbox: add wrappers for execveat & execvpe
9
10 Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>
11
12 libsandbox/symbols.h.in | 2 ++
13 libsandbox/wrapper-funcs/execveat.c | 13 +++++++++++++
14 libsandbox/wrapper-funcs/execvpe.c | 12 ++++++++++++
15 3 files changed, 27 insertions(+)
16
17 diff --git a/libsandbox/symbols.h.in b/libsandbox/symbols.h.in
18 index e34b977..bdbce08 100644
19 --- a/libsandbox/symbols.h.in
20 +++ b/libsandbox/symbols.h.in
21 @@ -62,7 +62,9 @@ mkstemps64
22 #execlp
23 execv
24 execve
25 +execveat
26 execvp
27 +execvpe
28 fexecve
29 system
30 popen
31
32 diff --git a/libsandbox/wrapper-funcs/execveat.c b/libsandbox/wrapper-funcs/execveat.c
33 new file mode 100644
34 index 0000000..70ac0bd
35 --- /dev/null
36 +++ b/libsandbox/wrapper-funcs/execveat.c
37 @@ -0,0 +1,13 @@
38 +/*
39 + * execve() wrapper.
40 + *
41 + * Copyright 1999-2015 Gentoo Foundation
42 + * Licensed under the GPL-2
43 + */
44 +
45 +#define WRAPPER_ARGS_PROTO int dirfd, const char *path, char *const argv[], char *const envp[], int flags
46 +#define WRAPPER_ARGS dirfd, path, argv, envp, flags
47 +#define EXEC_ARGS dirfd, path, argv, my_env, flags
48 +#define EXEC_MY_ENV
49 +#define EXEC_NO_PATH
50 +#include "__wrapper_exec.c"
51
52 diff --git a/libsandbox/wrapper-funcs/execvpe.c b/libsandbox/wrapper-funcs/execvpe.c
53 new file mode 100644
54 index 0000000..3402043
55 --- /dev/null
56 +++ b/libsandbox/wrapper-funcs/execvpe.c
57 @@ -0,0 +1,12 @@
58 +/*
59 + * execvpe() wrapper.
60 + *
61 + * Copyright 1999-2015 Gentoo Foundation
62 + * Licensed under the GPL-2
63 + */
64 +
65 +#define WRAPPER_ARGS_PROTO const char *path, char *const argv[], char *const envp[]
66 +#define WRAPPER_ARGS path, argv, envp
67 +#define EXEC_ARGS path, argv, my_env
68 +#define EXEC_MY_ENV
69 +#include "__wrapper_exec.c"