"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "ChangeLog" between
dosfstools-4.1.tar.gz and dosfstools-4.2.tar.gz

About: dosfstools are utilities to create, check and label (MS-DOS) FAT filesystems.

ChangeLog  (dosfstools-4.1):ChangeLog  (dosfstools-4.2)
commit eb9111e
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Jan 31 13:26:03 2021 +0100
Add missing files into distribution tarball
commit 52518ae
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Jan 31 03:03:39 2021 +0100
mkfs.fat: Read geom_start from sysfs
HDIO_GETGEO which provides start member is not supported for loop block
devices. Also start member is only unsigned long so it cannot be used for
bigger disks. So instead read geom_start from sysfs and store it into long
long type to prevent overflow.
commit ed2062b
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Fri Jan 29 16:40:56 2021 +0100
Autogenerate release date in manpages
commit fca589b
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Fri Jan 29 16:40:20 2021 +0100
Update (C) and maintainers
commit c251412
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Fri Jan 29 16:33:41 2021 +0100
Add TODO comments for checking integer overflow
commit 73003cd
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sat Jan 19 13:28:45 2019 +0100
Replace uint64_t type by unsigned long long type
commit c56ef3d
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sat Jan 19 13:22:05 2019 +0100
Remove useless casting to uint64_t or long long in check_file()
Value of clusters * fs->cluster_size is file size and it always fits into
32bit value. So use just unsigned int type for it.
commit 2e597d6
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sat Jan 19 13:20:16 2019 +0100
Check that file size is not larger than maximal possible size
commit 53d04ff
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sat Jan 19 13:15:25 2019 +0100
Change fat_size type from off_t to unsigned int
Value in fat_size is result of multiplication of two 16bit unsigned values,
therefore it fits into unsigned int.
commit 2f6d8cf
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Fri Jan 29 02:10:58 2021 +0100
testsuite: Add reference images of fsck result tests
This ensures that fsck does not change its behavior and repair filesystems
in the same way. Repaired reference images were generated by dosfstools 4.1
to ensure that they are still same.
commit 5265c64
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Fri Jan 29 02:10:22 2021 +0100
testsuite: Add fsck tests for fat labels
commit 2260f80
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Jan 3 23:22:42 2021 +0100
fsck.fat: Check and fix label
Checks the volume label from the root directory entry that is valid and
matches the label stored in boot sector.
Add new command line option -U which consider lowercase volume label as
invalid and allows only uppercase labels. By default lowercase volume
labels are allowed.
commit 77c3de9
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Tue Jan 14 00:58:21 2020 +0100
Simplify usage of validate_volume_label() function
Use new function dos_string_to_wchar_string() for converting label from DOS
OEM code page to wchar_t* string. Therefore caller does not have to supply
label in both DOS OEM encoding and locale independent wchar_t* string.
commit f89b42d
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Aug 19 18:54:07 2018 +0200
Update warning message about lowercase labels
They are working fine on MS-DOS and Windows systems.
commit 5bbae89
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Wed Aug 15 16:35:48 2018 +0200
charconv: Add functions for converting DOS strings to locale independent wch
ar_t strings
Use iconv library for it. And as a fallback use internal cp850_table.
commit 3a3c1d3
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Thu Jan 28 10:39:36 2021 +0100
testsuite: Update mkfs-fat32_2_res_sects.xxd test as it is now not aligned d
ue to -a
commit 289fa53
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Wed Jan 27 02:03:39 2021 +0100
manpages: End every sentence by a newline
commit 61390f3
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Wed Jan 27 02:01:48 2021 +0100
mkfs.fat: Do not align number of sectors when -a was specified
commit 7deb97d
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Wed Jan 27 02:00:33 2021 +0100
mkfs.fat: Document that -r and -R specify minimal number (and not exact)
commit 4e06c33
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Wed Jan 27 01:58:38 2021 +0100
fsck: Move check_dirty_bits() from boot.c to check.c
commit 738ee98
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Jan 17 16:15:41 2021 +0100
fatlabel: Print warnings on stderr
Fixes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=803391
commit e62e52c
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Jan 17 19:45:26 2021 +0100
fatlabel: Do not call parts of fsck repair procedure
This change adds a new parameter for read_fat() function to indicate a mode
in which filesystem is doing to be used: Read-only, Read-write or Repair.
fsck.fat uses Repair mode and fatlabel either Read-only or Read-write
(which depends on fatlabel operation).
fatlabel cannot repair broken FAT filesystem like fsck.fat. So when trying
to modify FAT label on currupted FAT filesystem rather throw an fatal error
indicating that running fsck.fat is needed.
When fatlabel was called to just read existing FAT label, first FAT table
is corrupted and second FAT table is clean then use second FAT table.
This change also ensures that fatlabel does not print fsck/repair messages
on stdout, which should be used only for printing FAT label.
commit b8c8531
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Jan 17 22:47:18 2021 +0100
testsuite: Add tests for DOS Clean Shutdown bit
commit 82c2111
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Jan 17 20:20:39 2021 +0100
testsuite: Add fsck tests with broken first FAT cluster
Extend also test-fsck script to read additional arguments from .args file.
commit 82e9730
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Jan 17 19:34:10 2021 +0100
fsck.fat: Add code for fixing first FAT cluster
This patch tries to fix infamous fsck.fat error:
Both FATs appear to be corrupt. Giving up.
It just fill again FAT media type and sets other bits to one as it is
required by FAT specification. Similar thing is doing also Windows chkdsk
tool.
In the most cases corrupted first FAT cluster is fatal error which
indicates totally corrupted filesystem impossible to repair. So fixing
first FAT cluster is not done by fsck.fat automatically and needs to be
enabled by a new -F option, which forces usage of specified FAT table
(either clean or corrupted).
commit e579a7d
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sat Nov 17 01:12:52 2018 +0100
mkfs.fat: Allow to specify disk geometry via new -g option
commit 9443732
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Fri Jan 8 11:49:27 2021 +0100
testsuite: Add mkfs test for 600MB large 4K disk
commit 3300839
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Oct 14 16:19:51 2018 +0200
mkfs.fat: Do not show verbose messages not relevant to selected FAT size
commit 43f0c4e
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Fri Aug 17 14:26:30 2018 +0200
mkfs.fat: Fix text of verbose messages
commit c01f78b
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Tue Aug 14 15:48:50 2018 +0200
mkfs.fat: Fix limits for number of clusters
According to Microsoft FAT specification (fatgen103.doc) disk with at least
4085 clusters and less then 65525 clusters is FAT16.
But Microsoft Windows FAT driver fastfat.sys detects disk with less then
4087 clusters as FAT12. Linux FAT drivers msdos.ko and vfat.ko detect disk
with 4085 clusters (or more) as FAT16, therefore for compatibility reasons
with both systems disallow formatting disks to 4085 or 4086 clusters.
So after this change mkfs.fat disallow to create a FAT16 which would be
misinterpreted as FAT12. Next run of cluster detection algorithm would
choose higher cluster size which decrease number of clusters.
According to specification, FAT32 is detected by at least 65525 clusters,
but Microsoft Windows FAT driver fastfat.sys, Linux FAT drivers msdos.ko
and vfat.ko detect disk as FAT32 when Sectors Per FAT (fat_length) is set
to zero.
commit 404ead8
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sat Aug 11 20:34:08 2018 +0200
mkfs.fat: Fix calculation of FAT32 cluster size on non 512 bytes sector disk
s
Previous FAT32 calculation worked correctly only for disks with 512 byte
sectors. New calculation formula is generalized variant of previous one,
but to be sector size independent.
commit e6d2fc7
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Wed Aug 15 15:11:30 2018 +0200
mkfs.fat: Fix printing number of sectors
It is unsigned 32bit number therefore use %u format.
commit b29eb5b
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Wed Aug 15 15:15:06 2018 +0200
mkfs.fat: Align total number of sectors to be multiple of sectors per track
This requirement is needed by DOS systems and also by Linux mtools project.
Without proper alignment, mtools applications refuse to work on such
filesystem.
commit 8c81232
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Jan 10 22:29:48 2021 +0100
testsuite: Add referenceFAT32mbr test data to dist_check_DATA
commit 468aad7
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Jan 10 22:16:49 2021 +0100
manpages: Escape dot in fsck.fat manpage at the beginning of the line
commit 9069ba0
Author: felix <felix.von.s@posteo.de>
Date: Mon Apr 2 22:43:46 2018 +0200
fsck.fat: properly check for valid "." and ".." entries
This change makes fsck.fat check whether "." and ".." entries exist in
all non-root directories as the two very first. If those entries are
occupied by some other file, fsck.fat will offer to move them to some
later slot. "." and ".." entries found in any other slots are treated
as ordinary bad-shortname entries. The test case for this situation has
been enabled and verified to perform as expected.
The function drop_file() was also modified so that it does not mark
dropped file clusters as free. This was necessary because otherwise
dropping too-late "." and ".." entries would delete their containing
directory. If deleted entries' clusters are truly no longer used, they
shall be picked up by a later reclamation stage.
Additionally, subdirs() and check_file() were modified not to check
unused directory entries.
Additionally-fixed-by: Dave Odell <dmo2118@gmail.com>
commit 512141a
Author: C. Masloch <pushbx@ulukai.org>
Date: Sat Oct 24 13:53:08 2020 +0200
fsck.fat: preserve info sector reserved fields
This allows the FSIBOOT stage of lDOS boot32.asm to remain
in the FSINFO sector even when the info entries are reset.
I reviewed several sources to determine whether we are in the right to
assume that the reserved 480 bytes used by FSIBOOT should be preserved
by drivers updating the FSINFO entry fields.
Quoting the document "Microsoft Extensible Firmware Initiative - FAT32
File System Specification - FAT: General Overview of On-Disk Format -
Version 1.03, December 6, 2000" on these bytes:
> [Name] FSI_Reserved1
>
> [Offset (byte)] 4
>
> [Size (bytes)] 480
>
> [Description] This field is currently reserved for future expansion.
> FAT32 format code should always initialize all bytes of this field
> to 0. Bytes in this field must currently never be used.
This specifically states that "FAT32 format code" should zero-initialise
this space. It does not specify that a driver should or should not reset
this space.
The FreeDOS kernel uses a struct [1] that does not include the space
used by FSIBOOT. Its driver's implementation [2] does preserve the
FSIBOOT area. I have verified this in dosemu2; if the FreeDOS kernel
updates the FSINFO sector it preserves this area.
The Linux kernel uses a struct with a "reserved1" member [3] which is
commented as being "Nothing as far as I can tell". If I am reading the
source correctly, its driver [4] also preserves this area when updating
the FSINFO entries.
Testing on MS-DOS version 7.10 (as bundled with MS Windows 98 SE) I
determined that it also preserves the area when updating the FSINFO entries.
The free software RxDOS/lDOS boot loader for FAT32 that I wrote uses
this reserved area to store its FSIBOOT stage, essentially an extension
to the primary boot sector loader. To avoid clashing with Microsoft
loaders which may use some of the reserved sectors, the large reserved
area in the FSINFO sector was selected to hold this stage (if sector
size is <= 512 bytes). If valid, the area starts with a signature [5]
the first four bytes of which form the letters "FSIB"; the subsequent
four bytes specify a protocol version. For example, the current
(non-experimental) version is "FSIBOOT3" [6].
If there is no FSINFO sector or the FSIBOOT signature does not match the
one expected, then the 'I' error code letter ("i"nvalid FS"I"BOOT) is
displayed and the loading is aborted [7]. Prior to this patch, if the
FSINFO entries were invalid (any of the three FSINFO signatures don't
match) and then fsck.fat was used and instructed to correct this, it
would reset the space used by FSIBOOT, rendering the image unbootable
if the lDOS boot32 loader had been installed into the image.
I previously posted a similar patch for mtools to the info-mtools
mailing list [8]. I was approached to check whether dosfstools behaved
as expected. I determined that this patch is needed to fix the corner
case of invalid FSINFO entries with FSIBOOT installed into the sector.
I also patched the lDOS instsect application [9] so it insures that the
FSINFO entries are valid while installing FSIBOOT. With either that
patch to instsect or this patch to dosfstools, FSIBOOT will always be
preserved when running fsck.fat on a file system.
[1]:
https://github.com/FDOS/kernel/blob/6e42bb6d7c6dd304f738cf0d7a2db719598f1b9e
/hdr/device.h#L325
[2]:
https://github.com/FDOS/kernel/blob/6e42bb6d7c6dd304f738cf0d7a2db719598f1b9e
/kernel/fattab.c#L116
[3]:
https://github.com/torvalds/linux/blob/7cf726a59435301046250c42131554d9ccc56
6b8/include/uapi/linux/msdos_fs.h#L163
[4]:
https://github.com/torvalds/linux/blob/7cf726a59435301046250c42131554d9ccc56
6b8/fs/fat/misc.c#L60
[5]: https://hg.ulukai.org/ecm/ldosboot/file/aa15fd7bc58e/boot32.asm#l1164
[6]: https://hg.ulukai.org/ecm/ldosboot/file/aa15fd7bc58e/boot32.asm#l27
[7]: https://hg.ulukai.org/ecm/ldosboot/file/aa15fd7bc58e/boot32.asm#l775
[8]: https://lists.gnu.org/archive/html/info-mtools/2020-10/msg00000.html
[9]: https://hg.ulukai.org/ecm/instsect/rev/eee5dfaa52f6
commit 201665c
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Feb 16 12:33:32 2020 +0100
mkfs.fat: Update --help for -h (hidden sectors)
commit 25da96e
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Feb 16 12:22:04 2020 +0100
mkfs.fat: Relax -D option (BIOS drive number)
Allow to specify also second hard disk (0x81) or second floppy device
(0x01) as -D option = BIOS drive number.
commit bce0940
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Feb 17 18:59:54 2019 +0100
manpages: Update mkfs.fat manpage about FAT32 backup boot sector
commit da36707
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Feb 17 11:48:32 2019 +0100
mkfs.fat: Write FAT32 backup info sector after FAT32 backup boot sector
Write it only in the case when location does not conflict with real/primary
FAT32 info sector and reserved area is big enough.
commit 5b61d9f
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Feb 17 11:01:15 2019 +0100
testsuite: Run fsck test step always even if mkfs test step fails
fsck test step can show more details about badly created image by mkfs.
commit 53bfa1f
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Feb 17 10:56:06 2019 +0100
testsuite: Add test for mkfs.fat with two FAT32 sectors in reserved area
commit 3cca83a
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Feb 17 10:36:33 2019 +0100
mkfs.fat: Fix setting location of FAT32 backup boot sector
For FAT32 if there are only two sectors in reserved area, first must be
boot sector and second must be FAT32 fs info sector. And there would not be
FAT32 backup boot sector as it is optional. FAT32 info sector is for FAT32
media mandatory.
When backup_boot variable is set to zero it means that no FAT32 backup boot
sector is written. Check that FAT32 backup boot sector differs from FAT32
info sector is already there.
Also allow user to specify zero for -b option which disable creating of
FAT32 backup boot sector.
commit c5e35e7
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Feb 17 10:34:24 2019 +0100
mkfs.fat: Put FAT32 info sector number into variable
Also check that it is not same as backup boot sector value.
commit d276ddb
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Feb 17 10:32:08 2019 +0100
mkfs.fat: Rename info_sector buffer variable to info_sector_buffer
Also call free() unconditionally as it does nothing for NULL argument.
commit 5e936c9
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sat Nov 24 19:45:39 2018 +0100
mkfs.fat: Remove dependency on systemd/udev
There is no need that mkfs.fat depends on systemd. It uses it only for
reading additional information about block device.
This patch replace systemd/udev dependency code by reading those additional
information about block device directly from sysfs.
So no functionality of mkfs.fat is lost or removed.
commit 18a05e7
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Jan 5 00:58:41 2020 +0100
manpages: Fix '. SF' file names
commit 7e6d7d3
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sat Nov 24 18:18:53 2018 +0100
manpages: Fix switching to previous font style
In troff manpage language previous font style is selected by "\fP"
sequence, not by "\fR". "\fR" selects roman font style.
commit ffa5dfa
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Nov 18 21:14:24 2018 +0100
manpages: Fix formatting of bullets
In troff manpage language bullet is written as "\(bu".
commit bc65dd6
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Nov 18 21:10:29 2018 +0100
manpages: Fix formatting of emphases
To emphasize use italic font style instead of putting word into two
apostrophes. Ascii apostrophe in troff manpage language means "right single
quotation mark", therefore putting word into two apostrophes is fully
wrong.
Also arguments and file names should be formatted in italic.
commit 0273989
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Nov 18 21:01:55 2018 +0100
manpages: Fix formatting of hyphens, en and em dashes
In troff manpage language ascii minus is written as "\-", mathematical
minus as "\(mi", hyphen as "-", en-dash as "\(en" and em-dash as "\(em".
commit c85c863
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Oct 21 12:58:19 2018 +0200
manpages: Clarify unit of BLOCK-COUNT
BLOCK-COUNT is always in KiB unit independently of the disk sector size,
FAT sector size or FAT cluster size.
commit 69fcfe5
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Aug 19 16:35:22 2018 +0200
fsck.fat: Check for DOS Clean Shutdown bit
DOS Clean Shutdown bit in first reserved FAT entry is cleared when DOS or
Windows FAT driver mounts a volume and set is back when doing unmount.
Therefore set this bit when clearing FAT dirty bit in boot sector.
commit 68e8e54
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sat Jan 4 14:53:28 2020 +0100
mkfs.fat: Calculate CHS geometry according to SD Card Part 2 File System Spe
cification
Use this CHS calculation when disk geometry is not available. This change
replaces hardcoded 64/32 value by formula based on total number of sectors.
For SD cards with more then 256MB capacity is CHS calculation according to
SD Card Part 2 File System Specification same as CHS calculation for hard
disks via LBA-Assist Translation.
commit 5199d68
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Aug 19 09:57:41 2018 +0200
mkfs.fat: Add a new option --mbr which fills MBR table with one partition
It is needed only for non-removable disks used on Microsoft Windows systems
and only when formatting whole unpartitioned disk.
Also some removable USB flash disks accessed via USB Mass Storage declares
themselves as non-removable and Microsoft Windows systems do not recognize
them without MBR partition table and MBR disk signature.
Because MBR sector and first FAT sector are very similar (starts with
boot code, ends with boot sign 0xAA55) they can live together at one
sector. Moreover location of the MBR partition table overlaps only with the
end of FAT boot code where is just place for the error message, it is
possible to fill (fake) MBR partition table with one partition which refers
to whole disk itself (starts at sector 0 and spans whole disk).
Similar thing is doing mformat (FAT12/16/32 formatting tool) from mtools
project or mkudffs (UDF formatting tool) from udftools project.
commit 9f856b7
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Mon Jan 27 22:12:38 2020 +0100
charconv: Do not use %lc format modifier for wide char which cannot be conve
rted to multibyte string
commit 032ec02
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Tue Jan 14 00:27:31 2020 +0100
charconv: Fix usage of iconv() for state-dependent encodings
After first main iconv() call set conversion state to the initial state and
store corresponding shift sequence to output buffer via second iconv() call.
commit 4428d7d
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Mon Jan 13 23:15:22 2020 +0100
charconv: Fix checks for overlong input strings
commit 2779d70
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Wed Jan 8 01:03:24 2020 +0100
charconv: Use ICONV_CONST macro to fix compile warnings with GNU libiconv
Macro ICONV_CONST is defined by autoconf and expands either to "const" or
nothing based on what API provides iconv() implementation, either according
to SUSv2 or POSIX.1-2001/POSIX.1-2008.
commit 565d7a2
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Wed Jan 8 01:02:16 2020 +0100
charconv: Fix check for return value of iconv
iconv() returns (unsigned) size_t type, so its return value is always
different from (signed) negative -1. To compare with -1 it first needs to
be casted to size_t type.
commit e9b42f5
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Wed Jan 8 00:44:27 2020 +0100
charconv: Increase buffer size for output strings in current locale
MSDOS_NAME * 4 does not have to be enough size as iconv in translit mode
can return also 5 bytes per one wide character.
commit 1403c53
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Wed Jan 8 00:42:35 2020 +0100
charconv: Fix buffer overflows by specifying output buffer size
commit 917846b
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Tue Jan 7 00:54:15 2020 +0100
charconv: Fix put_char() function
Ensure that this function always print characters according to current
locale. So do not treat characters above 0xA0 as printable when
dos_char_to_printable() cannot process them.
commit 6dc68a8
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Tue Jan 7 00:52:43 2020 +0100
charconv: Fix comment for init_conversion() function
commit 2d6c37d
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Tue Jan 7 00:52:25 2020 +0100
charconv: For internal CP850 conversion add translit table
This CP850 translit table was created by iconv ASCII//TRANSLIT as a 7bit ASC
II fallback.
commit 3ccfe29
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Tue Jan 7 00:50:09 2020 +0100
charconv: As a fallback try to use also non-translit iconv conversion
commit 1b72fdf
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Mon Jan 6 18:30:28 2020 +0100
charconv: Use const for input strings
commit 102aa76
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Mon Jan 6 18:29:30 2020 +0100
charconv: Rename third argument of local_string_to_dos_string()
Correct name is out_size as it is size of output buffer and not length of st
ring.
commit 49cc12a
Author: Lennart Poettering <lennart@poettering.net>
Date: Mon Aug 3 12:17:12 2020 +0200
mkfs: fsync() the block device before exiting
Let's make sure to sync the block device, before exiting. Otherwise, if
we operate on a loop device and people issue "losetup -d" right after
this command finishes our in-flight writes might never hit the disk.
(This took 4h of my life for me to figure out. The mkfs for all other
file systems I tested appear to synchronize when done, hence fat should
do too.)
commit cc75143
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Mon Jan 27 22:22:35 2020 +0100
mkfs.fat: Mark struct fat32_fsinfo as packed
commit f8f455b
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Mon Jan 27 22:25:20 2020 +0100
fatlabel: Update documentation about DOS codepage
commit 3ce32fa
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sat Jan 4 15:27:59 2020 +0100
mkfs.fat: Clarify licensing of the dummy boot sector
Original author H. Peter Anvin allowed to put mkfs.fat boot sector code
into the public domain.
commit 8dc8976
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Fri Feb 14 00:00:27 2020 +0100
manpages: Update documentation about hidden sectors
Fixes #29
commit 17be357
Author: David Gumberg <davidzgumberg@gmail.com>
Date: Sun Oct 13 18:21:57 2019 -0600
Get cross-platform libc6 generically
commit 5e2529e
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Mon Oct 14 12:21:36 2019 +0200
travis: use if ... fi construction
As single test command has side effect in return value for Travis.
commit 20092b8
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Mon Oct 14 12:14:07 2019 +0200
travis: Check for fatlabel test errors only for non-static builds
Static builds have broken iconv support which is detected at configure time
as usable. This leads to usage of internal CP850 conversion table as
fallback solution which throws runtime non-fatal error.
commit a4a0d62
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Mon Oct 14 09:48:43 2019 +0200
tests: Check for stderr errors from fatlabel tests
commit 84a8d1c
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Jun 23 12:01:48 2019 +0200
charconv: Update Travis configuration
Use autogen.sh instead of non-working autoreconf and test also
static linked versions and configurations without iconv.
commit b657ede
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Jun 23 10:47:44 2019 +0200
charconv: Add autogen.sh script
AM_ICONV macro depends on gettext installation. Unfortunately autoreconf is
not able to install config.rpath file so do it manually in autogen.sh.
See reported bug:
https://lists.gnu.org/archive/html/bug-gettext/2011-10/msg00012.html
commit 0dec6a7
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sat Jun 22 22:14:31 2019 +0200
charconv: Fix sources for testdevinfo target
testdevinfo does not use any of charconv functions, nor any of mkfs
functions. So do not link charconv/mkfs into testdevinfo.
This fixes linking problems when iconv functions are not present in
standard libraries.
commit 664192e
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sat Jun 22 01:23:54 2019 +0200
charconv: Check return value of all set_dos_codepage() calls
commit 6d49a1f
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sat Jun 22 01:16:44 2019 +0200
charconv: Check presence of iconv
Use autoconf AM_ICONV macro for it. AM_ICONV should handle both cases when
iconv_open is available in external libiconv library or as part of libc
library.
To force compilation of dosfstools without iconv support there is a new
configure option --without-iconv.
commit fa9761f
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sat Jun 22 01:14:37 2019 +0200
charconv: Fix return value from iconv_init_codepage function
commit d74c592
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sat Jun 22 01:12:46 2019 +0200
charconv: Add fallback to internal CP850 table
Static linked version of glibc does not contain iconv with CP850 support.
As CP850 is default code page for all dosfstools programs add own internal
implementation which will be always supported. It would be used only in
case iconv_open() fails.
commit 91978a2
Author: Michael Forney <mforney@mforney.org>
Date: Fri Jun 7 08:48:13 2019 -0700
Use static inline function instead of statement expression
commit e06e759
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Wed Jun 5 09:25:52 2019 +0200
Fix Travis CI configuration for powerpc and arm
commit fc55b63
Author: Noé Rubinstein <nrubinstein@aldebaran.com>
Date: Mon Aug 31 15:19:57 2015 +0200
mkfs: document --offset in the man page
commit f473459
Author: Noé Rubinstein <nrubinstein@aldebaran.com>
Date: Thu Jul 2 15:49:06 2015 +0200
Allow specifying an offset in the device file in mkfs
commit 93b4288
Author: Tobias Stoeckmann <stoeckmann@users.noreply.github.com>
Date: Sun Feb 24 20:55:15 2019 +0100
Fix out of boundary read in fsck.fat/fatlabel
Faulty filesystems are able to trigger integer overflows in read_boot which
eventually lead to insufficient allocation of memory for the FAT and therefore o
ut of boundary reads.
commit af3e50d
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Aug 12 12:15:45 2018 +0200
device_info: Fix parsing partition number
Ensures that it is always valid number which does not overflow or
underflow.
commit 086e13c
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Aug 12 12:15:21 2018 +0200
mkfs.fat: Fix parsing of block number
Block number must not be negative. It is 32bit so use long long type and
strtoll() function to ensure that converted positive 32bit value would fit
into type.
commit a2b97c9
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Aug 12 12:13:35 2018 +0200
mkfs.fat: Fix validation of numeric command line arguments
Ensures that argument is always valid number which does not overflow or
underflow.
commit 07e63ac
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Aug 12 11:56:32 2018 +0200
mkfs.fat: Fix validation of volume ID
Use same logic as in fatlabel.
commit 425a415
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sat Aug 11 22:49:37 2018 +0200
fatlabel: Fix validation of volume ID
Standard C function strtoull() does not signal underflow, therefore it
cannot be used for conversion of arbitrary string to integer with detection
of failure.
Instead use function strtoll() and detect underflow (negative value)
manually.
Note that strto* functions skips and ignores leading whitespace characters,
so detects them manually via standard C function isspace().
commit da07aa4
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sat Jan 19 09:48:25 2019 +0100
Update Travis configuration
* Use both gcc and clang compilers
* Compile with -fwrapv and -fsanitize=address
* Compile in both 32 and 64 modes for x86 systems
* Cross compile for little endian arm and big endian powerpc
* Run cross compiled binaries in qemu
commit a6ec69d
Author: Tobias Stoeckmann <tobias@stoeckmann.org>
Date: Mon Jan 14 22:47:40 2019 +0100
Renamed len to out_size.
As pointed out by pali it makes sense to rename len to out_size
to make explicitly sure by proper naming that this is the actually
available memory size at "out", not the length of a string.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
commit 6080fe2
Author: Tobias Stoeckmann <tobias@stoeckmann.org>
Date: Mon Jan 14 19:36:11 2019 +0100
Fixed off-by-one in local_string_to_dos_string.
The function local_string_to_dos_string is vulnerable to an off-by-one
buffer overflow. In fact, it is triggered in default usage and becomes
visible when compiled with ASAN:
$ CFLAGS="-fsanitize=address" ./configure
$ dd if=/dev/zero of=example.iso bs=1024 seek=64 count=1
$ ./src/mkfs.fat example.iso
mkfs.fat 4.1+git (2017-01-24)
=================================================================
==3857==ERROR: AddressSanitizer: stack-buffer-overflow on address ...
The problem is that the argument "len" to local_string_to_dos_string
stores the length of the output buffer. Yet it can also be used as an
index to store '\0':
If the whole "out" buffer has been written to, bytes_out is 0 and
the assignment in out[len-bytes_out] therefore leads to an off-by-one.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
commit 332fc29
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Nov 18 20:47:29 2018 +0100
Fix memory leaks in read_fat() function
Function read_fat() allocates memory to the user supplied buffer. Therefore
that function needs complement function for releasing allocated memory and
user needs to call if after finish its work.
This patch fixes memory leaks in fsck.fat and fatlabel tools.
Fixes #13
commit 4cfd643
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sat Sep 29 10:08:12 2018 +0200
mkfs.fat: Fix endianity for hidden_sectors
Global variable hidden_sectors is in host byte order.
commit a874650
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Tue Aug 14 21:13:52 2018 +0200
mkfs.fat: Add some workaround for Year 2038 Bug
Check return values of time(), gmtime() and localtime() function which may
fail. Fallback to date/time 1.1.1980 00:00:00 when those functions fail.
For generating volume id, add fallback code based on rand() function.
commit 607fbed
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Tue Aug 14 20:57:27 2018 +0200
fsck.fat: Fix Year 2038 Bug
Do not use time_t type and strftime() function which are affected by the
Year 2038 Bug. Instead parse date/time directly from DOS format which
avoids conversion from DOS to UNIX + conversion from UNIX to string.
commit fb0cc0d
Author: Andreas Bombe <aeb@debian.org>
Date: Tue Aug 14 12:58:58 2018 +0200
Fix gcc sprintf() length warnings
There are two sprintf() calls that receive warnings from current
versions of gcc for possibly overrunning the temporary buffers they're
writing into.
The first one in src/check.c is theoretically safe since strftime()
shouldn't generate such a long string. Reduce the maximum length of the
strftime() string to fix this warning. Also detect strftime() errors
and overwrite the buffer with a message in that case.
The second one in src/boot.c should not be possible and is a limitation
of gcc's detection. It assumes that %02x could write up to 8
characters, even though the arguments are pointers to uint8_t which
can't be more than two characters. Placate gcc by lengthening the
temporary buffer by 12 bytes.
commit ca54953
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Mon May 7 09:27:16 2018 +0200
mkfs.fat: Add support for --codepage option for label and validate it
commit 40da1b2
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Mon May 7 09:26:42 2018 +0200
fatlabel: Implement proper checks when setting new label
According to Microsoft FAT specification "fatgen103.doc" there are
following restrictions for FAT label stored in root directory:
* DIR_Name[0] may not equal 0x20.
* Lower case characters are not allowed in DIR_Name (what these characters
are is country specific).
* The following characters are not legal in any bytes of DIR_Name:
- Values less than 0x20 except for the special case of 0x05 in
DIR_Name[0]
- 0x22, 0x2A, 0x2B, 0x2C, 0x2E, 0x2F, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F,
0x5B, 0x5C, 0x5D, and 0x7C
And another Microsoft "FAT32 Spec (SDA Contribution).pdf" describe:
* DIR_Name[0] cannot equal 0x20 (in other words, names cannot start with a
space character).
commit 4f953bb
Author: Andreas Bombe <aeb@debian.org>
Date: Mon Jun 11 14:21:17 2018 +0200
Remove long file name when changing short file name
In the current state, long file names are poorly supported and in case
the file got automatically or manually renamed in auto_rename() or
rename_file(), only the short file name would be manipulated.
Only the checksum would be fixed to have the LFN stay valid. This would
cause issues such as the rename being hidden by the unchanged LFN or
duplicate LFNs remaining if they were the cause for a rename.
Change so that existing LFNs are removed for files being renamed.
commit b356cf0
Author: Andreas Bombe <aeb@debian.org>
Date: Mon Jun 11 14:17:03 2018 +0200
Print error message when auto_rename() is called on FAT32 root directory
Use the same error message as rename_file() uses for the same reason
when called on the FAT32 root directory pseudo file rather than silently
ignoring.
commit 8c4122e
Author: felix <felix.von.s@posteo.de>
Date: Mon Jun 11 04:35:35 2018 +0200
Fix allowing changes in SFNs reporting bogus error on FAT32 root directory
The code to permit spaces in short filenames introduced in commit
4d01db7c6 caused the root directory pseudo file to be checked for a bad
name. Since the name for that file is not set (zeroed out), bad_name()
would report an error. Attempting to fix it would do nothing as the
rename functions check for and ignore the root directory.
Fix by checking for the root directory in bad_name().
commit 96e6efd
Author: Andreas Bombe <aeb@debian.org>
Date: Sun Jun 10 03:09:14 2018 +0200
fsck: Fix -S option not being recognized
The call to getopt_long() did not include the -S option, so that it was
not recognized even though its handling was implemented.
commit 4d01db7
Author: felix <felix.von.s@posteo.de>
Date: Mon Apr 2 10:20:10 2018 +0200
fsck.fat: Allow spaces in the middle of SFNs
Also, introduce an -S option (mostly) restoring previous behaviour.
commit c74ca0c
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Wed Mar 7 18:00:15 2018 +0100
manpages: Add section DOS CODEPAGES to fatlabel
Table was extracted from the National Language Support (NLS) API Reference:
https://www.microsoft.com/resources/msdn/goglobal/default.mspx?OS=Windows+7
And filtered by codepages supported by GNU libiconv.
commit b665a93
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Wed Mar 7 17:59:50 2018 +0100
fatlabel: Add support for --codepage option
FAT label in both boot sector and root directory is stored according to
current OEM code page. Microsoft Windows system treat FAT label really in
this way. In most cases OEM code page is just 8bit extension of the
printable ASCII, therefore for ASCII-only labels there is no change.
By default OEM code page 850 is used which contains most of the characters
that are also available in ISO-8859-1. Same default which is used by
fsck.fat and mlabel (from mtools project).
commit 76c0362
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Wed Mar 7 17:58:05 2018 +0100
fsck.fat: Change default DOS codepage to 850
The reason for change is that 850 is more common on Windowes and used by
more regions as 437. Also it contains most of the characters that are also
available in ISO-8859-1. And 850 is also default DOS code page used by
mtools, which is used on Linux.
commit 18ed349
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Wed Mar 7 17:57:23 2018 +0100
Initialize iconv "from codepage" with //TRANSLIT
This would allow to show characters from DOS codepage on systems which
current locale does not support it via transliteration.
For example byte E8 in DOS CP437 (e with a grave accent) does not have
representation in Linux locale Latin2. But it can be shown after
transliteration as simple character "e".
commit 08d743c
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Wed Mar 7 17:57:13 2018 +0100
Initialize only LC_CTYPE locale
LC_ALL is not needed as locale is used just for CODESET. LC_CTYPE is enough
for using nl_langinfo(CODESET).
commit 2112913
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Apr 8 11:37:29 2018 +0200
Add tests for FAT32 labels
These FAT32 images were generated for FAT label test suite in October 2017.
Now fatlabel reports same FAT32 label as MS-DOS 6, 7 and Windows 98, XP, 10.
For more information about test result see email:
https://www.spinics.net/lists/kernel/msg2640891.html
commit bfeedfc
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Thu Nov 9 21:25:05 2017 +0100
mkfs.fat: Correctly process 0xe5 as first character of directory entry
Same as commit 51da71aa9edc36fabf83323282f14e7ee71aa07b but for mkfs.fat.
commit 1b866f4
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Thu Nov 9 21:25:01 2017 +0100
fsck.fat: Handle 0xe5 as first character of directory entry
Same as commit 51da71aa9edc36fabf83323282f14e7ee71aa07b but for fsck.fat.
commit 5b702a7
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Thu Nov 30 00:07:39 2017 +0100
manpages: Add section COMPATIBILITY and BUGS to fatlabel
commit 900edb6
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Thu Nov 30 00:07:22 2017 +0100
fatlabel: Optimize size of the binary
Move implementation of the alloc_rootdir_entry() function from the check.c
to boot.c and do not link unneeded objects files into fatlabel binary.
This would decrease size of the fatlabel binary nearly by half. With -g -O2
size before was about 194131 bytes and after just 104497 bytes.
commit 0901aa8
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Thu Nov 30 00:07:05 2017 +0100
fatlabel: Clear ATTR_VOLUME from directory entry when removing label
Older versions of fatlabel ignored FAT entries with deletion mark 0xE5 and
tried to read labels also from those entries. This fix clear ATTR_VOLUME so
older versions would not try to read label from deleted entry.
commit cb8e674
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Thu Nov 30 00:06:51 2017 +0100
fatlabel: Print label without padding spaces
Every entry in FAT directory is padded with spaces, which are not part of
entry name. Therefore show also label from root FAT directory without those
padding spaces.
commit d822d5b
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Thu Nov 30 00:06:36 2017 +0100
fatlabel: Show only label stored in root directory
MS-DOS 6.22, MS-DOS 7.10, Windows 98, Windows XP and also Windows 10
ignores label stored in boot sector. When label in boot sector is non-empty
and label in root directory is missing then they treat situation as there
is no label for particular disk. So when labels in boot sector and root
directory are out of sync, fatlabel shown different label as those MS-DOS
and Windows systems. To make behavior between DOS, Windows and Linux
consistent, ignores label in boot sector also in fatlabel.
commit c598354
Author: Ashe David Sterkehus <ashe.goulding@gmail.com>
Date: Wed Nov 22 00:20:40 2017 +0900
mkfs: Check volume label given with -n is no longer than 11 characters
Fixes #70
commit 87a8f29
Author: Will Newton <willn@resin.io>
Date: Thu Aug 31 10:42:13 2017 +0100
src/check.c: Fix up mtools created bad dir entries
mtools writes uninitialized data to the case field of some
directory entries. Running fsck.fat on these filesystems
will cause the directory to get deleted which can lead to
data loss. Detect this situation and clear the flag instead.
mtools patch to fix the original issue:
https://lists.gnu.org/archive/html/info-mtools/2014-08/msg00000.html
Signed-off-by: Will Newton <willn@resin.io>
commit fe3ada3
Author: Andreas Bombe <aeb@debian.org>
Date: Sun Oct 15 16:26:01 2017 +0200
manpages: Remove formatting from NAME sections where it doesn't belong
The .SH NAME sections are supposed to contain just "name \- description"
with no bolding on the name.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 0d2d2b2
Author: Andreas Bombe <aeb@debian.org>
Date: Sun Oct 1 15:17:13 2017 +0200
manpages: Clarify rules for volume labels as implemented
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 86fa0d8
Author: Andreas Bombe <aeb@debian.org>
Date: Sun Oct 1 15:16:12 2017 +0200
manpages: Make SEE ALSO sections conform to conventions
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 5cdad55
Author: Andreas Bombe <aeb@debian.org>
Date: Sun Oct 1 03:57:59 2017 +0200
Harmonize unknown command line option handling
Now all binaries will show help and not try to print something like
"unknown option '?'" because '?' is the value getopt_long() returns when
it encounters an unknown option. At this point, getopt_long() has
already printed the problem to stderr so we don't have to.
The default action on getopt_long() return values (neither known option
nor '?') is to report an internal error with the unexpected value.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 34fd8eb
Author: Andreas Bombe <aeb@debian.org>
Date: Sun Oct 1 03:04:00 2017 +0200
fatlabel: Add new -r, --reset option
This new option removes the label or generates a new serial number if in
volume ID mode.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit e4e346f
Author: Andreas Bombe <aeb@debian.org>
Date: Sun Oct 1 02:43:03 2017 +0200
fatlabel: Don't access element of argv array that may not exist
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 17dea47
Author: Andreas Bombe <aeb@debian.org>
Date: Sun Oct 1 02:27:31 2017 +0200
Move generation of serial number into new function generate_volume_id()
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 07f0238
Author: Andreas Bombe <aeb@debian.org>
Date: Sun Oct 1 02:17:41 2017 +0200
Add remove_label() function
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit ce7e7f9
Author: Andreas Bombe <aeb@debian.org>
Date: Sun Oct 1 01:42:55 2017 +0200
fatlabel: Refuse empty strings as labels
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 51da71a
Author: Andreas Bombe <aeb@debian.org>
Date: Sun Oct 1 01:28:32 2017 +0200
Handle 0xe5 as first character of volume label
Directory entries are not allowed to have 0xe5 as the first character as
that is the marker for deleted entries. Instead, these have to be
converted to 0x05 on writing and the other way on reading.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 3a1aac1
Author: Andreas Bombe <aeb@debian.org>
Date: Sun Oct 1 01:11:05 2017 +0200
Remove leftover handling of split directory entry name
The name field in DIR_ENT used to be split into name and ext. Reading
the volume label from a DIR_ENT used to require merging the contents of
both fields and that handling was still there as reading parts of the
same name field and merging them. Simply read in one go instead.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 04aca69
Author: Andreas Bombe <aeb@debian.org>
Date: Sun Oct 1 00:54:12 2017 +0200
Terminate volume label search at end of directory
In find_volume_de() there is no point in scanning the directory entries
after the first end of directory marker (name starts with a zero byte).
Simply return 0 if end of directory is encountered.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 747c8f9
Author: Andreas Bombe <aeb@debian.org>
Date: Sun Oct 1 00:46:05 2017 +0200
Avoid returning deleted directory entries as labels
In find_volume_de(), only the attributes were tested to decide whether a
directory entry was a volume label. This could lead to deleted entries
being returned. Check the name for deleted or unallocated marker to
prevent this.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 0a733d8
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Wed Jul 5 20:44:00 2017 +0200
fatlabel: Fix erasing label
Empty label needs to be stored as "NO NAME ". Like in mkfs treat label
which starts with character 0xE5 as empty.
commit e1397b9
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Wed Jul 5 20:37:17 2017 +0200
mkfs: Handle -n "" correctly
When user specify empty argument for -n, then it is empty label and needs
to be transformed to NO_NAME. Also treat -n argument which starts with
character 0xE5 as empty because label is stored also in root FAT directory
and such entry is marked as deleted.
Fixes #54
commit 2afb699
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Thu Sep 28 10:13:56 2017 +0200
fatlabel: Fix parsing volume ID
* Do not allow specifying empty argument as volume ID
* Check for errno (as general error) after more specific errors
Fixes #64
commit 7ddcf9b
Author: Andreas Bombe <aeb@debian.org>
Date: Mon Sep 25 01:21:23 2017 +0200
fatlabel: Implement volume ID mode
When given the new -i or --volume-id option, fatlabel will display or
change the volume ID (serial number) instead of the volume label. The ID
is displayed as an 8 digit hexadecimal number, when changing it must
also be given as a hexadecimal number that fits within 32 bits.
Fixes #52
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 20a3e0f
Author: Andreas Bombe <aeb@debian.org>
Date: Mon Sep 25 00:36:33 2017 +0200
Add write_serial() function
write_serial() works like write_boot_label() but sets the volume ID
instead of the volume label in the boot sector.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit d7c9ffa
Author: Andreas Bombe <aeb@debian.org>
Date: Mon Sep 25 00:07:17 2017 +0200
Make fs_open() path argument const char*
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 06c2d11
Author: Andreas Bombe <aeb@debian.org>
Date: Sun Sep 24 22:32:16 2017 +0200
Read volume ID in read_boot()
The DOS_FS struct gets a new 32 bit field "serial" and read_boot() will
now read the volume ID into this field.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit e501243
Author: Andreas Bombe <aeb@debian.org>
Date: Thu Sep 21 15:20:33 2017 +0200
fatlabel: Expand help message by description and options
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 944ffe4
Author: Andreas Bombe <aeb@debian.org>
Date: Thu Sep 21 15:15:54 2017 +0200
fatlabel: Change option parsing to getopt_long()
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 33dd224
Author: Andreas Bombe <aeb@debian.org>
Date: Sat Aug 5 20:02:04 2017 -0400
Warn that -r is useless with FAT32 filesystems
The option -r specifies the root directory size that neither is nor can
be fixed on FAT32. If generating a FAT32 filesystem and this option is
specified, warn the user that it has no effect.
Fixes #43
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit ed9facf
Author: Jakub Wilk <jwilk@jwilk.net>
Date: Tue Jul 11 01:01:20 2017 +0200
Fix signed integer overflow in FSTART
uint16_t was promoted to int, and then left shift could overflow it.
Add explicit cast to uint32_t to avoid undefined behavior.
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 995d814
Author: Emanuel Czirai <xftroxgpx@gmail.com>
Date: Fri May 5 22:43:54 2017 +0200
add missing \n
To fix this:
```
Starting check/repair pass.
FATs differ but appear to be intact.1) Use first FAT
2) Use second FAT
[12?q]?
```
commit 9d822ba
Author: Andreas Bombe <aeb@debian.org>
Date: Thu Jun 29 20:56:03 2017 +0200
mkfs: List all options with short descriptions in --help message
Make the help message more informative by giving a short description,
simplifying the usage line and giving a short description of every
option. The usage line now also shows the actual executable name instead
of a hardwired 'mkfs.fat'.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 32b3bce
Author: Andreas Bombe <aeb@debian.org>
Date: Wed Jun 28 15:17:33 2017 +0200
mkfs, fsck: Add --variant=TYPE command line option
TYPE can be 'standard' or 'atari' (case insensitive) to select the
desired mode rather than having to toggle with -A.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 6fc9004
Author: Andreas Bombe <aeb@debian.org>
Date: Tue May 30 21:26:44 2017 +0200
manpages: Rework the intro of the mkfs man page
Acknowledge that image files can be used in place of device files.
Remove mentions of "under Linux" since it has been portable for a while.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit bbbd077
Author: Andreas Bombe <aeb@debian.org>
Date: Fri Apr 21 20:47:32 2017 +0200
manpages, configure.ac: Correct description of Atari format selection
The -A option doesn't turn on (or turn off) Atari format selection, it
toggles it with every occurrence. Change wording in the man pages to
reflect that.
Also mention that automatic selection can happen only on 68k Atari Linux
in the man pages and the --enable-atari-check option help in
configure.ac.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 9fa180c
Author: Andreas Bombe <aeb@debian.org>
Date: Thu Apr 6 20:47:11 2017 +0200
Disable legacy check for 68k Atari by default
The code that checked for Atari hardware when compiled for the 68k
architecture is now disabled by default. A new configure option
--enable-atari-check allows enabling it again.
In addition to the the new configure option and the symbol __mc68000__
it also depends on __linux__, since its implementation checks Linux
specific /proc files.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit d0c8900
Author: Andreas Bombe <aeb@debian.org>
Date: Wed Apr 5 20:40:33 2017 +0200
Move all three check_atari() and atari_format definitions to common.c
Now that mkfs is also using common.c, all three identical check_atari()
definitions from mkfs, fsck and fatlabel can be combined in a single
location in common.c
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit a753734
Author: Andreas Bombe <aeb@debian.org>
Date: Wed Apr 5 20:29:20 2017 +0200
mkfs: Link with common.c and use its die() implementation
Now common.c is linked into mkfs and its die() implementation is used
instead of the local implementation. That implementation consisting of a
die() macro and fatal_error() function has been removed.
To reproduce current messages exactly, there is now a program_name
variable in common.c. If it is not NULL, die() will prepend its contents
to the message it prints.
The previous implementation implicitly passed device_name to the
printf() so that die() invocations only needed to put "%s" where they
wanted the device name to appear in the string. These invocations now
have explicit device_name arguments.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit b0d524d
Author: Andreas Bombe <aeb@debian.org>
Date: Tue Apr 4 20:42:02 2017 +0200
fsck.fat.h: Remove extern declarations of interactive and write_immed
These two declarations were forgotten when the variables moved to
common.c.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 2af848f
Author: Andreas Bombe <aeb@debian.org>
Date: Mon Apr 3 20:53:14 2017 +0200
fsck: Switch to getopt_long() option parser and add --help option
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit c0c3141
Author: Andreas Bombe <aeb@debian.org>
Date: Mon Apr 3 20:45:20 2017 +0200
fsck: Pass the exit value to use to usage()
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 112bdc6
Author: Andreas Bombe <aeb@debian.org>
Date: Mon Apr 3 20:41:31 2017 +0200
fsck: Clean up usage() message a little
Bring the usage() help message more in line with common conventions.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 4d2273a
Author: Andreas Bombe <aeb@debian.org>
Date: Fri Mar 31 14:41:42 2017 +0200
mkfs.fat.c: Change misleading comment about FAT32 selection
There was an apparently very old comment in setup_tables() about FAT32
not yet being chosen automatically. If a specific FAT size is not
requested from the command line, establish_params() will previously have
set size_fat to 32 when the filesystem size is at least 512 MiB.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 8585962
Author: Andreas Bombe <aeb@debian.org>
Date: Fri Mar 24 20:40:12 2017 +0100
fsck: Add quit choice to interactive prompts
All prompts now get an additional 'q' choice to explicitly quit fsck.
Selecting 'q' will print a message detailing the situation and ask for
confirmation.
Since the message describing the situation depends on whether fsck is in
immediate-write mode, the variable selecting that is moved to common.c
to make it accessible to the get_choice() function.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit c366076
Author: Andreas Bombe <aeb@debian.org>
Date: Thu Feb 23 21:00:59 2017 +0100
fsck: Make prompts asking for writing changes at end more verbose and clear
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 141b009
Author: Andreas Bombe <aeb@debian.org>
Date: Wed Feb 22 20:07:25 2017 +0100
fsck: Don't ask whether to perform changes in immediate write mode
When all changes have already been written directly, it is useless to
ask whether to commit the changes and probably confusing to the user.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit b2cfd70
Author: Andreas Bombe <aeb@debian.org>
Date: Tue Feb 21 21:36:04 2017 +0100
Remove get_key()
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 0c1c5fc
Author: Andreas Bombe <aeb@debian.org>
Date: Tue Feb 21 21:24:14 2017 +0100
Overhaul interactive prompts
All uses of get_key() are converted to get_choice() and fsck now
disables canonical terminal mode to directly get key presses. It is no
longer required to press enter after typing the choice and it is no
longer possible to enter whole strings where only a character is
expected. The reaction to invalid input should be consistent now (i.e.
always repeat the prompt).
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 91b20bd
Author: Andreas Bombe <aeb@debian.org>
Date: Tue Feb 21 21:14:43 2017 +0100
Add get_choice() function
The get_choice() function is intended to supersede get_key(). It takes
pairs of return values and strings for every choice and a
non-interactive default choice, does the prompting and reading of user
input (if interactive) and returns the value for the selected choice.
Since it needs to know if it runs in interactive mode, the "interactive"
variable has been moved to common.c and removed from fsck.fat.c and
fatlabel.c.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit fd92fab
Author: Andreas Bombe <aeb@debian.org>
Date: Tue Feb 21 14:15:12 2017 +0100
Add get_line() function to read user input in canonical mode
The function will first save the terminal state and enable canonical and
echo mode, display a prompt, call fgets(), then restore previous
terminal mode. This allows it to work correctly regardless of the
current terminal mode.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 0155c9c
Author: Andreas Bombe <aeb@debian.org>
Date: Mon Feb 20 14:09:43 2017 +0100
Add asprintf() wrapper
Make xasprintf() a wrapper that calls asprintf() and terminates if an
error occurs like the alloc() function does for malloc(). The
availability of the non-standard asprintf() call is checked in
configure.ac and xasprintf() uses a local implementation if it isn't.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 09769e6
Author: Andreas Bombe <aeb@debian.org>
Date: Fri Feb 10 14:06:40 2017 +0100
Fix printf format specifier for printing label
Fix a mistake introduced in the last commit where a field width instead
of precision was given for rendering a fixed length string (without null
termination).
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 08cf67b
Author: Andreas Bombe <aeb@debian.org>
Date: Thu Jan 26 21:31:03 2017 +0100
Turn label in struct DOS_FS into char array from pointer
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 32eff6f
Author: Andreas Bombe <aeb@debian.org>
Date: Thu Jan 26 21:27:19 2017 +0100
Append +git to version number
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 820c2f9 (tag: v4.1)
Author: Andreas Bombe <aeb@debian.org>
Date: Tue Jan 24 13:10:23 2017 +0100
Releasing version 4.1
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit cad2c17 commit cad2c17
Author: Andreas Bombe <aeb@debian.org> Author: Andreas Bombe <aeb@debian.org>
Date: Mon Jan 23 03:10:56 2017 +0100 Date: Mon Jan 23 03:10:56 2017 +0100
fatlabel: Make sure printf style patterns in label are not expanded fatlabel: Make sure printf style patterns in label are not expanded
Writing a label to an unlabeled filesystem involves creating a root Writing a label to an unlabeled filesystem involves creating a root
directory entry to contain the label. For this, the directory entry to contain the label. For this, the
alloc_rootdir_entry() function used for creating new directory nodes for alloc_rootdir_entry() function used for creating new directory nodes for
recovered orphan cluster chains is reused. However, this expects the recovered orphan cluster chains is reused. However, this expects the
 End of changes. 1 change blocks. 
0 lines changed or deleted 1866 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)