# safemode, php_stream_open_wrapper does not respect REPORT_ERRORS

- Thread: https://externals.io/message/28500
- Original archive: https://news-web.php.net/php.internals/28500
- Started by Pierre on 2007-03-20T21:08:49+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #28500 — Pierre — 2007-03-20T21:08:49+00:00

URL: https://externals.io/message/28500#28500

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
