fstyp: search for file system headers with the largest offset first
fstyp can misidentify a UFS file system as MS-DOS if the device was
repurposed from MS-DOS to UFS via newfs.
This happens for the following reasons:
- the header for MS-DOS begins at offset 0
- the superblock for UFS begins at offset 64k, 8k, 0k, or 256k
- newfs does not clear the area in front of UFS's superblock, leaving the MS-DOS header intact.
- fstyp searches for file system headers alphabetically
To avoid this misidentification, have fstyp search for file system
headers with the largest offset first instead of alphabetically.
The implemented fix was suggested by reporter, Richard M. Kreuter.
PR: 252787
Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D47855