From 32d4eb2b04f62e5380d29089040af2f8ba7b066e Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sun, 29 Jul 2012 13:05:46 -0400 Subject: [PATCH] e2fsck: fix code which uniquifies names in directory entries When checking to see whether or not a new name is unique, the code was using the wrong length parameter, which could cause the anti-collision loop for a long time trying to find what it thinks is a unique name. Addresses-Sourceforge-Bug: #3540545 Reported-by: Vitaly Oratovsky Signed-off-by: "Theodore Ts'o" --- e2fsck/rehash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2fsck/rehash.c b/e2fsck/rehash.c index 15993b3..aa7f406 100644 --- a/e2fsck/rehash.c +++ b/e2fsck/rehash.c @@ -370,7 +370,7 @@ static int duplicate_search_and_fix(e2fsck_t ctx, ext2_filsys fs, mutate_name(new_name, &new_len); for (j=0; j < fd->num_array; j++) { if ((i==j) || - ((ent->dir->name_len & 0xFF) != + ((new_len & 0xFF) != (fd->harray[j].dir->name_len & 0xFF)) || (strncmp(new_name, fd->harray[j].dir->name, new_len & 0xFF))) -- 1.8.3.1