108 Commits

Author SHA1 Message Date
Godzil
2688353714 Bump version 2013-02-04 17:21:44 +01:00
Godzil
18aba79467 Correct small mistakes in ui functions. 2013-02-04 17:20:30 +01:00
Godzil
559fd817ef Add UI definition, and preliminary support on major check loops. 2013-02-04 17:09:58 +01:00
Godzil
1734c45303 Add readme 2013-02-04 15:58:33 +01:00
Daniel Baumann
7a04539a5a Releasing version 3.0.14. 2013-01-23 13:22:01 +01:00
Daniel Baumann
0d8f0020ca Documenting dosfsck -b in its manpage.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 13:16:32 +01:00
Oleksij Rempel
a307be2b9c Adding option for bootsector read-only check.
Most boot sectors may contains marker for filesystem state. We can this
bit on every mount and warn user if some thing wrong, without checking
complete filesystem.

Signed-off-by: Oleksij Rempel <bug-track@fisher-privat.net>
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:51:48 +01:00
Oleksij Rempel
ce2f8dc349 Checking boot sector for dirty bit.
Some OSos use reseved byte of boot sector to set state of the file
system. If first bit set, then filesystem is proably damaged - write
operation was not finished/cache not snycted/...

Signed-off-by: Oleksij Rempel <bug-track@fisher-privat.net>
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:51:47 +01:00
Daniel Baumann
f33ee8ca56 Completing and updating all copyright headers for 2013.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:51:46 +01:00
Daniel Baumann
bfe6d25c62 Updating my email address.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:51:41 +01:00
Daniel Baumann
13cdb4d262 Releasing version 3.0.13.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:51:40 +01:00
Jaroslav Škarvada
d039482656 Fix 'dosfslabel throws "Seek to 114116076544:Invalid argument" error when labeling'.
See https://bugzilla.redhat.com/show_bug.cgi?id=693662 for more information.

Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:51:39 +01:00
Daniel Baumann
e243612ccd Releasing version 3.0.12.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:51:38 +01:00
Michael Casadevall
025b4f04fe Correcting miscalculation of sector number in some cases.
mkdosfs will incorrectly calculate the number of sectors of a
given FAT partition if the number sectors are odd due to
count_blocks incorrectly handling the remainder of a division
operation. This miscalculation causes the OMAP4 bootloader to
fail to boot.

This bug can be observed by comparing the total sector size in
fdisk expert more to fsck.msdos; this discrepancy only shows up
when the number of sectors are odd.

See https://bugs.launchpad.net/ubuntu/+source/dosfstools/+bug/794043
for more information.

Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:51:37 +01:00
Daniel Baumann
91a1fb9536 Re-running Nindent.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:51:35 +01:00
Sergey Gusarov
0390c4c1c1 Fixing compiler warnings related to the mismatch of types "char *" / "unsigned
char *".

These warnings appear when you compile the project with the option "-Wall", what
is done with the current default Makefile.

Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:51:34 +01:00
Jaroslav Skarvada
4a8f8a6645 Fixing overflow bug in reclaim_file function, see
https://bugzilla.redhat.com/show_bug.cgi?id=660154 for more information.

The problem is that alloc_rootdir_entry counts with 10000 files at max, but the
filename buffer is only 8 chars long. Due to pattern mask used it results to
only 10 files at max (FSCK0-9REC). If there is more than 10 files, it overflows
and hangs.

Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:51:33 +01:00
Sergey Gusarov
e0366dac97 Fixing conversion specifiers in accordance with the type of expressions.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:51:32 +01:00
Daniel Baumann
2d8be9c628 Indenting source files.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:51:30 +01:00
Daniel Baumann
697af859b6 Adding Nindent script from syslinux.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:51:29 +01:00
Daniel Baumann
66d55cd074 Releasing version 3.0.11.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:51:28 +01:00
Michael Stapelberg
d57980204e Add better error message when the device cannot be opened.
This is helpful for SD cards or other removable media which have an enabled
write lock -- without the "Permission denied" message, the user has to strace
mkdosfs to find out what's going on.

Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:51:27 +01:00
Jaroslav Skarvada
bb6000fc30 Unalign on s390x, see http://bugzilla.redhat.com/show_bug.cgi?id=624596 for
more information.

Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:51:26 +01:00
Daniel Baumann
5ef7f1f78a Releasing version 3.0.10.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:51:25 +01:00
Alexander Korolkov
ea41797c7a Modify LFN direntries when file is renamed or deleted, see
Debian bug #596329.

Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:51:24 +01:00
Alexander Korolkov
e56ff72c16 If the test of short filename fails, dosfsck could complain about
bad long filename, see Debian bug #596327.

Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:51:23 +01:00
Alexander Korolkov
f0a42d0634 dosfsck: don't complain about bad filenames when short filename
contains 7 or more characters with codes 128-255, see Debian
bug #596327.

Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:51:22 +01:00
Mitch Rybczynski
0113c5bd14 Adding __arm__ define check for some crosscompile toolchains.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:51:20 +01:00
Daniel Baumann
88cb84f140 Modernizing dosfslabel manpage.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:51:19 +01:00
Daniel Baumann
5aa7ec4f2d Modernizing dosfsck manpage.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:51:18 +01:00
Daniel Baumann
807ed80283 Fixing spelling error in boot.c.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:51:17 +01:00
Daniel Baumann
5b6849dc62 Releasing version 3.0.9.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:51:16 +01:00
Daniel Kahn Gillmor
33bca7d6b5 Be sure to store the updated reserved_sector count in the boot sector,
see Debian bug #567337.

Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:51:15 +01:00
Daniel Baumann
2a3bef84fb Releasing version 3.0.8.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:51:14 +01:00
Daniel Baumann
726c02daf6 Removing some cruft in end-comments.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:51:12 +01:00
Steven J. Magnani
a5961d7344 When compiling a 32-bit version of dosfstools on an x86_64 machine,
the resulting applications report strange errors on "large" (> 2 GiB)
partitions:

  Seek to -2118967808:Invalid argument

  Warning: Filesystem is FAT32 according to fat_length and fat32_length fields,
  but has only 8613 clusters, less than the required minimum of 65525.
  This may lead to problems on some systems.

