-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SMB External storage webdav path adds extra string "Dc" and causes share to be not accessible #29003
Comments
See the screencast attached external_share_issue.mp4 |
The main point that the path changed. |
This comment has been minimized.
This comment has been minimized.
I can confirm this bug on NC 20.0.12, the problem is caused by an incorrect interpretation of file attributes, see this thread I started recently. In short: this "extra string" is filename attribute merged with the file name. In this context "Dc" suffix means that directory and compressed attribute is set on smb share. |
This comment has been minimized.
This comment has been minimized.
It works when using the native smbclient (https://github.com/eduardok/libsmbclient-php). After purging the external storages from the database, the directories are fine again for me. FROM nextcloud:22-fpm
RUN apt-get update && apt-get install -y procps libsmbclient-dev && rm -rf /var/lib/apt/lists/*
RUN pecl install smbclient && docker-php-ext-enable smbclient It can also be fixed by adding lowercase modes to the regex in /**
* @param string[] $output
* @param string $basePath
* @param callable(string):ACL[] $aclCallback
* @return FileInfo[]
*/
public function parseDir(array $output, string $basePath, callable $aclCallback): array {
//last line is used space
array_pop($output);
$regex = '/^\s*(.*?)\s\s\s\s+(?:([NDHARSndhars]*)\s+)?([0-9]+)\s+(.*)$/';
//2 spaces, filename, optional type, size, date
$content = [];
foreach ($output as $line) {
if (preg_match($regex, $line, $matches)) {
list(, $name, $mode, $size, $time) = $matches;
if ($name !== '.' and $name !== '..') {
$mode = $this->parseMode(strtoupper($mode));
$time = strtotime($time . ' ' . $this->timeZone);
$path = $basePath . '/' . $name;
$content[] = new FileInfo($path, $name, (int)$size, $time, $mode, function () use ($aclCallback, $path): array {
return $aclCallback($path);
});
}
}
}
return $content;
} |
This comment has been minimized.
This comment has been minimized.
@uniuuu can you try the patch by #29003 (comment) |
Thank you. |
Closing and moving issue + possible fix to icewind1991/SMB#110 |
How to use GitHub
Steps to reproduce
Expected behaviour
External storage will nested folders names not changed
Actual behaviour
External storage nested folders names have changed adding "Dc" at the end
Server configuration
Operating system:
Debian (in docker)
Web server:
Apache
Database:
MySQL
PHP version:
8.0.11
Nextcloud version: (see Nextcloud admin page)
22.1.1
Updated from an older Nextcloud/ownCloud or fresh install:
21.0.4
Where did you install Nextcloud from:
docker
Signing status:
Signing status
List of activated apps:
App list
Nextcloud configuration:
Config report
Are you using external storage, if yes which one: SMB
Are you using encryption: no
Are you using an external user-backend, if yes which one: LDAP
LDAP configuration (delete this part if not used)
LDAP config
Client configuration
Browser:
Firefox
Operating system:
Windows 10
Logs
Web server error log
Web server error log
Nextcloud log (data/nextcloud.log)
Nextcloud log
Browser log
Browser log
The text was updated successfully, but these errors were encountered: