Package: dosfstools Version: 3.0.9-1 Severity: important Tags: upstream patch
When there are unused cluster chains on a FAT32 filesystem dosfsck is unable to create a unique filename for them and dies. This is because the FAT32 specific code to create a unique filename always creates "\000\000\000\000FSCK.RES" as filename. The attached patch fixes this by using the way the non-FAT32-specific code generates unique filenames. -- System Information: Debian Release: 6.0.2 APT prefers stable APT policy: (990, 'stable') Architecture: i386 (i686) Kernel: Linux 2.6.32-5-686 (SMP w/2 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages dosfstools depends on: ii libc6 2.11.2-10 Embedded GNU C Library: Shared lib dosfstools recommends no packages. dosfstools suggests no packages. -- no debconf information
diff --git a/src/check.c b/src/check.c index 3f175b0..72ee885 100644 --- a/src/check.c +++ b/src/check.c @@ -129,10 +129,7 @@ loff_t alloc_rootdir_entry(DOS_FS * fs, DIR_ENT * de, const char *pattern) } memset(de, 0, sizeof(DIR_ENT)); while (1) { - char expanded[12]; - sprintf(expanded, pattern, curr_num); - memcpy(de->name + 4, expanded, 4); - memcpy(de->ext, expanded + 4, 3); + sprintf(de->name, pattern, curr_num); clu_num = fs->root_cluster; i = 0; offset2 = cluster_start(fs, clu_num);