ntfs_link(): prevent creating of recursive directary structure.

FUSE incorrectly handles case insensitive filesystems: when I try to rename
"/Dir" to "/DIR", ntfsmount receive rename("/Dir", "/DIR/Dir") call.
This patch do not fix rename, but prevent fs corruption. I will mail Miklos
about this problem.
edge.strict_endians
yura 2006-06-03 22:09:24 +00:00
parent 6b0018def4
commit 345247a596
1 changed files with 2 additions and 1 deletions

View File

@ -1611,7 +1611,8 @@ int ntfs_link(ntfs_inode *ni, ntfs_inode *dir_ni, ntfschar *name, u8 name_len)
int fn_len, err;
ntfs_log_trace("Entering.\n");
if (!ni || !dir_ni || !name || !name_len) {
if (!ni || !dir_ni || !name || !name_len ||
ni->mft_no == dir_ni->mft_no) {
err = errno;
ntfs_log_error("Invalid arguments.\n");
goto err_out;