[Pkg-owncloud-commits] [owncloud] 56/111: Fix for smb4php fseek

David Prévot taffit at moszumanska.debian.org
Wed Nov 20 21:38:41 UTC 2013


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit f9a64d2b2755ba2d63677c0d9846e87790292d4c
Author: Vincent Petry <pvince81 at owncloud.com>
Date:   Fri Nov 15 14:23:24 2013 +0100

    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
---
 apps/files_external/3rdparty/smb4php/smb.php |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/apps/files_external/3rdparty/smb4php/smb.php b/apps/files_external/3rdparty/smb4php/smb.php
index e91b0a5..1a6cd05 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) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list