Skip to content

Commit

Permalink
- MFH: add OPENBASEDIR_CHECKPATH macro to ease merge between 5.3 and …
Browse files Browse the repository at this point in the history
…6, it includes safemode (5.3) and openbasedir check
  • Loading branch information
pierrejoye committed Jan 16, 2009
1 parent 59b6e45 commit 8dfe438
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions main/fopen_wrappers.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ PHPAPI int php_check_open_basedir(const char *path TSRMLS_DC);
PHPAPI int php_check_open_basedir_ex(const char *path, int warn TSRMLS_DC);
PHPAPI int php_check_specific_open_basedir(const char *basedir, const char *path TSRMLS_DC);

/* {{{ OPENBASEDIR_CHECKPATH(filename) to ease merge between 6.x and 5.x */
#if (PHP_MAJOR_VERSION < 6)
# define OPENBASEDIR_CHECKPATH(filename) \
(PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(filename TSRMLS_CC)
#else
#define OPENBASEDIR_CHECKPATH(filename) \
php_check_open_basedir(filename TSRMLS_CC)
#endif
/* }}} */

PHPAPI int php_check_safe_mode_include_dir(const char *path TSRMLS_DC);

PHPAPI char *php_resolve_path(const char *filename, int filename_len, const char *path TSRMLS_DC);
Expand Down

0 comments on commit 8dfe438

Please sign in to comment.