Bug 195528 - VFAT Long file names not handled correctly
VFAT Long file names not handled correctly
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: mtools (Show other bugs)
5
All Linux
medium Severity medium
: ---
: ---
Assigned To: Radek Vokal
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-06-15 12:07 EDT by Jonathan Larmour
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version: mtools-3.9.10-2.fc6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-08-09 09:15:39 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jonathan Larmour 2006-06-15 12:07:39 EDT
Description of problem:

The mtools supplied with FC5 is unable to handle long file names correctly. Here
is an excerpt from the output of "mdir c:/progra~1" (I could not do "c:/program
files" because of this very bug):

# mdir c:/progra~1
 Volume in drive C has no label
 Volume Serial Number is 448D-961F
Directory for C:/progra~1

.            <DIR>     2006-06-14  15:56
..           <DIR>     2006-06-14  15:56
COMMON~1     <DIR>     2003-11-18   6:47  Common Files
WINDOW~1     <DIR>     2003-11-18   6:52  Windows NT
MSN          <DIR>     2003-11-18   6:52  msn
MSNGAM~1     <DIR>     2003-11-18   6:52  MSN Gaming ZDne
MESSEN~1     <DIR>     2003-11-18   6:52  Messenger
WINDOW~2     <DIR>     2003-11-18   6:53  Windows MediD Player
ONLINE~1     <DIR>     2003-11-18   6:53  Online ServiDes
COMPLU~1     <DIR>     2003-11-18   6:53  ComPlus ApplDcations
INTERN~1     <DIR>     2003-11-18   6:53  Internet ExpDorer
OUTLOO~1     <DIR>     2003-11-18   6:53  Outlook ExprDss
NETMEE~1     <DIR>     2003-11-18   6:53  NetMeeting
MOVIEM~1     <DIR>     2003-11-18   6:54  Movie Maker
MICROS~1     <DIR>     2003-11-18   6:56  microsoft frDntpage
XEROX        <DIR>     2003-11-18   6:56  xerox
UNINST~1 EXE     40960 2003-09-03  11:46  Uninstall_CMD.exe
CYBERL~1     <DIR>     2003-11-18   7:45  CyberLink
B'SREC~1     <DIR>     2003-11-18   7:47  B's RecorderDGOLD7
VIATEC~1     <DIR>     2003-11-18   8:02  VIA TechnoloDies, Inc
AVRACK       <DIR>     2003-11-18   8:09  AvRack
REALTE~1     <DIR>     2003-11-18   8:09  Realtek SounD Manager
SETUPF~1     <DIR>     2003-11-18   9:15  Setup Files
JAVA         <DIR>     2003-12-14   3:34  Java
HIGHMA~1     <DIR>     2004-02-03  15:01  HighMAT CD W
[etc.]

Note the corruption at the 13th character. The FC5 version is
mtools-3.9.10-1.2.1. If I use an mdir executable copied from an FC3 installation
which is version mtools-3.9.9-9, then everything works correctly, so this is a
regression.

Version-Release number of selected component (if applicable):

mtools-3.9.10-1.2.1

How reproducible:

mdir "c:/" is probably sufficient, where mtools.conf has been set up so that c:
points to a VFAT drive.
Comment 1 Etienne Lorrain 2006-07-25 04:49:59 EDT
 Probably the same bug, it is possible to create a floppy with multiple time
the same long filename on Fedora FC5:

$ mformat a:
$ echo "hello world" > cleandisk.kgz
$ mdir -a a:
 Volume in drive A has no label
 Volume Serial Number is 5327-E0AA
Directory for A:/

No files
                          1 457 664 bytes free

$ mcopy cleandisk.kgz a:
$ mdir a:
 Volume in drive A has no label
 Volume Serial Number is 5327-E0AA
Directory for A:/

CLEAND~1 KGZ        12 2006-07-24  23:17  cleandisk.kg�
        1 file                   12 bytes
                          1 457 152 bytes free

$ mcopy cleandisk.kgz a:
$ mdir a:
 Volume in drive A has no label
 Volume Serial Number is 5327-E0AA
Directory for A:/

CLEAND~1 KGZ        12 2006-07-24  23:17  cleandisk.kg�
CLEAND~2 KGZ        12 2006-07-24  23:17  cleandisk.kg�
        2 files                  24 bytes
                          1 456 640 bytes free

$ mcopy cleandisk.kgz a:
$ mdir a:
 Volume in drive A has no label
 Volume Serial Number is 5327-E0AA
Directory for A:/

CLEAND~1 KGZ        12 2006-07-24  23:17  cleandisk.kg�
CLEAND~2 KGZ        12 2006-07-24  23:17  cleandisk.kg�
CLEAND~3 KGZ        12 2006-07-24  23:18  cleandisk.kg�
        3 files                  36 bytes
                          1 456 128 bytes free

$

Another tool display correctly the long filename "cleandisk.kgz" three times.
It can work correctly when the long filename is shorter.
Comment 2 Jitka Kozana 2006-07-25 07:02:03 EDT
Yes, this is indeed the same bug. 
Comment 3 Jitka Kozana 2006-08-09 07:40:09 EDT
http://people.redhat.com/varekova/mtools/mtools-3.9.10-1.2.1.i386.rpm
http://people.redhat.com/varekova/mtools/mtools-debuginfo-3.9.10-1.2.1.i386.rpm

Please try with these packages. I have a suspicion, that this bug depends on 
the compiler, because with packages from repository I can reproduce this bug, 
but it works for me with the package I compile with on my fc5. 

If this is true, then single rebuilt could fix this.

Thanks for cooperation.
Comment 4 Jonathan Larmour 2006-08-09 08:14:47 EDT
Indeed that works! 

I'm still slightly worried it may be illegal mtools code causing unpredictable
behaviour in the compiler. But I've had a look at the source myself, and haven't
seen anything suspicious in this area in vfat.c (although I could imagine the
inlining of unicode_read() could cause a compiler difficulty).

So yeah, ship it :). Thanks.
Comment 5 Jitka Kozana 2006-08-09 08:39:30 EDT
Even in valgrind it looks much better now. 
Ok, I will rebuild it and push update for fc5.
Comment 6 Jitka Kozana 2006-08-09 09:15:39 EDT
The problem should be fixed in mtools-3.9.10-2.fc6, update for fc5 
(mtools-3.9.10-2.fc5) was pushed.

Again thanks for cooperation. 


Note You need to log in before you can comment on or make changes to this bug.