summaryrefslogtreecommitdiffstats
path: root/apps/files_external/3rdparty/icewind/smb/src/Share.php
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2018-01-10 12:18:35 +0100
committerRobin Appelman <robin@icewind.nl>2018-01-10 12:18:35 +0100
commitd37e2d45075f36af527f2ebd73169786c89ad330 (patch)
treedb3cf181fdbb215ab6f8f70e819725f1d64fd39f /apps/files_external/3rdparty/icewind/smb/src/Share.php
parent02543c3650282bb4ffb3ecb09ec169052fc6d2a4 (diff)
downloadnextcloud-server-d37e2d45075f36af527f2ebd73169786c89ad330.tar.gz
nextcloud-server-d37e2d45075f36af527f2ebd73169786c89ad330.zip
update icewind/smb to 2.0.3
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files_external/3rdparty/icewind/smb/src/Share.php')
-rw-r--r--apps/files_external/3rdparty/icewind/smb/src/Share.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/apps/files_external/3rdparty/icewind/smb/src/Share.php b/apps/files_external/3rdparty/icewind/smb/src/Share.php
index ba8bbbbb8ca..542eaf0887e 100644
--- a/apps/files_external/3rdparty/icewind/smb/src/Share.php
+++ b/apps/files_external/3rdparty/icewind/smb/src/Share.php
@@ -68,8 +68,9 @@ class Share extends AbstractShare {
);
$connection = new Connection($command, $this->parser);
$connection->writeAuthentication($this->server->getUser(), $this->server->getPassword());
+ $connection->connect();
if (!$connection->isValid()) {
- throw new ConnectionException();
+ throw new ConnectionException($connection->readLine());
}
return $connection;
}
@@ -88,7 +89,6 @@ class Share extends AbstractShare {
protected function reconnect() {
$this->connection->reconnect();
- $this->connection->writeAuthentication($this->server->getUser(), $this->server->getPassword());
if (!$this->connection->isValid()) {
throw new ConnectionException();
}
@@ -318,9 +318,9 @@ class Share extends AbstractShare {
$modeString = '';
$modeMap = array(
FileInfo::MODE_READONLY => 'r',
- FileInfo::MODE_HIDDEN => 'h',
- FileInfo::MODE_ARCHIVE => 'a',
- FileInfo::MODE_SYSTEM => 's'
+ FileInfo::MODE_HIDDEN => 'h',
+ FileInfo::MODE_ARCHIVE => 'a',
+ FileInfo::MODE_SYSTEM => 's'
);
foreach ($modeMap as $modeByte => $string) {
if ($mode & $modeByte) {
@@ -413,6 +413,7 @@ class Share extends AbstractShare {
}
$path = str_replace('/', '\\', $path);
$path = str_replace('"', '^"', $path);
+ $path = ltrim($path, '\\');
return '"' . $path . '"';
}