diff options
author | 2012-12-27 01:28:17 -0500 | |
---|---|---|
committer | 2013-02-24 23:05:05 -0500 | |
commit | 97ea4d6d14ae90bd6371936fd6a718df0f62efba (patch) | |
tree | ea707ff91d0e1c0c38f499c9fa14c4f97dd52f7c /src | |
parent | environ: merge is_env_{on,off} into a single file (diff) | |
download | sandbox-97ea4d6d14ae90bd6371936fd6a718df0f62efba.tar.gz sandbox-97ea4d6d14ae90bd6371936fd6a718df0f62efba.tar.bz2 sandbox-97ea4d6d14ae90bd6371936fd6a718df0f62efba.zip |
environ: add a new is_env_var helper for checking var names
This is laying the ground work for processing more vars in the
future than just LD_PRELOAD.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/environ.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/environ.c b/src/environ.c index 45bf9a6..30ba003 100644 --- a/src/environ.c +++ b/src/environ.c @@ -318,9 +318,9 @@ char **setup_environ(struct sandbox_info_t *sandbox_info, bool interactive) /* Now add the rest */ env_ptr = environ; + size_t vlen = strlen(ENV_LD_PRELOAD); while (NULL != *env_ptr) { - if ((1 == have_ld_preload) && - (strstr(*env_ptr, LD_PRELOAD_EQ) == *env_ptr)) + if ((1 == have_ld_preload) && is_env_var(*env_ptr, ENV_LD_PRELOAD, vlen)) /* If LD_PRELOAD was set, and this is it in the original * environment, replace it with our new copy */ /* XXX: The following works as it just add whatever as |