-
Notifications
You must be signed in to change notification settings - Fork 7.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using stream wrappers breaks proc_open #17943
Comments
Here's what happens:
Fixing this would mean propagating |
Thanks, submitted a temporary userland fix in https://github.com/dg/bypass-finals/pull/60/files. Apart from passing the close_handle flag, destruction of the object in php-src/main/streams/userspace.c Line 705 in da1e254
A better native fix may be to early-return from |
Description
The following code (from https://packagist.org/packages/dg/bypass-finals, which is where the issue is happening):
Resulted in this output:
But I expected this output instead: No error.
Stepping through the code, it seems strange to me that this would fail, as after
stream_cast
returns the real underlying stream resource, it is then re-passed to_php_stream_cast
, behaving just like as if no stream wrapper is in use.Another issue is the fact that stream_cast is even part of the stream wrapper API in the first place, given that its only real function is to return the inner resource (regardless of the cast type); a get_inner_resource method would've been way less confusing...
PHP Version
PHP 8.4.4
Operating System
Ubuntu 24.04
The text was updated successfully, but these errors were encountered: