diff options
author | Vincent Petry <pvince81@owncloud.com> | 2013-11-15 14:23:24 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2013-11-15 14:23:24 +0100 |
commit | f9a64d2b2755ba2d63677c0d9846e87790292d4c (patch) | |
tree | 633e970fb0c07e59cd31cc0068e795fdd0416007 | |
parent | 630e46f60a7ac43815d14dd3d224de8ae3038465 (diff) | |
download | nextcloud-server-f9a64d2b2755ba2d63677c0d9846e87790292d4c.tar.gz nextcloud-server-f9a64d2b2755ba2d63677c0d9846e87790292d4c.zip |
Fix for smb4php fseek
The stream_fseek function must return a boolean which will be mapped
to 0 for success and -1 for failure for the caller.
This patch fixes stream_fseek of smb4php to also respect this
convention.
Since the encryption app is relying on fseek to detect whether a file is
encrypted by reading the last bit of data, this will fix #5023
-rw-r--r-- | apps/files_external/3rdparty/smb4php/smb.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/files_external/3rdparty/smb4php/smb.php b/apps/files_external/3rdparty/smb4php/smb.php index e91b0a59581..1a6cd05590c 100644 --- a/apps/files_external/3rdparty/smb4php/smb.php +++ b/apps/files_external/3rdparty/smb4php/smb.php @@ -460,7 +460,8 @@ class smb_stream_wrapper extends smb { function stream_tell () { return ftell($this->stream); } - function stream_seek ($offset, $whence=null) { return fseek($this->stream, $offset, $whence); } + // PATCH: the wrapper must return true when fseek succeeded by returning 0. + function stream_seek ($offset, $whence=null) { return fseek($this->stream, $offset, $whence) === 0; } function stream_flush () { if ($this->mode <> 'r' && $this->need_flush) { |