nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
26.72k stars 4k forks source link

[Bug]: Windows file name compatiiblity missing rule to prevent leading `#` #47629

Open mgallien opened 2 weeks ago

mgallien commented 2 weeks ago

⚠️ This issue respects the following points: ⚠️

Bug description

Desktop files client implementing virtual files API on Windows needed to handle errors with file names with leading #. See https://github.com/nextcloud/desktop/pull/6456 The server is missing this rule hence desktop files client not running on Windows can still create those paths impossible to handle on Windows

Steps to reproduce

  1. Use recent sync desktop files client (>= 3.14.0 RC1)
  2. Create a folder and/or file with leading # in the name. Do this when running on Linux.
  3. Wait for the folder to be uplaoded
  4. Try to sync it from a client running virtual files synchronization on Windows

Expected behavior

The Linux based client would report the name to be incompatible with windows, not sync it and offer to rename it.

Nextcloud Server version

master

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.2

Web server

Apache (supported)

Database engine version

MariaDB

Is this bug present after an update or on a fresh install?

None

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

Configuration report

No response

List of activated Apps

No response

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

No response

mgallien commented 2 weeks ago

@susnux I am available if you have questions would need to be done before final release

susnux commented 2 weeks ago

But the # is not forbidden on Windows system? I just tested it and it is pretty valid to have # in filenames and even creating files with leading # works on Windows.

susnux commented 2 weeks ago

Also checked onedrive, as OneDrive is also using the VFS. And for OneDrive it also works perfectly fine. (reading MS support pages # is allowed for OneDrive since 2017 )

mgallien commented 2 weeks ago

@susnux I understand your concerns my point is that we currently get errors reported by the windows CfApi when we try to make virtual files or folders starting with a # that was the point of the PR I linked I will see if I can find out why we get such an error and of there is a workaround currently allowing leading # will trigger sync errors with current releases of the desktop files client