lkml.org 
[lkml]   [2004]   [Nov]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/4] Move check for invalid chars to vfat_valid_longname()
OGAWA Hirofumi wrote:
> lsr@neapel230.server4you.de writes:
>>+ /* check for invalid characters */
>>+ for (p = name; p < name + len; p++) {
>>+ if (*p < 0x0020 || strchr("*?<>|\":\\", *p) != NULL)
>>+ return 0;
>>+ }
>>+
>> return 1;
>> }
>>
>>@@ -636,10 +627,6 @@ static int vfat_build_slots(struct inode
>> if (res < 0)
>> goto out_free;
>>
>>- res = vfat_is_used_badchars(uname, ulen);
>>- if (res < 0)
>>- goto out_free;
>>-
>> res = vfat_create_shortname(dir, sbi->nls_disk, uname, ulen,
>> msdos_name, &lcase);
>> if (res < 0)
>
>
> Some encodings is using the area of ascii code as second byte.

Yes. But..

> So, it can't.

We want to make sure filenames don't contain '*', '?' etc. It doesn't
matter whether we check the VFS idea of the filename (a simple C string)
or some other encoding of it, no?

Right now we check for 0x002A after xlate_to_uni(), after the patch we
check for 0x2A (ASCII code of '*') before xlate_to_uni() etc. I just
translated the Unicode chars back to ASCII and moved the check.

Am I missing something?

Thanks,
René
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:07    [W:0.062 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site