[Pkg-owncloud-commits] [owncloud] 57/134: Fix smb4php to work with home shares
David Prévot
taffit at moszumanska.debian.org
Fri Apr 18 21:44:01 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository owncloud.
commit 6ccc8173d3490ab7039286d29f65afef2d7294c6
Author: Robin McCorkell <rmccorkell at karoshi.org.uk>
Date: Mon Mar 17 15:03:25 2014 +0000
Fix smb4php to work with home shares
Stat'ing a share with url_stat now checks if the user can run 'ls' in that share rather than checking if the share is listed by the server. This means that OwnCloud can now mount user home shares, which are never listed by the server.
---
apps/files_external/3rdparty/smb4php/smb.php | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/apps/files_external/3rdparty/smb4php/smb.php b/apps/files_external/3rdparty/smb4php/smb.php
index 4ecc5b3..d43a1ea 100644
--- a/apps/files_external/3rdparty/smb4php/smb.php
+++ b/apps/files_external/3rdparty/smb4php/smb.php
@@ -20,6 +20,7 @@
# GNU General Public License for more details.
#
# Addition 17/12/2012 Frank Karlitschek (frank at owncloud.org)
+# Addition 17/03/2014 Robin McCorkell (rmccorkell at karoshi.org.uk)
# On the official website http://www.phpclasses.org/smb4php the
# license is listed as LGPL so we assume that this is
# dual-licensed GPL/LGPL
@@ -238,17 +239,10 @@ class smb {
trigger_error ("url_stat(): list failed for host '{$pu['host']}'", E_USER_WARNING);
break;
case 'share':
- if ($o = smb::look ($pu)) {
- $found = FALSE;
- $lshare = strtolower ($pu['share']); # fix by Eric Leung
- foreach ($o['disk'] as $s) if ($lshare == strtolower($s)) {
- $found = TRUE;
- $stat = stat ("/tmp");
- break;
- }
- if (! $found)
- trigger_error ("url_stat(): disk resource '{$lshare}' not found in '{$pu['host']}'", E_USER_WARNING);
- }
+ if (smb::execute("ls", $pu))
+ $stat = stat ("/tmp");
+ else
+ trigger_error ("url_stat(): disk resource '{$pu['share']}' not found in '{$pu['host']}'", E_USER_WARNING);
break;
case 'path':
if ($o = smb::execute ('dir "'.$pu['path'].'"', $pu)) {
--
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