aha/fs/nls
OGAWA Hirofumi 67638e4043 fat/nls: Fix handling of utf8 invalid char
With utf8 option, vfat allowed the duplicated filenames.

Normal nls returns -EINVAL for invalid char. But utf8s_to_utf16s()
skipped the invalid char historically.

So, this changes the utf8s_to_utf16s() directly to return -EINVAL for
invalid char, because vfat is only user of it.

mkdir /mnt/fatfs
FILENAME=`echo -ne "invalidutf8char_\\0341_endofchar"`
echo "Using filename: $FILENAME"
dd if=/dev/zero of=fatfs bs=512 count=128
mkdosfs -F 32 fatfs
mount -o loop,utf8 fatfs /mnt/fatfs
touch "/mnt/fatfs/$FILENAME"
umount /mnt/fatfs
mount -o loop,utf8 fatfs /mnt/fatfs
touch "/mnt/fatfs/$FILENAME"
ls -l /mnt/fatfs
umount /mnt/fatfs

----  And the output is:

Using filename: invalidutf8char_\0341_endofchar
128+0 records in
128+0 records out
65536 bytes (66 kB) copied, 0.000388118 s, 169 MB/s
mkdosfs 2.11 (12 Mar 2005)
total 0
-rwxr-xr-x 1 root root 0 Jun 28 19:46 invalidutf8char__endofchar
-rwxr-xr-x 1 root root 0 Jun 28 19:46 invalidutf8char__endofchar

Tested-by: Marton Balint <cus@fazekas.hu>
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
2009-08-01 21:35:21 +09:00
..
Kconfig menuconfig: transform NLS and DLM menus 2007-10-17 08:43:00 -07:00
Makefile
nls_ascii.c add consts where appropriate in fs/nls/* 2007-10-17 08:42:58 -07:00
nls_base.c fat/nls: Fix handling of utf8 invalid char 2009-08-01 21:35:21 +09:00
nls_cp437.c add consts where appropriate in fs/nls/* 2007-10-17 08:42:58 -07:00
nls_cp737.c add consts where appropriate in fs/nls/* 2007-10-17 08:42:58 -07:00
nls_cp775.c add consts where appropriate in fs/nls/* 2007-10-17 08:42:58 -07:00
nls_cp850.c add consts where appropriate in fs/nls/* 2007-10-17 08:42:58 -07:00
nls_cp852.c add consts where appropriate in fs/nls/* 2007-10-17 08:42:58 -07:00
nls_cp855.c add consts where appropriate in fs/nls/* 2007-10-17 08:42:58 -07:00
nls_cp857.c add consts where appropriate in fs/nls/* 2007-10-17 08:42:58 -07:00
nls_cp860.c add consts where appropriate in fs/nls/* 2007-10-17 08:42:58 -07:00
nls_cp861.c add consts where appropriate in fs/nls/* 2007-10-17 08:42:58 -07:00
nls_cp862.c add consts where appropriate in fs/nls/* 2007-10-17 08:42:58 -07:00
nls_cp863.c add consts where appropriate in fs/nls/* 2007-10-17 08:42:58 -07:00
nls_cp864.c add consts where appropriate in fs/nls/* 2007-10-17 08:42:58 -07:00
nls_cp865.c add consts where appropriate in fs/nls/* 2007-10-17 08:42:58 -07:00
nls_cp866.c add consts where appropriate in fs/nls/* 2007-10-17 08:42:58 -07:00
nls_cp869.c add consts where appropriate in fs/nls/* 2007-10-17 08:42:58 -07:00
nls_cp874.c add consts where appropriate in fs/nls/* 2007-10-17 08:42:58 -07:00
nls_cp932.c add consts where appropriate in fs/nls/* 2007-10-17 08:42:58 -07:00
nls_cp936.c add consts where appropriate in fs/nls/* 2007-10-17 08:42:58 -07:00
nls_cp949.c add consts where appropriate in fs/nls/* 2007-10-17 08:42:58 -07:00
nls_cp950.c add consts where appropriate in fs/nls/* 2007-10-17 08:42:58 -07:00
nls_cp1250.c add consts where appropriate in fs/nls/* 2007-10-17 08:42:58 -07:00
nls_cp1251.c add consts where appropriate in fs/nls/* 2007-10-17 08:42:58 -07:00
nls_cp1255.c add consts where appropriate in fs/nls/* 2007-10-17 08:42:58 -07:00
nls_euc-jp.c add consts where appropriate in fs/nls/* 2007-10-17 08:42:58 -07:00
nls_iso8859-1.c add consts where appropriate in fs/nls/* 2007-10-17 08:42:58 -07:00
nls_iso8859-2.c add consts where appropriate in fs/nls/* 2007-10-17 08:42:58 -07:00
nls_iso8859-3.c add consts where appropriate in fs/nls/* 2007-10-17 08:42:58 -07:00
nls_iso8859-4.c add consts where appropriate in fs/nls/* 2007-10-17 08:42:58 -07:00
nls_iso8859-5.c add consts where appropriate in fs/nls/* 2007-10-17 08:42:58 -07:00
nls_iso8859-6.c add consts where appropriate in fs/nls/* 2007-10-17 08:42:58 -07:00
nls_iso8859-7.c add consts where appropriate in fs/nls/* 2007-10-17 08:42:58 -07:00
nls_iso8859-9.c add consts where appropriate in fs/nls/* 2007-10-17 08:42:58 -07:00
nls_iso8859-13.c add consts where appropriate in fs/nls/* 2007-10-17 08:42:58 -07:00
nls_iso8859-14.c add consts where appropriate in fs/nls/* 2007-10-17 08:42:58 -07:00
nls_iso8859-15.c add consts where appropriate in fs/nls/* 2007-10-17 08:42:58 -07:00
nls_koi8-r.c add consts where appropriate in fs/nls/* 2007-10-17 08:42:58 -07:00
nls_koi8-ru.c
nls_koi8-u.c add consts where appropriate in fs/nls/* 2007-10-17 08:42:58 -07:00
nls_utf8.c NLS: update handling of Unicode 2009-06-15 21:44:43 -07:00