aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2012-12-27 02:04:36 -0500
committerMike Frysinger <vapier@gentoo.org>2013-02-24 23:05:05 -0500
commit265b974f15ecf119d07fea46a449988a6401392c (patch)
treef67670d000de52f69b89e28a606a5d4bd4583fa7
parentenviron: add a new is_env_var helper for checking var names (diff)
downloadsandbox-265b974f15ecf119d07fea46a449988a6401392c.tar.gz
sandbox-265b974f15ecf119d07fea46a449988a6401392c.tar.bz2
sandbox-265b974f15ecf119d07fea46a449988a6401392c.zip
delete unused sandbox env vars
Nothing uses or cares about these vars, so punt them. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r--libsandbox/libsandbox.c3
-rw-r--r--libsbutil/sbutil.h7
-rw-r--r--src/environ.c8
-rw-r--r--src/sandbox.c2
-rw-r--r--src/sandbox.h2
5 files changed, 3 insertions, 19 deletions
diff --git a/libsandbox/libsandbox.c b/libsandbox/libsandbox.c
index bdef2d9..eaa5c7d 100644
--- a/libsandbox/libsandbox.c
+++ b/libsandbox/libsandbox.c
@@ -983,9 +983,6 @@ bool before_syscall(int dirfd, int sb_nr, const char *func, const char *file, in
sb_unlock();
if (0 == result) {
- if ((NULL != getenv(ENV_SANDBOX_PID)) && (is_env_on(ENV_SANDBOX_ABORT)))
- kill(atoi(getenv(ENV_SANDBOX_PID)), SIGUSR1);
-
/* FIXME: Should probably audit errno, and enable some other
* error to be returned (EINVAL for invalid mode for
* fopen() and co, ETOOLONG, etc). */
diff --git a/libsbutil/sbutil.h b/libsbutil/sbutil.h
index 6c90f35..90de815 100644
--- a/libsbutil/sbutil.h
+++ b/libsbutil/sbutil.h
@@ -30,7 +30,6 @@
#define ENV_LD_PRELOAD "LD_PRELOAD"
-#define ENV_EBUILD "EBUILD"
#define ENV_TMPDIR "TMPDIR"
#define ENV_PORTAGE_TMPDIR "PORTAGE_TMPDIR"
@@ -56,15 +55,9 @@
#define ENV_SANDBOX_ON "SANDBOX_ON"
-#define ENV_SANDBOX_PID "SANDBOX_PID"
-#define ENV_SANDBOX_ABORT "SANDBOX_ABORT"
-#define ENV_SANDBOX_INTRACTV "SANDBOX_INTRACTV"
-
#define ENV_SANDBOX_ACTIVE "SANDBOX_ACTIVE"
#define SANDBOX_ACTIVE "armedandready"
-#define SB_BUF_LEN 2048
-
extern const char *colors[];
#define COLOR_NORMAL colors[0]
#define COLOR_GREEN colors[1]
diff --git a/src/environ.c b/src/environ.c
index 30ba003..727f10b 100644
--- a/src/environ.c
+++ b/src/environ.c
@@ -234,7 +234,7 @@ static void sb_setenv(char ***envp, const char *name, const char *val)
/* We setup the environment child side only to prevent issues with
* setting LD_PRELOAD parent side */
-char **setup_environ(struct sandbox_info_t *sandbox_info, bool interactive)
+char **setup_environ(struct sandbox_info_t *sandbox_info)
{
int have_ld_preload = 0;
@@ -250,14 +250,12 @@ char **setup_environ(struct sandbox_info_t *sandbox_info, bool interactive)
/* Unset these, as its easier than replacing when setting up our
* new environment below */
unsetenv(ENV_SANDBOX_ON);
- unsetenv(ENV_SANDBOX_PID);
unsetenv(ENV_SANDBOX_LIB);
unsetenv(ENV_SANDBOX_BASHRC);
unsetenv(ENV_SANDBOX_LOG);
unsetenv(ENV_SANDBOX_DEBUG_LOG);
unsetenv(ENV_SANDBOX_WORKDIR);
unsetenv(ENV_SANDBOX_ACTIVE);
- unsetenv(ENV_SANDBOX_INTRACTV);
unsetenv(ENV_BASH_ENV);
orig_ld_preload_envvar = getenv(ENV_LD_PRELOAD);
@@ -284,15 +282,11 @@ char **setup_environ(struct sandbox_info_t *sandbox_info, bool interactive)
/* First add our new variables to the beginning - this is due to some
* weirdness that I cannot remember */
sb_setenv(&new_environ, ENV_SANDBOX_ON, "1");
- sb_setenv(&new_environ, ENV_SANDBOX_PID, sb_pid);
sb_setenv(&new_environ, ENV_SANDBOX_LIB, sandbox_info->sandbox_lib);
sb_setenv(&new_environ, ENV_SANDBOX_BASHRC, sandbox_info->sandbox_rc);
sb_setenv(&new_environ, ENV_SANDBOX_LOG, sandbox_info->sandbox_log);
sb_setenv(&new_environ, ENV_SANDBOX_DEBUG_LOG,
sandbox_info->sandbox_debug_log);
- /* Is this an interactive session? */
- if (interactive)
- sb_setenv(&new_environ, ENV_SANDBOX_INTRACTV, "1");
/* Just set the these if not already set so that is_env_on() work */
if (!getenv(ENV_SANDBOX_VERBOSE))
sb_setenv(&new_environ, ENV_SANDBOX_VERBOSE, "1");
diff --git a/src/sandbox.c b/src/sandbox.c
index a5920c4..aa957f6 100644
--- a/src/sandbox.c
+++ b/src/sandbox.c
@@ -264,7 +264,7 @@ int main(int argc, char **argv)
/* Setup the child environment stuff.
* XXX: We free this in spawn_shell(). */
- sandbox_environ = setup_environ(&sandbox_info, print_debug);
+ sandbox_environ = setup_environ(&sandbox_info);
if (NULL == sandbox_environ)
goto oom_error;
diff --git a/src/sandbox.h b/src/sandbox.h
index e25a206..cc67753 100644
--- a/src/sandbox.h
+++ b/src/sandbox.h
@@ -23,7 +23,7 @@ struct sandbox_info_t {
char *home_dir;
};
-extern char **setup_environ(struct sandbox_info_t *sandbox_info, bool interactive);
+extern char **setup_environ(struct sandbox_info_t *sandbox_info);
#define sb_warn(fmt, args...) fprintf(stderr, "%s:%s " fmt "\n", "sandbox", __func__, ## args)
#define sb_pwarn(fmt, args...) sb_warn(fmt ": %s\n", ## args, strerror(errno))