Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/files_external/3rdparty/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
},
"require": {
"icewind/streams": "0.7.1",
"icewind/smb": "^3.2.3"
"icewind/smb": "^3.2.4"
}
}
12 changes: 6 additions & 6 deletions apps/files_external/3rdparty/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 0 additions & 10 deletions apps/files_external/3rdparty/composer/autoload_classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,6 @@
'Icewind\\SMB\\Options' => $vendorDir . '/icewind/smb/src/Options.php',
'Icewind\\SMB\\ServerFactory' => $vendorDir . '/icewind/smb/src/ServerFactory.php',
'Icewind\\SMB\\System' => $vendorDir . '/icewind/smb/src/System.php',
'Icewind\\SMB\\Test\\AbstractShareTest' => $vendorDir . '/icewind/smb/tests/AbstractShareTest.php',
'Icewind\\SMB\\Test\\NativeShareTest' => $vendorDir . '/icewind/smb/tests/NativeShareTest.php',
'Icewind\\SMB\\Test\\NativeStreamTest' => $vendorDir . '/icewind/smb/tests/NativeStreamTest.php',
'Icewind\\SMB\\Test\\NotifyHandlerTest' => $vendorDir . '/icewind/smb/tests/NotifyHandlerTest.php',
'Icewind\\SMB\\Test\\ParserTest' => $vendorDir . '/icewind/smb/tests/ParserTest.php',
'Icewind\\SMB\\Test\\ServerFactoryTest' => $vendorDir . '/icewind/smb/tests/ServerFactoryTest.php',
'Icewind\\SMB\\Test\\ServerTest' => $vendorDir . '/icewind/smb/tests/ServerTest.php',
'Icewind\\SMB\\Test\\ShareTest' => $vendorDir . '/icewind/smb/tests/ShareTest.php',
'Icewind\\SMB\\Test\\TestCase' => $vendorDir . '/icewind/smb/tests/TestCase.php',
'Icewind\\SMB\\Test\\TimeZoneProviderTest' => $vendorDir . '/icewind/smb/tests/TimeZoneProviderTest.php',
'Icewind\\SMB\\TimeZoneProvider' => $vendorDir . '/icewind/smb/src/TimeZoneProvider.php',
'Icewind\\SMB\\Wrapped\\Connection' => $vendorDir . '/icewind/smb/src/Wrapped/Connection.php',
'Icewind\\SMB\\Wrapped\\ErrorCodes' => $vendorDir . '/icewind/smb/src/Wrapped/ErrorCodes.php',
Expand Down
10 changes: 0 additions & 10 deletions apps/files_external/3rdparty/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,6 @@ class ComposerStaticInit98fe9b281934250b3a93f69a5ce843b3
'Icewind\\SMB\\Options' => __DIR__ . '/..' . '/icewind/smb/src/Options.php',
'Icewind\\SMB\\ServerFactory' => __DIR__ . '/..' . '/icewind/smb/src/ServerFactory.php',
'Icewind\\SMB\\System' => __DIR__ . '/..' . '/icewind/smb/src/System.php',
'Icewind\\SMB\\Test\\AbstractShareTest' => __DIR__ . '/..' . '/icewind/smb/tests/AbstractShareTest.php',
'Icewind\\SMB\\Test\\NativeShareTest' => __DIR__ . '/..' . '/icewind/smb/tests/NativeShareTest.php',
'Icewind\\SMB\\Test\\NativeStreamTest' => __DIR__ . '/..' . '/icewind/smb/tests/NativeStreamTest.php',
'Icewind\\SMB\\Test\\NotifyHandlerTest' => __DIR__ . '/..' . '/icewind/smb/tests/NotifyHandlerTest.php',
'Icewind\\SMB\\Test\\ParserTest' => __DIR__ . '/..' . '/icewind/smb/tests/ParserTest.php',
'Icewind\\SMB\\Test\\ServerFactoryTest' => __DIR__ . '/..' . '/icewind/smb/tests/ServerFactoryTest.php',
'Icewind\\SMB\\Test\\ServerTest' => __DIR__ . '/..' . '/icewind/smb/tests/ServerTest.php',
'Icewind\\SMB\\Test\\ShareTest' => __DIR__ . '/..' . '/icewind/smb/tests/ShareTest.php',
'Icewind\\SMB\\Test\\TestCase' => __DIR__ . '/..' . '/icewind/smb/tests/TestCase.php',
'Icewind\\SMB\\Test\\TimeZoneProviderTest' => __DIR__ . '/..' . '/icewind/smb/tests/TimeZoneProviderTest.php',
'Icewind\\SMB\\TimeZoneProvider' => __DIR__ . '/..' . '/icewind/smb/src/TimeZoneProvider.php',
'Icewind\\SMB\\Wrapped\\Connection' => __DIR__ . '/..' . '/icewind/smb/src/Wrapped/Connection.php',
'Icewind\\SMB\\Wrapped\\ErrorCodes' => __DIR__ . '/..' . '/icewind/smb/src/Wrapped/ErrorCodes.php',
Expand Down
12 changes: 6 additions & 6 deletions apps/files_external/3rdparty/composer/installed.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[
{
"name": "icewind/smb",
"version": "v3.2.3",
"version_normalized": "3.2.3.0",
"version": "v3.2.4",
"version_normalized": "3.2.4.0",
"source": {
"type": "git",
"url": "https://github.com/icewind1991/SMB.git",
"reference": "db50bb51bd0a0e55506e82cf439a9ecd232f64d4"
"reference": "999d6687ca9d4ac2600185c935b45206e47e604a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/icewind1991/SMB/zipball/db50bb51bd0a0e55506e82cf439a9ecd232f64d4",
"reference": "db50bb51bd0a0e55506e82cf439a9ecd232f64d4",
"url": "https://api.github.com/repos/icewind1991/SMB/zipball/999d6687ca9d4ac2600185c935b45206e47e604a",
"reference": "999d6687ca9d4ac2600185c935b45206e47e604a",
"shasum": ""
},
"require": {
Expand All @@ -22,7 +22,7 @@
"friendsofphp/php-cs-fixer": "^2.13",
"phpunit/phpunit": "^7.0"
},
"time": "2020-04-08T15:20:22+00:00",
"time": "2020-05-11T14:12:35+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ class NativeFileInfo implements IFileInfo {
*/
protected $attributeCache = null;

/**
* @var int
*/
protected $modeCache;

/**
* @param NativeShare $share
* @param string $path
Expand Down Expand Up @@ -69,7 +64,7 @@ protected function stat() {
$rawAttributes = explode(',', $this->share->getAttribute($this->path, 'system.dos_attr.*'));
$this->attributeCache = [];
foreach ($rawAttributes as $rawAttribute) {
[$name, $value] = explode(':', $rawAttribute);
list($name, $value) = explode(':', $rawAttribute);
$name = strtolower($name);
if ($name == 'mode') {
$this->attributeCache[$name] = (int)hexdec(substr($value, 2));
Expand Down Expand Up @@ -97,6 +92,18 @@ public function getMTime() {
return $stat['change_time'];
}

/**
* On "mode":
*
* different smbclient versions seem to return different mode values for 'system.dos_attr.mode'
*
* older versions return the dos permissions mask as defined in `IFileInfo::MODE_*` while
* newer versions return the equivalent unix permission mask.
*
* Since the unix mask doesn't contain the proper hidden/archive/system flags we have to assume them
* as false (except for `hidden` where we use the unix dotfile convention)
*/

/**
* @return int
*/
Expand All @@ -109,39 +116,59 @@ protected function getMode() {
*/
public function isDirectory() {
$mode = $this->getMode();
return (bool)($mode & IFileInfo::MODE_DIRECTORY);
if ($mode > 0x80) {
return (bool)($mode & 0x4000); // 0x80: unix directory flag
} else {
return (bool)($mode & IFileInfo::MODE_DIRECTORY);
}
}

/**
* @return bool
*/
public function isReadOnly() {
$mode = $this->getMode();
return (bool)($mode & IFileInfo::MODE_READONLY);
if ($mode > 0x80) {
return !(bool)($mode & 0x80); // 0x80: owner write permissions
} else {
return (bool)($mode & IFileInfo::MODE_READONLY);
}
}

/**
* @return bool
*/
public function isHidden() {
$mode = $this->getMode();
return (bool)($mode & IFileInfo::MODE_HIDDEN);
if ($mode > 0x80) {
return $this->name[0] === '.';
} else {
return (bool)($mode & IFileInfo::MODE_HIDDEN);
}
}

/**
* @return bool
*/
public function isSystem() {
$mode = $this->getMode();
return (bool)($mode & IFileInfo::MODE_SYSTEM);
if ($mode > 0x80) {
return false;
} else {
return (bool)($mode & IFileInfo::MODE_SYSTEM);
}
}

/**
* @return bool
*/
public function isArchived() {
$mode = $this->getMode();
return (bool)($mode & IFileInfo::MODE_ARCHIVE);
if ($mode > 0x80) {
return false;
} else {
return (bool)($mode & IFileInfo::MODE_ARCHIVE);
}
}

/**
Expand All @@ -152,8 +179,8 @@ public function getAcls(): array {
$attribute = $this->share->getAttribute($this->path, 'system.nt_sec_desc.acl.*+');

foreach (explode(',', $attribute) as $acl) {
[$user, $permissions] = explode(':', $acl, 2);
[$type, $flags, $mask] = explode('/', $permissions);
list($user, $permissions) = explode(':', $acl, 2);
list($type, $flags, $mask) = explode('/', $permissions);
$mask = hexdec($mask);

$acls[$user] = new ACL($type, $flags, $mask);
Expand Down