diff -Nru dosfstools-3.0.26/ChangeLog dosfstools-3.0.27/ChangeLog --- dosfstools-3.0.26/ChangeLog 2014-03-07 17:39:46.000000000 +0000 +++ dosfstools-3.0.27/ChangeLog 2014-11-12 00:10:37.000000000 +0000 @@ -1,4 +1,77 @@ -commit 6893c45 (HEAD, origin/master, origin/HEAD, master) +commit e2c8f06 (HEAD, origin/master, master) +Author: Andreas Bombe +Date: Wed Nov 12 00:22:17 2014 +0100 + + fsck.fat: Don't print version string every time -v is encountered + + Remove the printing of the version string every time -v is seen during + command line parsing in fsck.fat. The version string is printed anyway + before opening the filesystem device/image. + + Signed-off-by: Andreas Bombe + +commit 82076b6 +Author: Andreas Bombe +Date: Tue Nov 11 23:25:30 2014 +0100 + + Fix attempt to rename root dir in fsck due to uninitialized fields + + When add_file() is called with offset 0, it will construct a DIR_ENT for + the root directory instead of reading the contents from the filesystem. + It did not initialize the whole DIR_ENT on the stack, just select + values. + + In particular, the lcase field was left with an undefined value. If + that value happened to include the FAT_NO_83NAME bit, the "neither long + nor short file name" check in bad_name() added in 3.0.26 would trigger + and cause an attempt to rename the entry (which is not possible). + Example run: + + $ /sbin/fsck.fat -y bad.img + fsck.fat 3.0.26 (2014-03-07) + / + Bad short file name (). + Auto-renaming it. + Renamed to + bad.img: 14 files, 19388/403266 clusters + + This commit changes the initialization zeroize the whole struct before + setting individual fields. Thanks to AlexisM, who found the cause and + posted a patch on the Debian bug http://bugs.debian.org/764992 . + + Signed-off-by: Andreas Bombe + +commit c24ecb6 +Author: Andreas Bombe +Date: Tue Nov 11 22:49:50 2014 +0100 + + Support long file names in volume labeling code + + The code to find the volume label directory entry in find_volume_de() + did not consider long file names so far. Directory entries that make up + long file names have four attribute bits set, including the "volume" + bit. + + This caused the code to mistake a directory entry that is part of a + long file name as the volume name entry. If such an entry is found + first, fatlabel would print garbage when asked to display the label and + mangle the long file name when asked to set it. The latter would lead + to the loss of the long file name and require a fsck to clean up. + + Change so that the set of attributes equal that of LFN entries will no + langer match as a volume label. + + Signed-off-by: Andreas Bombe + +commit 1646f6e (tag: v3.0.26) +Author: Daniel Baumann +Date: Fri Mar 7 18:40:13 2014 +0100 + + Releasing version 3.0.26. + + Signed-off-by: Daniel Baumann + +commit 6893c45 Author: Dir Lotter Date: Fri Mar 7 18:25:39 2014 +0100 diff -Nru dosfstools-3.0.26/debian/changelog dosfstools-3.0.27/debian/changelog --- dosfstools-3.0.26/debian/changelog 2014-11-11 20:31:38.000000000 +0000 +++ dosfstools-3.0.27/debian/changelog 2014-11-12 02:34:37.000000000 +0000 @@ -1,3 +1,18 @@ +dosfstools (3.0.27-1) unstable; urgency=medium + + * New upstream version 3.0.27 + - fixes fatlabel mangling long file names in root directory + (Closes: #768909) + - fixes spurious uncorrectable empty file name error reported by + fsck.fat (thanks to AlexisM for finding the cause) + (Closes: #764992) + * New maintainer + * New upstream, change debian/watch and fields in debian/control and + debian/copyright accordingly + * Remove 0001-LFN-is-no-volume-entry.patch, already fixed in upstream + + -- Andreas Bombe Wed, 12 Nov 2014 03:21:26 +0100 + dosfstools (3.0.26-5) unstable; urgency=medium * QA upload diff -Nru dosfstools-3.0.26/debian/control dosfstools-3.0.27/debian/control --- dosfstools-3.0.26/debian/control 2014-11-11 20:17:32.000000000 +0000 +++ dosfstools-3.0.27/debian/control 2014-11-12 02:18:31.000000000 +0000 @@ -1,10 +1,10 @@ Source: dosfstools Section: otherosfs Priority: optional -Maintainer: Debian QA Group +Maintainer: Andreas Bombe Build-Depends: debhelper (>= 9) Standards-Version: 3.9.6 -Homepage: http://daniel-baumann.ch/software/dosfstools/ +Homepage: https://github.com/dosfstools/dosfstools Vcs-Browser: http://anonscm.debian.org/cgit/collab-maint/dosfstools.git/ Vcs-Git: git://anonscm.debian.org/collab-maint/dosfstools.git diff -Nru dosfstools-3.0.26/debian/copyright dosfstools-3.0.27/debian/copyright --- dosfstools-3.0.26/debian/copyright 2014-11-11 20:17:32.000000000 +0000 +++ dosfstools-3.0.27/debian/copyright 2014-11-12 01:37:52.000000000 +0000 @@ -1,7 +1,7 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: dosfstools -Upstream-Contact: Daniel Baumann -Source: http://daniel-baumann.ch/files/software/dosfstools/ +Upstream-Contact: Andreas Bombe +Source: https://github.com/dosfstools/dosfstools Files: * Copyright: 1991 Linus Torvalds diff -Nru dosfstools-3.0.26/debian/patches/0001-LFN-is-no-volume-entry.patch dosfstools-3.0.27/debian/patches/0001-LFN-is-no-volume-entry.patch --- dosfstools-3.0.26/debian/patches/0001-LFN-is-no-volume-entry.patch 2014-11-11 20:17:32.000000000 +0000 +++ dosfstools-3.0.27/debian/patches/0001-LFN-is-no-volume-entry.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -From c3c04f47cc2452de2c47617821a252b59b7de4b8 Mon Sep 17 00:00:00 2001 -From: "Bernhard R. Link" -Date: Tue, 11 Nov 2014 20:37:28 +0100 -Subject: LFN is no volume entry - -A readonly, hidden, system volume entry is no volume entry but a LFN -entry, so do not mix those two up (otherwise fatlabel destroys long -filenames). ---- - src/boot.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/boot.c b/src/boot.c -index 45fb3c8..bbd7d04 100644 ---- a/src/boot.c -+++ b/src/boot.c -@@ -504,7 +504,7 @@ loff_t find_volume_de(DOS_FS * fs, DIR_ENT * de) - offset = cluster_start(fs, cluster); - for (i = 0; i * sizeof(DIR_ENT) < fs->cluster_size; i++) { - fs_read(offset, sizeof(DIR_ENT), de); -- if (de->attr & ATTR_VOLUME) -+ if (de->attr & ATTR_VOLUME && de->attr != VFAT_LN_ATTR) - return offset; - offset += sizeof(DIR_ENT); - } -@@ -513,7 +513,7 @@ loff_t find_volume_de(DOS_FS * fs, DIR_ENT * de) - for (i = 0; i < fs->root_entries; i++) { - offset = fs->root_start + i * sizeof(DIR_ENT); - fs_read(offset, sizeof(DIR_ENT), de); -- if (de->attr & ATTR_VOLUME) -+ if (de->attr & ATTR_VOLUME && de->attr != VFAT_LN_ATTR) - return offset; - } - } diff -Nru dosfstools-3.0.26/debian/patches/series dosfstools-3.0.27/debian/patches/series --- dosfstools-3.0.26/debian/patches/series 2014-11-11 20:17:32.000000000 +0000 +++ dosfstools-3.0.27/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -0001-LFN-is-no-volume-entry.patch diff -Nru dosfstools-3.0.26/debian/watch dosfstools-3.0.27/debian/watch --- dosfstools-3.0.26/debian/watch 2014-11-11 20:17:32.000000000 +0000 +++ dosfstools-3.0.27/debian/watch 2014-11-12 02:17:55.000000000 +0000 @@ -1,3 +1,2 @@ version=3 -http://daniel-baumann.ch/software/dosfstools/ .*/dosfstools-(\d\S+)\.tar\.(?:bz2|gz|xz) - +https://github.com/dosfstools/dosfstools/releases .*/v\d\S*/dosfstools-(\d\S*)\.tar\.(?:xz|gz|bz2) diff -Nru dosfstools-3.0.26/manpages/de/fatlabel.de.8 dosfstools-3.0.27/manpages/de/fatlabel.de.8 --- dosfstools-3.0.26/manpages/de/fatlabel.de.8 2014-03-07 17:39:35.000000000 +0000 +++ dosfstools-3.0.27/manpages/de/fatlabel.de.8 2014-11-12 00:10:37.000000000 +0000 @@ -24,7 +24,7 @@ .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* -.TH FATLABEL 8 2014\-03\-07 3.0.26 dosfstools +.TH FATLABEL 8 2014\-11\-12 3.0.27 dosfstools .SH NAME \fBfatlabel\fP \- set or get MS\-DOS filesystem label diff -Nru dosfstools-3.0.26/manpages/de/fsck.fat.de.8 dosfstools-3.0.27/manpages/de/fsck.fat.de.8 --- dosfstools-3.0.26/manpages/de/fsck.fat.de.8 2014-03-07 17:39:35.000000000 +0000 +++ dosfstools-3.0.27/manpages/de/fsck.fat.de.8 2014-11-12 00:10:37.000000000 +0000 @@ -24,7 +24,7 @@ .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* -.TH FSCK.FAT 8 2014\-03\-07 3.0.26 dosfstools +.TH FSCK.FAT 8 2014\-11\-12 3.0.27 dosfstools .SH NAME \fBfsck.fat\fP \- check and repair MS\-DOS filesystems diff -Nru dosfstools-3.0.26/manpages/de/mkfs.fat.de.8 dosfstools-3.0.27/manpages/de/mkfs.fat.de.8 --- dosfstools-3.0.26/manpages/de/mkfs.fat.de.8 2014-03-07 17:39:35.000000000 +0000 +++ dosfstools-3.0.27/manpages/de/mkfs.fat.de.8 2014-11-12 00:10:37.000000000 +0000 @@ -24,7 +24,7 @@ .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* -.TH MKFS.FAT 8 2014\-03\-07 3.0.26 dosfstools +.TH MKFS.FAT 8 2014\-11\-12 3.0.27 dosfstools .SH NAME \fBmkfs.fat\fP \- create an MS\-DOS filesystem under Linux diff -Nru dosfstools-3.0.26/manpages/en/fatlabel.8 dosfstools-3.0.27/manpages/en/fatlabel.8 --- dosfstools-3.0.26/manpages/en/fatlabel.8 2014-03-07 17:39:34.000000000 +0000 +++ dosfstools-3.0.27/manpages/en/fatlabel.8 2014-11-12 00:10:37.000000000 +0000 @@ -19,7 +19,7 @@ .\" can be found in /usr/share/common-licenses/GPL-3 file. .\" .\" -.TH FATLABEL 8 2014\-03\-07 3.0.26 "dosfstools" +.TH FATLABEL 8 2014\-11\-12 3.0.27 "dosfstools" .SH NAME \fBfatlabel\fR \- set or get MS\-DOS filesystem label diff -Nru dosfstools-3.0.26/manpages/en/fsck.fat.8 dosfstools-3.0.27/manpages/en/fsck.fat.8 --- dosfstools-3.0.26/manpages/en/fsck.fat.8 2014-03-07 17:39:34.000000000 +0000 +++ dosfstools-3.0.27/manpages/en/fsck.fat.8 2014-11-12 00:10:37.000000000 +0000 @@ -19,7 +19,7 @@ .\" can be found in /usr/share/common-licenses/GPL-3 file. .\" .\" -.TH FSCK.FAT 8 2014\-03\-07 3.0.26 "dosfstools" +.TH FSCK.FAT 8 2014\-11\-12 3.0.27 "dosfstools" .SH NAME \fBfsck.fat\fR \- check and repair MS\-DOS filesystems diff -Nru dosfstools-3.0.26/manpages/en/mkfs.fat.8 dosfstools-3.0.27/manpages/en/mkfs.fat.8 --- dosfstools-3.0.26/manpages/en/mkfs.fat.8 2014-03-07 17:39:34.000000000 +0000 +++ dosfstools-3.0.27/manpages/en/mkfs.fat.8 2014-11-12 00:10:37.000000000 +0000 @@ -19,7 +19,7 @@ .\" can be found in /usr/share/common-licenses/GPL-3 file. .\" .\" -.TH MKFS.FAT 8 2014\-03\-07 3.0.26 "dosfstools" +.TH MKFS.FAT 8 2014\-11\-12 3.0.27 "dosfstools" .SH NAME \fBmkfs.fat\fR \- create an MS-DOS filesystem under Linux diff -Nru dosfstools-3.0.26/manpages/po/de/fatlabel.8.po dosfstools-3.0.27/manpages/po/de/fatlabel.8.po --- dosfstools-3.0.26/manpages/po/de/fatlabel.8.po 2014-03-07 17:39:35.000000000 +0000 +++ dosfstools-3.0.27/manpages/po/de/fatlabel.8.po 2014-11-12 00:10:37.000000000 +0000 @@ -3,7 +3,7 @@ msgid "" msgstr "" "Project-Id-Version: dosfstools VERSION\n" -"POT-Creation-Date: 2014-03-07 18:39+0100\n" +"POT-Creation-Date: 2014-11-12 00:52+0100\n" "PO-Revision-Date: 2013-06-06 09:34+0300\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -22,13 +22,13 @@ #. type: TH #: en/fatlabel.8:22 en/fsck.fat.8:22 en/mkfs.fat.8:22 #, no-wrap -msgid "2014-03-07" +msgid "2014-11-12" msgstr "" #. type: TH #: en/fatlabel.8:22 en/fsck.fat.8:22 en/mkfs.fat.8:22 #, no-wrap -msgid "3.0.26" +msgid "3.0.27" msgstr "" #. type: TH diff -Nru dosfstools-3.0.26/manpages/po/de/fsck.fat.8.po dosfstools-3.0.27/manpages/po/de/fsck.fat.8.po --- dosfstools-3.0.26/manpages/po/de/fsck.fat.8.po 2014-03-07 17:39:35.000000000 +0000 +++ dosfstools-3.0.27/manpages/po/de/fsck.fat.8.po 2014-11-12 00:10:37.000000000 +0000 @@ -3,7 +3,7 @@ msgid "" msgstr "" "Project-Id-Version: dosfstools VERSION\n" -"POT-Creation-Date: 2014-03-07 18:39+0100\n" +"POT-Creation-Date: 2014-11-12 00:52+0100\n" "PO-Revision-Date: 2013-06-06 09:34+0300\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -16,13 +16,13 @@ #. type: TH #: en/fatlabel.8:22 en/fsck.fat.8:22 en/mkfs.fat.8:22 #, no-wrap -msgid "2014-03-07" +msgid "2014-11-12" msgstr "" #. type: TH #: en/fatlabel.8:22 en/fsck.fat.8:22 en/mkfs.fat.8:22 #, no-wrap -msgid "3.0.26" +msgid "3.0.27" msgstr "" #. type: TH diff -Nru dosfstools-3.0.26/manpages/po/de/mkfs.fat.8.po dosfstools-3.0.27/manpages/po/de/mkfs.fat.8.po --- dosfstools-3.0.26/manpages/po/de/mkfs.fat.8.po 2014-03-07 17:39:35.000000000 +0000 +++ dosfstools-3.0.27/manpages/po/de/mkfs.fat.8.po 2014-11-12 00:10:37.000000000 +0000 @@ -3,7 +3,7 @@ msgid "" msgstr "" "Project-Id-Version: dosfstools VERSION\n" -"POT-Creation-Date: 2014-03-07 18:39+0100\n" +"POT-Creation-Date: 2014-11-12 00:52+0100\n" "PO-Revision-Date: 2013-06-06 09:34+0300\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -16,13 +16,13 @@ #. type: TH #: en/fatlabel.8:22 en/fsck.fat.8:22 en/mkfs.fat.8:22 #, no-wrap -msgid "2014-03-07" +msgid "2014-11-12" msgstr "" #. type: TH #: en/fatlabel.8:22 en/fsck.fat.8:22 en/mkfs.fat.8:22 #, no-wrap -msgid "3.0.26" +msgid "3.0.27" msgstr "" #. type: TH diff -Nru dosfstools-3.0.26/manpages/pot/fatlabel.8.pot dosfstools-3.0.27/manpages/pot/fatlabel.8.pot --- dosfstools-3.0.26/manpages/pot/fatlabel.8.pot 2014-03-07 17:39:35.000000000 +0000 +++ dosfstools-3.0.27/manpages/pot/fatlabel.8.pot 2014-11-12 00:10:37.000000000 +0000 @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: dosfstools VERSION\n" -"POT-Creation-Date: 2014-03-07 18:39+0100\n" +"POT-Creation-Date: 2014-11-12 00:52+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -25,13 +25,13 @@ #. type: TH #: en/fatlabel.8:22 en/fsck.fat.8:22 en/mkfs.fat.8:22 #, no-wrap -msgid "2014-03-07" +msgid "2014-11-12" msgstr "" #. type: TH #: en/fatlabel.8:22 en/fsck.fat.8:22 en/mkfs.fat.8:22 #, no-wrap -msgid "3.0.26" +msgid "3.0.27" msgstr "" #. type: TH diff -Nru dosfstools-3.0.26/manpages/pot/fsck.fat.8.pot dosfstools-3.0.27/manpages/pot/fsck.fat.8.pot --- dosfstools-3.0.26/manpages/pot/fsck.fat.8.pot 2014-03-07 17:39:35.000000000 +0000 +++ dosfstools-3.0.27/manpages/pot/fsck.fat.8.pot 2014-11-12 00:10:37.000000000 +0000 @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: dosfstools VERSION\n" -"POT-Creation-Date: 2014-03-07 18:39+0100\n" +"POT-Creation-Date: 2014-11-12 00:52+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -19,13 +19,13 @@ #. type: TH #: en/fatlabel.8:22 en/fsck.fat.8:22 en/mkfs.fat.8:22 #, no-wrap -msgid "2014-03-07" +msgid "2014-11-12" msgstr "" #. type: TH #: en/fatlabel.8:22 en/fsck.fat.8:22 en/mkfs.fat.8:22 #, no-wrap -msgid "3.0.26" +msgid "3.0.27" msgstr "" #. type: TH diff -Nru dosfstools-3.0.26/manpages/pot/mkfs.fat.8.pot dosfstools-3.0.27/manpages/pot/mkfs.fat.8.pot --- dosfstools-3.0.26/manpages/pot/mkfs.fat.8.pot 2014-03-07 17:39:35.000000000 +0000 +++ dosfstools-3.0.27/manpages/pot/mkfs.fat.8.pot 2014-11-12 00:10:37.000000000 +0000 @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: dosfstools VERSION\n" -"POT-Creation-Date: 2014-03-07 18:39+0100\n" +"POT-Creation-Date: 2014-11-12 00:52+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -19,13 +19,13 @@ #. type: TH #: en/fatlabel.8:22 en/fsck.fat.8:22 en/mkfs.fat.8:22 #, no-wrap -msgid "2014-03-07" +msgid "2014-11-12" msgstr "" #. type: TH #: en/fatlabel.8:22 en/fsck.fat.8:22 en/mkfs.fat.8:22 #, no-wrap -msgid "3.0.26" +msgid "3.0.27" msgstr "" #. type: TH diff -Nru dosfstools-3.0.26/src/boot.c dosfstools-3.0.27/src/boot.c --- dosfstools-3.0.26/src/boot.c 2014-01-17 06:06:54.000000000 +0000 +++ dosfstools-3.0.27/src/boot.c 2014-11-12 00:10:37.000000000 +0000 @@ -504,7 +504,7 @@ offset = cluster_start(fs, cluster); for (i = 0; i * sizeof(DIR_ENT) < fs->cluster_size; i++) { fs_read(offset, sizeof(DIR_ENT), de); - if (de->attr & ATTR_VOLUME) + if (de->attr != VFAT_LN_ATTR && de->attr & ATTR_VOLUME) return offset; offset += sizeof(DIR_ENT); } @@ -513,7 +513,7 @@ for (i = 0; i < fs->root_entries; i++) { offset = fs->root_start + i * sizeof(DIR_ENT); fs_read(offset, sizeof(DIR_ENT), de); - if (de->attr & ATTR_VOLUME) + if (de->attr != VFAT_LN_ATTR && de->attr & ATTR_VOLUME) return offset; } } diff -Nru dosfstools-3.0.26/src/check.c dosfstools-3.0.27/src/check.c --- dosfstools-3.0.26/src/check.c 2014-03-07 17:35:11.000000000 +0000 +++ dosfstools-3.0.27/src/check.c 2014-11-12 00:10:37.000000000 +0000 @@ -959,9 +959,9 @@ fs_read(offset, sizeof(DIR_ENT), &de); else { /* Construct a DIR_ENT for the root directory */ + memset(&de, 0, sizeof de); memcpy(de.name, " ", MSDOS_NAME); de.attr = ATTR_DIR; - de.size = de.time = de.date = 0; de.start = htole16(fs->root_cluster & 0xffff); de.starthi = htole16((fs->root_cluster >> 16) & 0xffff); } diff -Nru dosfstools-3.0.26/src/fsck.fat.c dosfstools-3.0.27/src/fsck.fat.c --- dosfstools-3.0.26/src/fsck.fat.c 2014-01-17 06:07:12.000000000 +0000 +++ dosfstools-3.0.27/src/fsck.fat.c 2014-11-12 00:10:37.000000000 +0000 @@ -157,7 +157,6 @@ break; case 'v': verbose = 1; - printf("fsck.fat " VERSION " (" VERSION_DATE ")\n"); break; case 'V': verify = 1; diff -Nru dosfstools-3.0.26/src/version.h dosfstools-3.0.27/src/version.h --- dosfstools-3.0.26/src/version.h 2014-03-07 17:40:00.000000000 +0000 +++ dosfstools-3.0.27/src/version.h 2014-11-12 00:10:37.000000000 +0000 @@ -23,7 +23,7 @@ #ifndef _version_h #define _version_h -#define VERSION "3.0.26" -#define VERSION_DATE "2014-03-07" +#define VERSION "3.0.27" +#define VERSION_DATE "2014-11-12" #endif diff -Nru dosfstools-3.0.26/VERSION dosfstools-3.0.27/VERSION --- dosfstools-3.0.26/VERSION 2014-03-07 17:39:32.000000000 +0000 +++ dosfstools-3.0.27/VERSION 2014-11-12 00:10:37.000000000 +0000 @@ -1 +1 @@ -3.0.26 +3.0.27