},
"require": {
"icewind/streams": "0.7.1",
- "icewind/smb": "^3.2.3"
+ "icewind/smb": "^3.2.4"
}
}
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "ceb6bef26683b2d8f92ee654bd63853c",
+ "content-hash": "ab745d51b0d201a3c3d3f78e5cb865c1",
"packages": [
{
"name": "icewind/smb",
- "version": "v3.2.3",
+ "version": "v3.2.4",
"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": {
}
],
"description": "php wrapper for smbclient and libsmbclient-php",
- "time": "2020-04-08T15:20:22+00:00"
+ "time": "2020-05-11T14:12:35+00:00"
},
{
"name": "icewind/streams",
'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',
'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',
[
{
"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": {
"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": {
*/
protected $attributeCache = null;
- /**
- * @var int
- */
- protected $modeCache;
-
/**
* @param NativeShare $share
* @param string $path
$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));
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
*/
*/
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);
+ }
}
/**
*/
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);
+ }
}
/**
*/
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);
+ }
}
/**
*/
public function isSystem() {
$mode = $this->getMode();
- return (bool)($mode & IFileInfo::MODE_SYSTEM);
+ if ($mode > 0x80) {
+ return false;
+ } else {
+ return (bool)($mode & IFileInfo::MODE_SYSTEM);
+ }
}
/**
*/
public function isArchived() {
$mode = $this->getMode();
- return (bool)($mode & IFileInfo::MODE_ARCHIVE);
+ if ($mode > 0x80) {
+ return false;
+ } else {
+ return (bool)($mode & IFileInfo::MODE_ARCHIVE);
+ }
}
/**
$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);