You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PHP does not necessarily call the stream_close() method on stream wrappers every time it calls stream_open(). For example, when copying a file (copy()) it calls both, but when moving a file (rename()) it does not. The result is that renaming a file using EncryptStreamWrapper decrypts the file but does not re-encrypt it, leaving it unencrypted on disk. And when core issue file_unmanaged_move() should issue rename() where possible instead of copy() & unlink() [#1377740] landed (8.1.4), this problem became acute. I discovered this by way of the dropzonejs entity browser widget, which uses file_unmanaged_move() to save new uploads. I played around with moving the encryption to a different method (i.e., stream_write()), but without success. It has been suggested to me that we shouldn't be using stream wrappers to solve this problem in the first place--that encryption is a job for PHP stream filters instead. (Perhaps switching to filters would help with #5, too.) @dawehner
The text was updated successfully, but these errors were encountered:
PHP does not necessarily call the
stream_close()
method on stream wrappers every time it callsstream_open()
. For example, when copying a file (copy()
) it calls both, but when moving a file (rename()
) it does not. The result is that renaming a file usingEncryptStreamWrapper
decrypts the file but does not re-encrypt it, leaving it unencrypted on disk. And when core issue file_unmanaged_move() should issue rename() where possible instead of copy() & unlink() [#1377740] landed (8.1.4), this problem became acute. I discovered this by way of the dropzonejs entity browser widget, which usesfile_unmanaged_move()
to save new uploads. I played around with moving the encryption to a different method (i.e.,stream_write()
), but without success. It has been suggested to me that we shouldn't be using stream wrappers to solve this problem in the first place--that encryption is a job for PHP stream filters instead. (Perhaps switching to filters would help with #5, too.) @dawehnerThe text was updated successfully, but these errors were encountered: