Skip to content
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

Invalid request for Invalid path files_external/3rdparty/icewind/smb/src/Native/NativeShare.php support for characters like : and | #24924

Closed
tuxcrafter opened this issue Dec 30, 2020 · 1 comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug

Comments

@tuxcrafter
Copy link

tuxcrafter commented Dec 30, 2020

I am a heavy user of : semicolons and | vertical bar characters, they work fine in ext4 and windows 10, however the smb client in nextcloud keep creating exceptions on mounts and files:scan.

Can we please add more support for characters (UTF-8) for files_external? I would love to see nextcloud handle files and synchronizng very well.

Exception during scan: Invalid request for Invalid path, ":" is not allowed (InvalidPathException)
#0 /var/www/html/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeShare.php(70): Icewind\SMB\AbstractShare->verifyPath()
#1 /var/www/html/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeShare.php(306): Icewind\SMB\Native\NativeShare->buildUrl()
#2 /var/www/html/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeFileInfo.php(64): Icewind\SMB\Native\NativeShare->getAttribute()
#3 /var/www/html/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeFileInfo.php(111): Icewind\SMB\Native\NativeFileInfo->stat()
#4 /var/www/html/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeFileInfo.php(147): Icewind\SMB\Native\NativeFileInfo->getMode()
#5 /var/www/html/nextcloud/apps/files_external/lib/Lib/Storage/SMB.php(247): Icewind\SMB\Native\NativeFileInfo->isHidden()
#6 /var/www/html/nextcloud/apps/files_external/lib/Lib/Storage/SMB.php(610): OCA\Files_External\Lib\Storage\SMB->getFolderContents()
#7 [internal function]: OCA\Files_External\Lib\Storage\SMB->getDirectoryContent()
#8 /var/www/html/nextcloud/lib/private/Files/Cache/Scanner.php(408): iterator_to_array()
#9 /var/www/html/nextcloud/lib/private/Files/Cache/Scanner.php(388): OC\Files\Cache\Scanner->handleChildren()
#10 /var/www/html/nextcloud/lib/private/Files/Cache/Scanner.php(391): OC\Files\Cache\Scanner->scanChildren()
#11 /var/www/html/nextcloud/lib/private/Files/Cache/Scanner.php(391): OC\Files\Cache\Scanner->scanChildren()
#12 /var/www/html/nextcloud/lib/private/Files/Cache/Scanner.php(340): OC\Files\Cache\Scanner->scanChildren()
#13 /var/www/html/nextcloud/lib/private/Files/Utils/Scanner.php(260): OC\Files\Cache\Scanner->scan()
#14 /var/www/html/nextcloud/apps/files/lib/Command/Scan.php(152): OC\Files\Utils\Scanner->scan()
#15 /var/www/html/nextcloud/apps/files/lib/Command/Scan.php(208): OCA\Files\Command\Scan->scanFiles()
#16 /var/www/html/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OCA\Files\Command\Scan->execute()
#17 /var/www/html/nextcloud/core/Command/Base.php(169): Symfony\Component\Console\Command\Command->run()
#18 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(1000): OC\Core\Command\Base->run()
#19 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(271): Symfony\Component\Console\Application->doRunCommand()
#20 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(147): Symfony\Component\Console\Application->doRun()
#21 /var/www/html/nextcloud/lib/private/Console/Application.php(215): Symfony\Component\Console\Application->run()
#22 /var/www/html/nextcloud/console.php(100): OC\Console\Application->run()
#23 /var/www/html/nextcloud/occ(11): require_once('/var/www/html/n...')
#24 {main}

    "dbtype": "mysql",
    "version": "20.0.4.0",
    "mysql.utf8mb4": true,

    "files": {
        "cronjob_scan_files": "500",
        "enabled": "yes",
        "installed_version": "1.15.0",
        "max_chunk_size": "0",
        "types": "filesystem"
    },
@tuxcrafter tuxcrafter added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Dec 30, 2020
@kesselb
Copy link
Contributor

kesselb commented Jan 2, 2021

: semicolons and | vertical bar character

List of forbidden characters: https://github.com/icewind1991/SMB/blob/743a7bf35317f1b76cf8e8b804e54a6c5faacad6/src/AbstractShare.php#L16

Introduced ~6 years ago by: icewind1991/SMB@4ca3c3d. A comment says that // / ? < > \ : * | " are illegal characters in path on windows and is also documented by Microsoft here: https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file.

Can we please add more support for characters (UTF-8) for files_external?

Are you sure that UTF-8 does not work?

If you know a way to workaround this limitation report it to https://github.com/icewind1991/SMB/issues. As soon as the smb library know how to work with those characters it will work in Nextcloud too.

@kesselb kesselb closed this as completed Jan 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug
Projects
None yet
Development

No branches or pull requests

2 participants