* Fix filenames collation.

* Minor comment cleanup.
edge.strict_endians
cha0smaster 2005-08-26 20:17:08 +00:00
parent f80efa5e9a
commit c3727658ca
3 changed files with 15 additions and 3 deletions

View File

@ -1,6 +1,6 @@
/*
* collate.h - Defines for NTFS kernel collation handling. Part of the
* Linux-NTFS project.
* collate.h - Defines for NTFS collation handling. Part of the Linux-NTFS
* project.
*
* Copyright (c) 2004 Anton Altaparmakov
* Copyright (c) 2005 Yura Pakhuchiy

View File

@ -1,5 +1,5 @@
/*
* collate.c - NTFS kernel collation handling. Part of the Linux-NTFS project.
* collate.c - NTFS collation handling. Part of the Linux-NTFS project.
*
* Copyright (c) 2004 Anton Altaparmakov
* Copyright (c) 2005 Yura Pakhuchiy

View File

@ -256,6 +256,12 @@ done:
*/
rc = ntfs_collate(vol, cr, key, key_len, &ie->key,
le16_to_cpu(ie->key_length));
if (rc == NTFS_COLLATION_ERROR) {
ntfs_error(, "Collation error. Probably filename "
"contain invalid characters.");
err = ERANGE;
goto err_out;
}
/*
* If @key collates before the key of the current entry, there
* is definitely no such key in this index but we might need to
@ -384,6 +390,12 @@ ia_done:
*/
rc = ntfs_collate(vol, cr, key, key_len, &ie->key,
le16_to_cpu(ie->key_length));
if (rc == NTFS_COLLATION_ERROR) {
ntfs_error(, "Collation error. Probably filename "
"contain invalid characters.");
err = ERANGE;
goto err_out;
}
/*
* If @key collates before the key of the current entry, there
* is definitely no such key in this index but we might need to