[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#663540: finds MSDOS when there is none



Michael Tokarev wrote:
> So a more naive approach at determining the filesystem type is to
> check first 512 bytes, and if MS-DOS signature is found there,
> report that it is MS-DOS.  This is, apparently, what os-prober is
> currently doing.

os-prober does not look at fragile magic numbers in filsystem headers. 
It mounts the actual filesystem, and looks for (fragile) specific
filenames indicating which OS is contained in it.

The particular OS string we see here comes from:

# MS-DOS
if [ -z "$found" ] && item_in_dir -q dos "$2" &&
     [ -d "$2"/"$(item_in_dir dos "$2")" ]; then
        long="MS-DOS 5.x/6.x/Win3.1"
        short=MS-DOS

        found=true
fi

Perhaps your filesystem has a "/dos" directory?
item_in_dir checks for any case, so /DOS or /Dos would also do.

These checks don't try to avoid false positives like a /dos or /windows,
because the code earlier checks that the mounted filesystem is one of ntfs,
vfat, or msdos. To which list was semi-recently added fuse, and I suspect
that might be the root of the problem. 

Colin, if grub-mount is being used, will *every* filesystem appear as fuse?
If so, this and other code has become much more prone to false positives
than it was when it was originally written.

(os-prober 1.42 didn't have this problem I think only because the
above code in it had a typo that made it never match anything!)

-- 
see shy jo

Attachment: signature.asc
Description: Digital signature


Reply to: