summaryrefslogtreecommitdiffstats
path: root/lib/base.php
diff options
context:
space:
mode:
authorjknockaert <jasper@knockaert.nl>2015-04-21 14:21:53 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2015-04-24 16:43:16 +0200
commit735f6cc0371f5e5c5d84a5ea4189f23104302ed1 (patch)
treea70682b7e5e51c400dfbf391944ad9b8fa3a3d45 /lib/base.php
parent4334e770355df1583011c7e015b5caee48c91204 (diff)
downloadnextcloud-server-735f6cc0371f5e5c5d84a5ea4189f23104302ed1.tar.gz
nextcloud-server-735f6cc0371f5e5c5d84a5ea4189f23104302ed1.zip
fix encryption header error
When moving back the pointer to position 0 (using stream_seek), the pointer on the encrypted stream will be moved to the position immediately after the header. Reading the header again (invoked by stream_read) will cause an error, writing the header again (invoked by stream_write) will corrupt the file. Reading/writing the header should therefore happen when opening the file rather than upon read or write. Note that a side-effect of this PR is that empty files will still get an encryption header; I think that is OK, but it is different from how it was originally implemented.
Diffstat (limited to 'lib/base.php')
0 files changed, 0 insertions, 0 deletions