Your message dated Sun, 12 Sep 2010 07:47:07 +0000
with message-id <[email protected]>
and subject line Bug#596329: fixed in dosfstools 3.0.10-1
has caused the Debian Bug report #596329,
regarding dosfsck: does not update LFN when renaming or deleting short filename
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
596329: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=596329
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: dosfstools
Version: 3.0.6-1
Severity: important
Tags: patch
When dosfsck renames a file (automatically or manually), it doesn't
update checksums of corresponding LFN entries.
When dosfsck deletes a file, it leaves corresponding LFN entries not
deleted.
After these actions filesystem still contains errors, so user has to run
dosfsck second time to fix them.
Patch is attached.
-- System Information:
Debian Release: squeeze/sid
APT prefers testing
APT policy: (990, 'testing'), (500, 'stable')
Architecture: i386 (i686)
Kernel: Linux 2.6.33.2 (SMP w/2 CPU cores)
Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages dosfstools depends on:
ii libc6 2.10.1-5 GNU C Library: Shared libraries
dosfstools recommends no packages.
dosfstools suggests no packages.
-- debconf-show failed
commit 3bad011e4c9329befd834218be946240e39b714a
Author: Alexander Korolkov <[email protected]>
Date: Fri Sep 10 14:37:12 2010 +0400
Modify LFN direntries when file is renamed or deleted
diff --git a/src/check.c b/src/check.c
index b16e794..d6c54c1 100644
--- a/src/check.c
+++ b/src/check.c
@@ -311,12 +311,29 @@ static int bad_name(DOS_FILE *file)
return 0;
}
+static void lfn_remove(loff_t from, loff_t to)
+{
+ int i;
+ DIR_ENT empty;
+
+ /* New dir entry is zeroed except first byte, which is set to 0xe5.
+ * This is to avoid that some FAT-reading OSes (not Linux! ;) stop reading
+ * a directory at the first zero entry...
+ */
+ memset( &empty, 0, sizeof(empty) );
+ empty.name[0] = DELETED_FLAG;
+
+ for( ; from < to; from += sizeof(empty) ) {
+ fs_write( from, sizeof(DIR_ENT), &empty );
+ }
+}
static void drop_file(DOS_FS *fs,DOS_FILE *file)
{
unsigned long cluster;
MODIFY(file,name[0],DELETED_FLAG);
+ if (file->lfn) lfn_remove(file->lfn_offset, file->offset);
for (cluster = FSTART(file,fs); cluster > 0 && cluster <
fs->clusters+2; cluster = next_cluster(fs,cluster))
set_owner(fs,cluster,NULL);
@@ -361,6 +378,7 @@ static void auto_rename(DOS_FILE *file)
name,MSDOS_NAME)) break;
if (!walk) {
fs_write(file->offset,MSDOS_NAME,file->dir_ent.name);
+ if (file->lfn) lfn_fix_checksum(file->lfn_offset, file->offset, file->dir_ent.name);
return;
}
number++;
@@ -392,6 +410,7 @@ static void rename_file(DOS_FILE *file)
for (walk = name; *walk == ' ' || *walk == '\t'; walk++);
if (file_cvt(walk,file->dir_ent.name)) {
fs_write(file->offset,MSDOS_NAME,file->dir_ent.name);
+ if (file->lfn) lfn_fix_checksum(file->lfn_offset, file->offset, file->dir_ent.name);
return;
}
}
@@ -862,7 +881,7 @@ static void add_file(DOS_FS *fs,DOS_FILE ***chain,DOS_FILE *parent,
return;
}
new = qalloc(&mem_queue,sizeof(DOS_FILE));
- new->lfn = lfn_get(&de);
+ new->lfn = lfn_get(&de, &new->lfn_offset);
new->offset = offset;
memcpy(&new->dir_ent,&de,sizeof(de));
new->next = new->first = NULL;
diff --git a/src/dosfsck.h b/src/dosfsck.h
index 126056d..25a15ed 100644
--- a/src/dosfsck.h
+++ b/src/dosfsck.h
@@ -155,6 +155,7 @@ typedef struct _dos_file {
DIR_ENT dir_ent;
char *lfn;
loff_t offset;
+ loff_t lfn_offset;
struct _dos_file *parent; /* parent directory */
struct _dos_file *next; /* next entry */
struct _dos_file *first; /* first entry (directory only) */
diff --git a/src/lfn.c b/src/lfn.c
index 97e91dd..dc17f20 100644
--- a/src/lfn.c
+++ b/src/lfn.c
@@ -148,6 +148,18 @@ static void clear_lfn_slots( int start, int end )
}
}
+void lfn_fix_checksum(loff_t from, loff_t to, const char *short_name)
+{
+ int i;
+ __u8 sum;
+ for (sum = 0, i = 0; i < 11; i++)
+ sum = (((sum&1) << 7) | ((sum&0xfe) >> 1)) + short_name[i];
+
+ for( ; from < to; from += sizeof(LFN_ENT) ) {
+ fs_write( from + offsetof(LFN_ENT,alias_checksum), sizeof(sum), &sum );
+ }
+}
+
void lfn_reset( void )
{
if (lfn_unicode)
@@ -374,12 +386,13 @@ void lfn_add_slot( DIR_ENT *de, loff_t dir_offset )
/* This function is always called when de->attr != VFAT_LN_ATTR is found, to
* retrieve the previously constructed LFN. */
-char *lfn_get( DIR_ENT *de )
+char *lfn_get( DIR_ENT *de, loff_t *lfn_offset )
{
char *lfn;
__u8 sum;
int i;
+ *lfn_offset = 0;
if (de->attr == VFAT_LN_ATTR)
die("lfn_get called with LFN directory entry");
@@ -467,6 +480,7 @@ char *lfn_get( DIR_ENT *de )
}
}
+ *lfn_offset = lfn_offsets[0];
lfn = cnv_unicode( lfn_unicode, UNTIL_0, 1 );
lfn_reset();
return( lfn );
diff --git a/src/lfn.h b/src/lfn.h
index 8e8f5a1..2da426d 100644
--- a/src/lfn.h
+++ b/src/lfn.h
@@ -28,9 +28,11 @@ void lfn_reset( void );
void lfn_add_slot( DIR_ENT *de, loff_t dir_offset );
/* Process a dir slot that is a VFAT LFN entry. */
-char *lfn_get( DIR_ENT *de );
+char *lfn_get( DIR_ENT *de, loff_t *lfn_offset );
/* Retrieve the long name for the proper dir entry. */
void lfn_check_orphaned(void);
+void lfn_fix_checksum(loff_t from, loff_t to, const char *short_name);
+
#endif
--- End Message ---
--- Begin Message ---
Source: dosfstools
Source-Version: 3.0.10-1
We believe that the bug you reported is fixed in the latest version of
dosfstools, which is due to be installed in the Debian FTP archive:
dosfstools-dbg_3.0.10-1_i386.deb
to main/d/dosfstools/dosfstools-dbg_3.0.10-1_i386.deb
dosfstools_3.0.10-1.diff.gz
to main/d/dosfstools/dosfstools_3.0.10-1.diff.gz
dosfstools_3.0.10-1.dsc
to main/d/dosfstools/dosfstools_3.0.10-1.dsc
dosfstools_3.0.10-1_i386.deb
to main/d/dosfstools/dosfstools_3.0.10-1_i386.deb
dosfstools_3.0.10.orig.tar.gz
to main/d/dosfstools/dosfstools_3.0.10.orig.tar.gz
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Daniel Baumann <[email protected]> (supplier of updated dosfstools package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Format: 1.8
Date: Sun, 12 Sep 2010 09:39:52 +0200
Source: dosfstools
Binary: dosfstools dosfstools-dbg
Architecture: source i386
Version: 3.0.10-1
Distribution: experimental
Urgency: low
Maintainer: Daniel Baumann <[email protected]>
Changed-By: Daniel Baumann <[email protected]>
Description:
dosfstools - utilities for making and checking MS-DOS FAT filesystems
dosfstools-dbg - utilities for making and checking MS-DOS FAT filesystems
(debug)
Closes: 596327 596329
Changes:
dosfstools (3.0.10-1) experimental; urgency=low
.
* Updating standards version to 3.9.0.
* Merging upstream version 3.0.10:
- Fixes problem in dosfsck with false positives in bad_name() when running
in interactive mode (Closes: #596327).
- Updates LFN when renaming or deleting short filename (Closes: #596329).
* Updating standards version to 3.9.1.
Checksums-Sha1:
b9e740f1964993476c171ac29538a9a5d8b4b0a0 1257 dosfstools_3.0.10-1.dsc
97b2612f5e773be433c897c408a669b9ca198233 81744 dosfstools_3.0.10.orig.tar.gz
6ddcdbef209a32a42e0ad98725157e6662f2a680 8154 dosfstools_3.0.10-1.diff.gz
71cb7a56b960c0cc96bd12ca260ffbedb54dfc63 91118 dosfstools_3.0.10-1_i386.deb
628db00d1f66c9af7541ffb08a988474afee8062 85856 dosfstools-dbg_3.0.10-1_i386.deb
Checksums-Sha256:
2235d97ca61c92c238db7e4257e86551b84557724c0a7d9952f04eee2153177c 1257
dosfstools_3.0.10-1.dsc
89e793ac5cdc1d8fdbab1fd54a77f64b3fa102403d7cd37492484163f1d9e9b5 81744
dosfstools_3.0.10.orig.tar.gz
b41c96e12ebc615fc8120a63304d8fb54a3c4385466a711a816ec9a71bc17021 8154
dosfstools_3.0.10-1.diff.gz
3453f5c069a404032f9f38150d90f55d4cb9383138b576ee4115f4c1b56e7d90 91118
dosfstools_3.0.10-1_i386.deb
bf5bb24eeb7346c73ef7a1815485f29ad2605579eaa40ee670e1e2f318623c86 85856
dosfstools-dbg_3.0.10-1_i386.deb
Files:
33382d4f1e6da7328ff2c01de0a13429 1257 otherosfs optional
dosfstools_3.0.10-1.dsc
6cf73f9bdde8ffa6b81d33423ddbe490 81744 otherosfs optional
dosfstools_3.0.10.orig.tar.gz
4e13c5945199b9a025a7ffd85888946a 8154 otherosfs optional
dosfstools_3.0.10-1.diff.gz
d7eaec93f386a5936154fae277db44a5 91118 otherosfs optional
dosfstools_3.0.10-1_i386.deb
929a45abc26f58804e24567ebf241a04 85856 debug extra
dosfstools-dbg_3.0.10-1_i386.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
iEYEARECAAYFAkyMhGUACgkQ+C5cwEsrK56ElgCgmx6ov51J3gT1rqvBeKQt+tCp
hHAAoKJanNkXFhOVYNits1gwprdNdDZN
=pPYX
-----END PGP SIGNATURE-----
--- End Message ---