[Pkg-owncloud-commits] [owncloud] 69/111: SMB ignore connection errors when NetBIOS is disabled
David Prévot
taffit at moszumanska.debian.org
Wed Nov 20 21:38:43 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 7e6f3817d07645be5b56becca6ba1a6934f6a2c2
Author: Vincent Petry <pvince81 at owncloud.com>
Date: Mon Nov 18 12:27:30 2013 +0100
SMB ignore connection errors when NetBIOS is disabled
When NetBIOS is blocked or disabled, a smb::look() call can still get
the list of shares from smbclient, even though the name resolution at
the end of the command fails.
This fix makes it ignore the connection error if we already got the list
of shares.
Fixed #5860
---
apps/files_external/3rdparty/smb4php/smb.php | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/apps/files_external/3rdparty/smb4php/smb.php b/apps/files_external/3rdparty/smb4php/smb.php
index 1a6cd05..9650f80 100644
--- a/apps/files_external/3rdparty/smb4php/smb.php
+++ b/apps/files_external/3rdparty/smb4php/smb.php
@@ -127,6 +127,7 @@ class smb {
$old_locale = getenv('LC_ALL');
putenv('LC_ALL=en_US.UTF-8');
$output = popen (SMB4PHP_SMBCLIENT." -N {$auth} {$options} {$port} {$options} {$params} 2>/dev/null", 'r');
+ $gotInfo = false;
$info = array ();
$info['info']= array ();
$mode = '';
@@ -188,7 +189,12 @@ class smb {
}
trigger_error($regs[0].' params('.$params.')', E_USER_ERROR);
case 'error-connect':
- return false;
+ // connection error can happen after obtaining share list if
+ // NetBIOS is disabled/blocked on the target server,
+ // in which case we keep the info and continue
+ if (!$gotInfo) {
+ return false;
+ }
}
if ($i) switch ($i[1]) {
case 'file':
@@ -196,6 +202,7 @@ class smb {
case 'disk':
case 'server':
case 'workgroup': $info[$i[1]][] = $i[0];
+ $gotInfo = true;
}
}
pclose($output);
--
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