Skip to content

Bug: Characters disallowed by PathCleanupSpec in filesystems mounted via WSL2 are rendered as invalid codepoints. #17205

@RokeJulianLockhart

Description

@RokeJulianLockhart

Description

I've some directories and files whose names are comprised of tabs ( ). Inside dolphin-25.04.2-1.fc42 (on cpe:/o:fedoraproject:fedora:42), these render as expected:

Image

However, in FilesPreview, these render as UTF tofu:

Image

To confirm, if I duplicate one of their filenames to my Windows clipboard, I see:

`{title ,id s22ai3}`{.JSON5}.dir

However, this should be, per my Linux installation:

`{title: "", id: "s22ai3"}`{.JSON5}.dir

...which can be confirmed with tree there:

.
└── \011`{title: "",\011id: "s22ai3"}`{.JSON5}.dir

This is a significant problem, because it means that Files is performing character replacement, thereby potentially making unintentionally modifying the filename trivial. I haven't confirmed this because I don't dare: I should have mounted this as ro.

Please note that although, in the browser, you're probably seeing hexagana if you're using Windows, this is font-dependent, so Files isn't doing anything special. It's merely not rendering the characters. As an example, explorer.exe "\\?\UNC\wsl.localhost\fedoraremix\mnt\rjlb_data\@{'Name'='Entities'}#.dir\@{'Status'='Commenced'; 'Name'='In Use'}#.dir\@{'Person'='Beedell'; 'Identifier'='S21AIB'}#.dir\@{'Name'='Entity-Specific'}#.dir\@{'Person'='Roke'; 'Identifier'='S1EV2L'}#.dir\@{'Name'='Temporary'}#.dir\. [ ]`{title Git,id s2ykra}`{.JSON5}.dir" also fails to, but renders another (incorrect) replacement character:

Image

Steps To Reproduce

  1. Using a real Linux OS, in a BTRFS filesystem, create a path longer than MAX_PATH that contains tab characters.

  2. Install the .MSIXBundle from WhitewaterFoundry/Fedora-Remix-for-WSL/releases/tag/42.0.5:

    #!/usr/bin/env pwsh
    #Requires -PSEdition Core
    #Requires -Version 7.6
    If ($IsWindows) { Add-AppxPackage -Path "$LocationToMSIX" } # Usually, `$Env:UserProfile/Downloads`.
  3. On the host, execute the undermentioned:

    #!/usr/bin/env pwsh
    #Requires -PSEdition Core
    If ($IsWindows) { wmic diskdrive list brief }

    1

  4. When the correct filesystem has been identified:

    #!/usr/bin/env pwsh
    #Requires -PSEdition Core
    If ($IsWindows) { sudo wsl --mount \\.\PHYSICALDRIVE1 --bare }
  5. Likewise, on WSL:

    #!/usr/bin/env sh
    sudo lsblk -o NAME,FSTYPE,FSVER,FSAVAIL,MOUNTPOINTS

    This shall return output similar to the undermentioned:

    NAME   FSTYPE FSVER FSAVAIL MOUNTPOINTS
    sda    ext4   1.0
    sdb    ext4   1.0
    sdc    swap   1             [SWAP]
    sdd    ext4   1.0    954.6G /mnt/wslg/distro
                                /
    sde
    ├─sde1 vfat   FAT32
    ├─sde2 ext4   1.0
    ├─sde3 ext4   1.0
    └─sde4 btrfs           1.2T /mnt/rjlb/fedora

    Utilise the output to confirm that the device has been mounted into wsl, then set its path as $dev_id, and define a mount point at $path.

  6. When the correct filesystem has been identified:

    #!/usr/bin/env sh
    sudo mkdir /mnt/$path && \
    sudo mount -t btrfs -o ro /dev/$dev_id /mnt/$path

    2

Files Version

3.9.10.0

Windows Version

10.0.26120

User ID

353b71b8-86f9-4fe0-ac0e-e1da114b9349

Log File

debug.log

Footnotes

  1. blog.bryanroessler.com/2020-12-14-btrfs-on-wsl2/

  2. askubuntu.com/revisions/296342/3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions