safemode, php_stream_open_wrapper does not respect REPORT_ERRORS

php.internals

Pierre Joye

19 years ago
Hi, While fixing PECL Bug #10426, we found that php_checkuid_ex forces CHECKUID_DISALLOW_FILE_NOT_EXISTS in read mode. As php_stream_open_wrapper uses this functions, it is not possible to call it using a non existing file without getting a warning when safe_mode is On. The related code is main/safemode.c:70 : if (fopen_mode) { if (fopen_mode[0] == 'r') { mode = CHECKUID_DISALLOW_FILE_NOT_EXISTS; } else { mode = CHECKUID_CHECK_FILE_AND_DIR; } } Any reason behind this check or should we drop it? Thanks, --Pierre