diff options
-rw-r--r-- | libsandbox/libsandbox.c | 3 | ||||
-rw-r--r-- | libsbutil/sbutil.h | 7 | ||||
-rw-r--r-- | src/environ.c | 8 | ||||
-rw-r--r-- | src/sandbox.c | 2 | ||||
-rw-r--r-- | src/sandbox.h | 2 |
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)) |