diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2006-08-11 15:07:13 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2006-08-11 15:07:13 +0000 |
commit | d1e841841be57f679fa7370e3bbd40df9153386e (patch) | |
tree | 738d28c066d76a20346851cc7a7c142d4df2a108 | |
parent | 5a51cc577d943d9b85525a1bbd73b24b2e98807d (diff) | |
download | php-git-d1e841841be57f679fa7370e3bbd40df9153386e.tar.gz |
MFB: Extend safe_mode/open_basedir checks to imap_reopen() as well.
-rw-r--r-- | ext/imap/php_imap.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index f9c7b1085b..86df8670f8 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -824,6 +824,14 @@ PHP_FUNCTION(imap_reopen) } imap_le_struct->flags = cl_flags; } + + /* local filename, need to perform open_basedir and safe_mode checks */ + if (Z_STRVAL_PP(mailbox)[0] != '{' && + (php_check_open_basedir(Z_STRVAL_PP(mailbox) TSRMLS_CC) || + (PG(safe_mode) && !php_checkuid(Z_STRVAL_PP(mailbox), NULL, CHECKUID_CHECK_FILE_AND_DIR)))) { + RETURN_FALSE; + } + imap_stream = mail_open(imap_le_struct->imap_stream, Z_STRVAL_PP(mailbox), flags); if (imap_stream == NIL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't re-open stream"); |