php-vfs
php-vfs copied to clipboard
touch permission check fails
Simple to reproduce:
chmod($fs->path('/var'), 0600);
chown($fs->path('/var'), 'root');
touch($fs->path('/var/foo')); // <-- File is created when it should fail
file_put_contents($fs->path('/var/foo'), 'bar'); // <-- without above touch this will, and should, fail
I can see, in the debugger, that the parent /var directory has the owner and mode set correctly.
Wrapper::stream_open line 168, (called by file_put_contents) first checks the parent for writability. Wrapper::stream_metadata line 407, skips that check.