This appears to be due to compilation with a 32-bit off_t and lseek() library
function.

Use lseek64 for positioning, and change some suspect uses of off_t to loff_t.

Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:51:11 +01:00
Steven J. Magnani
bbb25bf11a If dosfsck is run in read-only mode (-n), exit with code 0
if the only issue found is an uninitialized free cluster summary.

Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:51:10 +01:00
Steven J. Magnani
1cae726e2d On x86_64, dosfsck incorrectly claims that a free_cluster summary of
0xFFFFFFFF, defined by Microsoft to be "uninitialized," is wrong.

Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:51:09 +01:00
H. Peter Anvin
62f806a292 mkdosfs: correct alignment of the root directory.
Correct the code to align the root directory; it was broken before
since bs.dir_entries had already been set at the point of alignment.
This patch removes the dual use of bs.dir_entries and root_dir_entries
to carry the same information: the information is carried in
root_dir_entires exclusively, and then bs.dir_entries is set inside
setup_tables() at a late point.

The code to align the root directory is also wrapped in
if (align_structures); this avoids rounding the number of root
directory entries up to a whole sector when used with -a
(i.e. preserves the previous behavior.)

Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:51:07 +01:00
H. Peter Anvin
8825bda33b mkdosfs: improve wording in the man page for the -a option.
Improve the English language used in the man page for the -a (no
align) option to mkdosfs.

Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:51:06 +01:00
Daniel Baumann
21d3f8192a Adding reference to dosfslable in mkdosfs manpage.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:51:05 +01:00
H. Peter Anvin
247ba068d4 mkdosfs: by default align all structures to cluster boundaries
Align all data structures (reserved sectors, FATs, root directory for
FAT12/16) to an even multiple of the cluster size. This means that if
the partition is aligned, so will all clusters be. This adds
significant performance for anything where the physical sector size is
larger than the logical sector size, e.g. flash media or large-sector
hard disks.

Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:51:04 +01:00
Daniel Baumann
171bc07b0c Releasing version 3.0.7.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:51:03 +01:00
Ben Hutchings
28708fc8a6 Fixing dosfslabel to set volume label in the right place,
see Debian bug #559985.

Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:51:02 +01:00
Lubomir Rintel
2c405dd8da Fixing out-of bound writes.
Firstly, packed attribute is added to the structure so that extension
is guarranteed to immediately follow name for the cross-name-extension
reads to succeed.

Secondly, writes into dir_entry->name that span through the extension as
well are split into two, so that FORTIFY_SOURCE's bound checking does
not abort dosfsck. There also was an off-by-one error in auto_rename()'s
sprintf().

Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:51:01 +01:00
San Mehat
b8f3efed9c Adding custom exit code in dosfsck for the case where the FS is read only.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:50:59 +01:00
Daniel Baumann
0657e01898 Releasing version 3.0.6.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:50:56 +01:00
Steven J. Magnani
bc84254457 Attempt to improve clarity of the orphan cluster reclaim code.
Minor optimization - remove some unnecessary checking.

Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:50:55 +01:00
Steven J. Magnani
8054b4a371 Close hole that permitted clusters to link to (invalid) cluster 1.
If an orphan chain that linked to cluster 1 was reclaimed to a file,
deletion of the file would result in a filesystem panic.

Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:50:51 +01:00
Steven J. Magnani
e51af88eed Fix erroneous report of huge number of clusters in use on big-endian
systems when the FSINFO free cluster count is reset.

Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
2013-01-23 12:50:49 +01:00