mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 09:14:06 +02:00
Fix mistaking socket files for directories
According to https://www.php.net/manual/en/function.stat.php sockets 1100000000000000 and directories 0100000000000000 share a bit (0x4000), we just make sure that the extra socket bit (0x8000) is not set when deciding if it's a directory or not.
This commit is contained in:
parent
8d936e04ef
commit
5291cf842d
1 changed files with 1 additions and 1 deletions
|
|
@ -99,7 +99,7 @@ class NativeFileInfo implements IFileInfo {
|
|||
public function isDirectory(): bool {
|
||||
$mode = $this->getMode();
|
||||
if ($mode > 0x1000) {
|
||||
return (bool)($mode & 0x4000); // 0x4000: unix directory flag
|
||||
return (bool)($mode & 0x4000 && !($mode & 0x8000)); // 0x4000: unix directory flag shares bits with 0xC000: socket
|
||||
} else {
|
||||
return (bool)($mode & IFileInfo::MODE_DIRECTORY);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue