Skip to content

Commit 7ba84b8

Browse files
author
Ilia Alshanetsky
committed
Added missing open_basedir checks
1 parent 17ff2f4 commit 7ba84b8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

ext/session/mod_files.c

+7
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,13 @@ PS_OPEN_FUNC(files)
251251
if (*save_path == '\0') {
252252
/* if save path is an empty string, determine the temporary dir */
253253
save_path = php_get_temporary_directory();
254+
255+
if (PG(safe_mode) && (!php_checkuid(save_path, NULL, CHECKUID_ALLOW_ONLY_DIR))) {
256+
return FAILURE;
257+
}
258+
if (php_check_open_basedir(save_path TSRMLS_CC)) {
259+
return FAILURE;
260+
}
254261
}
255262

256263
/* split up input parameter */

0 commit comments

Comments
 (0)