aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Woodward2005-01-10 19:10:49 +0000
committerJason Woodward2005-01-10 19:10:49 +0000
commit776b613cac0f7a5cc30969ec5ee7cc970dac51a8 (patch)
treea99e6ba3f264a86daf4c87a4ed2fc2969c843932 /src
parentb8aad8541ef7b9bf204062341607f5b23244ce46 (diff)
downloadslapt-get-776b613cac0f7a5cc30969ec5ee7cc970dac51a8.tar.gz
check for naughty chars in ROOT env var
Diffstat (limited to 'src')
-rw-r--r--src/main.h2
-rw-r--r--src/package.c3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/main.h b/src/main.h
index 35008c4..36505b1 100644
--- a/src/main.h
+++ b/src/main.h
@@ -78,3 +78,5 @@ enum action {
#define _(text) gettext(text)
+#define NAUGHTY_CHARS "$@^#!*()`"
+
diff --git a/src/package.c b/src/package.c
index a85d31d..855a317 100644
--- a/src/package.c
+++ b/src/package.c
@@ -442,7 +442,8 @@ struct pkg_list *get_installed_pkgs(void){
/* Generate package log directory using ROOT env variable if set */
if( getenv(ROOT_ENV_NAME) && strlen(getenv(ROOT_ENV_NAME)) < ROOT_ENV_LEN ){
- root_env_entry = getenv(ROOT_ENV_NAME);
+ if( strcspn(getenv(ROOT_ENV_NAME),NAUGHTY_CHARS) == 0 )
+ root_env_entry = getenv(ROOT_ENV_NAME);
}
pkg_log_dirname = calloc(
strlen(PKG_LOG_DIR)+