summaryrefslogtreecommitdiff
path: root/ext/session/mod_files.c
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2007-07-10 17:40:41 +0000
committerStanislav Malyshev <stas@php.net>2007-07-10 17:40:41 +0000
commit143badba52749ccaadd2b3eb3fad9be28f6e02b2 (patch)
treee38062ed10e8a02575c1f2de134680858cf9b3c1 /ext/session/mod_files.c
parent90fd8fd7e859bcf513e14ba1bbaa2dde3cd32239 (diff)
downloadphp-git-143badba52749ccaadd2b3eb3fad9be28f6e02b2.tar.gz
always check save_path (issue reported by Maksymilian Arciemowicz)
Diffstat (limited to 'ext/session/mod_files.c')
-rw-r--r--ext/session/mod_files.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c
index ddb9376047..cd5bda2204 100644
--- a/ext/session/mod_files.c
+++ b/ext/session/mod_files.c
@@ -294,6 +294,14 @@ PS_OPEN_FUNC(files)
}
save_path = argv[argc - 1];
+ if (PG(safe_mode) && (!php_checkuid(save_path, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
+ return FAILURE;
+ }
+
+ if (PG(open_basedir) && php_check_open_basedir(save_path TSRMLS_CC)) {
+ return FAILURE;
+ }
+
data = emalloc(sizeof(*data));
memset(data, 0, sizeof(*data));
@@ -304,7 +312,7 @@ PS_OPEN_FUNC(files)
data->basedir = estrndup(save_path, data->basedir_len);
PS_SET_MOD_DATA(data);
-
+
return SUCCESS;
}