make authfile handling compatible with smbclient 4.6.x

This commit is contained in:
Robin Appelman 2017-08-17 16:00:22 +02:00
commit 6723c97de1
3 changed files with 44 additions and 31 deletions

View file

@ -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) {