[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAKYAXd-BZgy-gVAPhLhGNc31q-+8t18A=ho_Q6STmEBoGCoW0w@mail.gmail.com>
Date: Thu, 17 Mar 2022 22:30:28 +0900
From: Namjae Jeon <linkinjeon@...nel.org>
To: Vasant Karasulli <vkarasulli@...e.de>
Cc: David Disseldorp <ddiss@...e.de>, linux-fsdevel@...r.kernel.org,
Sungjong Seo <sj1557.seo@...sung.com>,
linux-kernel@...r.kernel.org, Takashi Iwai <tiwai@...e.de>
Subject: Re: [PATCH v5 1/1] exfat: allow access to paths with trailing dots
2022-03-17 18:50 GMT+09:00, Vasant Karasulli <vkarasulli@...e.de>:
> The Linux kernel exfat driver currently unconditionally strips
> trailing periods '.' from path components. This isdone intentionally,
> loosely following Windows behaviour and specifications
> which state:
>
> #exFAT
> The concatenated file name has the same set of illegal characters as
> other FAT-based file systems (see Table 31).
>
> #FAT
> ...
> Leading and trailing spaces in a long name are ignored.
> Leading and embedded periods are allowed in a name and are stored in
> the long name. Trailing periods are ignored.
>
> Note: Leading and trailing space ' ' characters are currently retained
> by Linux kernel exfat, in conflict with the above specification.
> On Windows 10, trailing and leading space ' ' characters are stripped
> from the filenames.
> Some implementations, such as fuse-exfat, don't perform path trailer
> removal. When mounting images which contain trailing-dot paths, these
> paths are unreachable, e.g.:
>
> + mount.exfat-fuse /dev/zram0 /mnt/test/
> FUSE exfat 1.3.0
> + cd /mnt/test/
> + touch fuse_created_dots... ' fuse_created_spaces '
> + ls -l
> total 0
> -rwxrwxrwx 1 root 0 0 Aug 18 09:45 ' fuse_created_spaces '
> -rwxrwxrwx 1 root 0 0 Aug 18 09:45 fuse_created_dots...
> + cd /
> + umount /mnt/test/
> + mount -t exfat /dev/zram0 /mnt/test
> + cd /mnt/test
> + ls -l
> ls: cannot access 'fuse_created_dots...': No such file or directory
> total 0
> -rwxr-xr-x 1 root 0 0 Aug 18 09:45 ' fuse_created_spaces '
> -????????? ? ? ? ? ? fuse_created_dots...
> + touch kexfat_created_dots... ' kexfat_created_spaces '
> + ls -l
> ls: cannot access 'fuse_created_dots...': No such file or directory
> total 0
> -rwxr-xr-x 1 root 0 0 Aug 18 09:45 ' fuse_created_spaces '
> -rwxr-xr-x 1 root 0 0 Aug 18 09:45 ' kexfat_created_spaces '
> -????????? ? ? ? ? ? fuse_created_dots...
> -rwxr-xr-x 1 root 0 0 Aug 18 09:45 kexfat_created_dots
> + cd /
> + umount /mnt/test/
>
> This commit adds "keep_last_dots" mount option that controls whether or
> not trailing periods '.' are stripped
> from path components during file lookup or file creation.
> This mount option can be used to access
> paths with trailing periods and disallow creating files with names with
> trailing periods. E.g. continuing from the previous example:
>
> + mount -t exfat -o keep_last_dots /dev/zram0 /mnt/test
> + cd /mnt/test
> + ls -l
> total 0
> -rwxr-xr-x 1 root 0 0 Aug 18 10:32 ' fuse_created_spaces '
> -rwxr-xr-x 1 root 0 0 Aug 18 10:32 ' kexfat_created_spaces '
> -rwxr-xr-x 1 root 0 0 Aug 18 10:32 fuse_created_dots...
> -rwxr-xr-x 1 root 0 0 Aug 18 10:32 kexfat_created_dots
>
> + echo > kexfat_created_dots_again...
> sh: kexfat_created_dots_again...: Invalid argument
>
> Link: https://bugzilla.suse.com/show_bug.cgi?id=1188964
> Link: https://lore.kernel.org/linux-fsdevel/003b01d755e4$31fb0d80$95f12880$
> @samsung.com/
> Link:
> https://docs.microsoft.com/en-us/windows/win32/fileio/exfat-specification
> Suggested-by: Takashi Iwai <tiwai@...e.de>
> Signed-off-by: Vasant Karasulli <vkarasulli@...e.de>
> Co-developed-by: David Disseldorp <ddiss@...e.de>
> Signed-off-by: David Disseldorp <ddiss@...e.de>
Applied, Thanks for your patch!
Powered by blists - more mailing lists