1 |
commit: 265b974f15ecf119d07fea46a449988a6401392c |
2 |
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Dec 27 07:04:36 2012 +0000 |
4 |
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Feb 25 04:05:05 2013 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/sandbox.git;a=commit;h=265b974f |
7 |
|
8 |
delete unused sandbox env vars |
9 |
|
10 |
Nothing uses or cares about these vars, so punt them. |
11 |
|
12 |
Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org> |
13 |
|
14 |
--- |
15 |
libsandbox/libsandbox.c | 3 --- |
16 |
libsbutil/sbutil.h | 7 ------- |
17 |
src/environ.c | 8 +------- |
18 |
src/sandbox.c | 2 +- |
19 |
src/sandbox.h | 2 +- |
20 |
5 files changed, 3 insertions(+), 19 deletions(-) |
21 |
|
22 |
diff --git a/libsandbox/libsandbox.c b/libsandbox/libsandbox.c |
23 |
index bdef2d9..eaa5c7d 100644 |
24 |
--- a/libsandbox/libsandbox.c |
25 |
+++ b/libsandbox/libsandbox.c |
26 |
@@ -983,9 +983,6 @@ bool before_syscall(int dirfd, int sb_nr, const char *func, const char *file, in |
27 |
sb_unlock(); |
28 |
|
29 |
if (0 == result) { |
30 |
- if ((NULL != getenv(ENV_SANDBOX_PID)) && (is_env_on(ENV_SANDBOX_ABORT))) |
31 |
- kill(atoi(getenv(ENV_SANDBOX_PID)), SIGUSR1); |
32 |
- |
33 |
/* FIXME: Should probably audit errno, and enable some other |
34 |
* error to be returned (EINVAL for invalid mode for |
35 |
* fopen() and co, ETOOLONG, etc). */ |
36 |
|
37 |
diff --git a/libsbutil/sbutil.h b/libsbutil/sbutil.h |
38 |
index 6c90f35..90de815 100644 |
39 |
--- a/libsbutil/sbutil.h |
40 |
+++ b/libsbutil/sbutil.h |
41 |
@@ -30,7 +30,6 @@ |
42 |
|
43 |
#define ENV_LD_PRELOAD "LD_PRELOAD" |
44 |
|
45 |
-#define ENV_EBUILD "EBUILD" |
46 |
#define ENV_TMPDIR "TMPDIR" |
47 |
#define ENV_PORTAGE_TMPDIR "PORTAGE_TMPDIR" |
48 |
|
49 |
@@ -56,15 +55,9 @@ |
50 |
|
51 |
#define ENV_SANDBOX_ON "SANDBOX_ON" |
52 |
|
53 |
-#define ENV_SANDBOX_PID "SANDBOX_PID" |
54 |
-#define ENV_SANDBOX_ABORT "SANDBOX_ABORT" |
55 |
-#define ENV_SANDBOX_INTRACTV "SANDBOX_INTRACTV" |
56 |
- |
57 |
#define ENV_SANDBOX_ACTIVE "SANDBOX_ACTIVE" |
58 |
#define SANDBOX_ACTIVE "armedandready" |
59 |
|
60 |
-#define SB_BUF_LEN 2048 |
61 |
- |
62 |
extern const char *colors[]; |
63 |
#define COLOR_NORMAL colors[0] |
64 |
#define COLOR_GREEN colors[1] |
65 |
|
66 |
diff --git a/src/environ.c b/src/environ.c |
67 |
index 30ba003..727f10b 100644 |
68 |
--- a/src/environ.c |
69 |
+++ b/src/environ.c |
70 |
@@ -234,7 +234,7 @@ static void sb_setenv(char ***envp, const char *name, const char *val) |
71 |
|
72 |
/* We setup the environment child side only to prevent issues with |
73 |
* setting LD_PRELOAD parent side */ |
74 |
-char **setup_environ(struct sandbox_info_t *sandbox_info, bool interactive) |
75 |
+char **setup_environ(struct sandbox_info_t *sandbox_info) |
76 |
{ |
77 |
int have_ld_preload = 0; |
78 |
|
79 |
@@ -250,14 +250,12 @@ char **setup_environ(struct sandbox_info_t *sandbox_info, bool interactive) |
80 |
/* Unset these, as its easier than replacing when setting up our |
81 |
* new environment below */ |
82 |
unsetenv(ENV_SANDBOX_ON); |
83 |
- unsetenv(ENV_SANDBOX_PID); |
84 |
unsetenv(ENV_SANDBOX_LIB); |
85 |
unsetenv(ENV_SANDBOX_BASHRC); |
86 |
unsetenv(ENV_SANDBOX_LOG); |
87 |
unsetenv(ENV_SANDBOX_DEBUG_LOG); |
88 |
unsetenv(ENV_SANDBOX_WORKDIR); |
89 |
unsetenv(ENV_SANDBOX_ACTIVE); |
90 |
- unsetenv(ENV_SANDBOX_INTRACTV); |
91 |
unsetenv(ENV_BASH_ENV); |
92 |
|
93 |
orig_ld_preload_envvar = getenv(ENV_LD_PRELOAD); |
94 |
@@ -284,15 +282,11 @@ char **setup_environ(struct sandbox_info_t *sandbox_info, bool interactive) |
95 |
/* First add our new variables to the beginning - this is due to some |
96 |
* weirdness that I cannot remember */ |
97 |
sb_setenv(&new_environ, ENV_SANDBOX_ON, "1"); |
98 |
- sb_setenv(&new_environ, ENV_SANDBOX_PID, sb_pid); |
99 |
sb_setenv(&new_environ, ENV_SANDBOX_LIB, sandbox_info->sandbox_lib); |
100 |
sb_setenv(&new_environ, ENV_SANDBOX_BASHRC, sandbox_info->sandbox_rc); |
101 |
sb_setenv(&new_environ, ENV_SANDBOX_LOG, sandbox_info->sandbox_log); |
102 |
sb_setenv(&new_environ, ENV_SANDBOX_DEBUG_LOG, |
103 |
sandbox_info->sandbox_debug_log); |
104 |
- /* Is this an interactive session? */ |
105 |
- if (interactive) |
106 |
- sb_setenv(&new_environ, ENV_SANDBOX_INTRACTV, "1"); |
107 |
/* Just set the these if not already set so that is_env_on() work */ |
108 |
if (!getenv(ENV_SANDBOX_VERBOSE)) |
109 |
sb_setenv(&new_environ, ENV_SANDBOX_VERBOSE, "1"); |
110 |
|
111 |
diff --git a/src/sandbox.c b/src/sandbox.c |
112 |
index a5920c4..aa957f6 100644 |
113 |
--- a/src/sandbox.c |
114 |
+++ b/src/sandbox.c |
115 |
@@ -264,7 +264,7 @@ int main(int argc, char **argv) |
116 |
|
117 |
/* Setup the child environment stuff. |
118 |
* XXX: We free this in spawn_shell(). */ |
119 |
- sandbox_environ = setup_environ(&sandbox_info, print_debug); |
120 |
+ sandbox_environ = setup_environ(&sandbox_info); |
121 |
if (NULL == sandbox_environ) |
122 |
goto oom_error; |
123 |
|
124 |
|
125 |
diff --git a/src/sandbox.h b/src/sandbox.h |
126 |
index e25a206..cc67753 100644 |
127 |
--- a/src/sandbox.h |
128 |
+++ b/src/sandbox.h |
129 |
@@ -23,7 +23,7 @@ struct sandbox_info_t { |
130 |
char *home_dir; |
131 |
}; |
132 |
|
133 |
-extern char **setup_environ(struct sandbox_info_t *sandbox_info, bool interactive); |
134 |
+extern char **setup_environ(struct sandbox_info_t *sandbox_info); |
135 |
|
136 |
#define sb_warn(fmt, args...) fprintf(stderr, "%s:%s " fmt "\n", "sandbox", __func__, ## args) |
137 |
#define sb_pwarn(fmt, args...) sb_warn(fmt ": %s\n", ## args, strerror(errno)) |