linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali.rohar@gmail.com>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	"Theodore Y. Ts'o" <tytso@mit.edu>,
	Namjae Jeon <linkinjeon@gmail.com>,
	Gabriel Krisman Bertazi <krisman@collabora.com>
Subject: Re: vfat: Broken case-insensitive support for UTF-8
Date: Tue, 21 Jan 2020 21:34:05 +0100	[thread overview]
Message-ID: <20200121203405.7g7gisb3q55u2y2f@pali> (raw)
In-Reply-To: <20200121000701.GG8904@ZenIV.linux.org.uk>

[-- Attachment #1: Type: text/plain, Size: 2247 bytes --]

On Tuesday 21 January 2020 00:07:01 Al Viro wrote:
> On Tue, Jan 21, 2020 at 12:57:45AM +0100, Pali Rohár wrote:
> > On Monday 20 January 2020 22:46:25 Al Viro wrote:
> > > On Mon, Jan 20, 2020 at 10:40:46PM +0100, Pali Rohár wrote:
> > > 
> > > > Ok, I did some research. It took me it longer as I thought as lot of
> > > > stuff is undocumented and hard to find all relevant information.
> > > > 
> > > > So... fastfat.sys is using ntos function RtlUpcaseUnicodeString() which
> > > > takes UTF-16 string and returns upper case UTF-16 string. There is no
> > > > mapping table in fastfat.sys driver itself.
> > > 
> > > Er...  Surely it's OK to just tabulate that function on 65536 values
> > > and see how could that be packed into something more compact?
> > 
> > It is OK, but too complicated. That function is in nt kernel. So you
> > need to build a new kernel module and also decide where to put output of
> > that function. It is a long time since I did some nt kernel hacking and
> > nowadays you need to download 10GB+ of Visual Studio code, then addons
> > for building kernel modules, figure out how to write and compile simple
> > kernel module via Visual Studio, write ini install file, try to load it
> > and then you even fail as recent Windows kernels refuse to load kernel
> > modules which are not signed...
> 
> Wait a sec...  From NT userland, on a mounted VFAT:
> 	for all s in single-codepoint strings
> 		open s for append
> 		if failed
> 			print s on stderr, along with error value
> 		write s to the opened file, adding to its tail
> 		close the file
> the for each equivalence class you'll get a single file, with all
> members of that class written to it.  In addition you'll get the
> list of prohibited codepoints.
> 
> Why bother with any kind of kernel modules?  IDGI...

This is a great idea to get FAT equivalence classes. Thank you!

Now I quickly tried it... and it failed. FAT has restriction for number
of files in a directory, so I would have to do it in more clever way,
e.g prepare N directories and then try to create/open file for each
single-point string in every directory until it success or fail in every
one.

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

  reply	other threads:[~2020-01-21 20:34 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-19 22:14 vfat: Broken case-insensitive support for UTF-8 Pali Rohár
2020-01-19 23:08 ` Al Viro
2020-01-19 23:33   ` Pali Rohár
2020-01-20  0:09     ` Al Viro
2020-01-20 11:19       ` Pali Rohár
2020-01-20  4:04 ` OGAWA Hirofumi
2020-01-20  7:30   ` Al Viro
2020-01-20  7:45     ` Al Viro
2020-01-20  8:07       ` oopsably broken case-insensitive support in ext4 and f2fs (Re: vfat: Broken case-insensitive support for UTF-8) Al Viro
2020-01-20 19:35         ` Al Viro
2020-01-24  4:29           ` Eric Biggers
2020-01-24 17:47             ` Linus Torvalds
2020-01-24 18:03               ` Jaegeuk Kim
2020-01-24 18:45                 ` Eric Biggers
2020-01-20 11:04   ` vfat: Broken case-insensitive support for UTF-8 Pali Rohár
2020-01-20 12:07     ` OGAWA Hirofumi
2020-01-20 21:40       ` Pali Rohár
2020-01-20 22:46         ` Al Viro
2020-01-20 23:57           ` Pali Rohár
2020-01-21  0:07             ` Al Viro
2020-01-21 20:34               ` Pali Rohár [this message]
2020-01-21 21:36                 ` Al Viro
2020-01-21 22:14                   ` Al Viro
2020-01-21 22:46                     ` Pali Rohár
2020-01-26 23:08                 ` Pali Rohár
2020-01-21 12:43             ` David Laight
2020-01-22  0:25         ` Gabriel Krisman Bertazi
2020-01-20 15:07     ` David Laight
2020-01-20 15:20       ` Pali Rohár
2020-01-20 15:47         ` David Laight
2020-01-20 16:12           ` Al Viro
2020-01-20 16:51             ` David Laight
2020-01-20 16:27           ` Pali Rohár
2020-01-20 16:43             ` David Laight
2020-01-20 16:56               ` Pali Rohár
2020-01-20 17:37       ` Theodore Y. Ts'o
2020-01-20 17:32   ` Theodore Y. Ts'o
2020-01-20 17:56     ` Pali Rohár
2020-01-21  3:52     ` OGAWA Hirofumi
2020-01-21 11:00       ` Pali Rohár
2020-01-21 12:26         ` OGAWA Hirofumi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200121203405.7g7gisb3q55u2y2f@pali \
    --to=pali.rohar@gmail.com \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=krisman@collabora.com \
    --cc=linkinjeon@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tytso@mit.edu \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).