Re: JFS default behavior (was: UTF-8 in file systems? xfs/extfs/etc.)

Eduard Bloch
2004-02-16T19:14:25Z

#include <hallo.h>
* Jamie Lokier [Mon, Feb 16 2004, 03:32:24PM]:

> > That looks like a security hole just waiting to happen. Probably
> > has lots of lurking corner cases too - what if you creat() a file,
> > then do a readdir() and strcmp() each entry looking for your file
> > (while comparing a filename smashed to UTF-8 to the original
> > unsmashed string)?
>
> Actually, following Eduard's proposal, that would work fine. The file
> name would be passed to libc in the current encoding, created in
> UTF-8, libc's readdir() would convert it back (which is always
> possible without mangling), and strcmp() would be fine.
>
> The real problem comes when you readdir() a directory which contains
> non-UTF-8 names. Even if you changes your local filesystem, when you
> go travelling an remotely-mounted filesystem elsewhere may have them.
> What does Eduard's libc do then? Ignore the names? Mangle them?

Just pass the uncoverted strings then. Please note that this is exactly
what happens today - every application running in UTF-8 locale and
facing incompatible filenames has to deal with this problem. I wonder
why so many people pretend that the current situation is "less or more
okay".

> Not to mention the extremely unpleasant performance implications.

You always loose a bit performance when dealing with Unicode. Just
accept it.

Regards,
Eduard.
--
Lang ist der Weg durch Lehren, kurz und wirksam durch Beispiele.
-- Lucius Annaeus Seneca (4-65 n.Chr.)