Skip to content
Snippets Groups Projects
Commit b55a6618 authored by Morris Jobke's avatar Morris Jobke
Browse files

Merge pull request #5916 from owncloud/extstorage-smb-ignorenetbioserror

SMB ignore connection errors when NetBIOS is disabled
parents 4a0d295e 7e6f3817
Branches
No related tags found
No related merge requests found
...@@ -127,6 +127,7 @@ class smb { ...@@ -127,6 +127,7 @@ class smb {
$old_locale = getenv('LC_ALL'); $old_locale = getenv('LC_ALL');
putenv('LC_ALL=en_US.UTF-8'); putenv('LC_ALL=en_US.UTF-8');
$output = popen (SMB4PHP_SMBCLIENT." -N {$auth} {$options} {$port} {$options} {$params} 2>/dev/null", 'r'); $output = popen (SMB4PHP_SMBCLIENT." -N {$auth} {$options} {$port} {$options} {$params} 2>/dev/null", 'r');
$gotInfo = false;
$info = array (); $info = array ();
$info['info']= array (); $info['info']= array ();
$mode = ''; $mode = '';
...@@ -188,14 +189,20 @@ class smb { ...@@ -188,14 +189,20 @@ class smb {
} }
trigger_error($regs[0].' params('.$params.')', E_USER_ERROR); trigger_error($regs[0].' params('.$params.')', E_USER_ERROR);
case 'error-connect': case 'error-connect':
// 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; return false;
} }
}
if ($i) switch ($i[1]) { if ($i) switch ($i[1]) {
case 'file': case 'file':
case 'folder': $info['info'][$i[0]] = $i; case 'folder': $info['info'][$i[0]] = $i;
case 'disk': case 'disk':
case 'server': case 'server':
case 'workgroup': $info[$i[1]][] = $i[0]; case 'workgroup': $info[$i[1]][] = $i[0];
$gotInfo = true;
} }
} }
pclose($output); pclose($output);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment