Commit Graph

29 Commits

Author SHA1 Message Date
christos 699f31f847 Another infinite loop fix from OpenBSD from Tobias Stoeckmann:
You can download a "proof of concept" from my website:
http://www.stoeckmann.org/openbsd/poc.iso.

Take FAT1 and it'll infinitely loop.  This fix will complete
your previous commit.
2014-07-11 14:59:53 +00:00
christos ffdedd8608 Bring in a regression for the previous fix from OpenBSD 2014-07-10 21:00:52 +00:00
christos d7660c3645 From: http://marc.info/?l=openbsd-tech&m=140234174104724&w=2
Avoid off-by-one on FAT12 filesystems.
2014-07-07 18:46:45 +00:00
christos 468753370f From: http://marc.info/?l=openbsd-tech&m=140275150804337&w=2
Avoid infinite loops in cluster chain linked lists.
2014-07-07 17:55:53 +00:00
christos be4e2ccbba From: http://marc.info/?t=140304310700005&r=1&w=2
When truncating cluster chains fix the length of the cluster head.
2014-07-07 17:45:42 +00:00
jakllsch ec5e5d471b An uninitialized next-free-cluster value in the file system information
block is valid; do not consider it for correction.
2013-01-17 16:45:48 +00:00
jakllsch da6f244356 The free space value in the FSInfo block is merely unitialized when it is
0xffffffff.  Fixes first part of bin/46743
2012-08-07 19:30:41 +00:00
lukem a2b5923e3e fix sign-compare issues 2009-04-11 06:59:18 +00:00
matthias f0f728186b Do not crash when boot->FSNext contains garbage (i.e. -1). 2008-07-24 14:23:16 +00:00
martin b47f782db6 Move to 2 clause license, approved by Wolfgang Solfrank. 2008-06-13 20:46:09 +00:00
christos c4c1a29bd4 don't use uint32_t when you mean size_t. 2006-06-06 16:19:11 +00:00
christos 15f3040f9f - don't leak memory on allocation failure.
- s/perror/perr and print how much we were trying to allocate.
2006-06-05 16:51:18 +00:00
christos 4b15f35af4 Coverity CID 2302: Free fat if fatal error to avoid leak. 2006-03-20 01:42:47 +00:00
xtraeme 65e67723b5 Kill __P(), ANSIfy, remove main() prototype. 2005-01-19 20:00:45 +00:00
matt 25b98a109b Eliminate a -Wshadow warning 2003-02-28 05:50:33 +00:00
wiz 8e78c80273 Make WARNS=2 safe, and set WARNS to 2. 2001-04-06 16:52:41 +00:00
lukem ca48483336 minor knf 2001-01-05 01:41:34 +00:00
is 9979da6cbb Format string cleanups by Bill Sommerfeld. 2000-10-10 20:24:49 +00:00
jdolecek fe6381bfd1 add a prototype for _readfat() added in last commit and make it static, so
that it's possible to compile this with -Wstrict-prototypes -Wmissing-prototypes

Breakage reported by Jeff Rizzo <riz@boogers.sf.ca.us> on current-users.
2000-04-26 16:45:02 +00:00
jdolecek 4ab4989737 Recognize "dirty" signature on FAT as set by Windows 95 OSR2+ and don't report
it just as "odd byte sequence". Handle the dirty flag similar way
it's treated on e.g. FFS - e.g. clear it separately from rest of FAT.
Changing of FAT is now postponed until after all checks are done,
check.c:checkfilesys() was cleaned considerably and several messages
has been adjusted to be more accurate.

If file system was modified and no error has occured, just return 0
instead of 4 - there is no need for forcing a reboot in this case.

This addresses bin/5638 by Christos Zoulas.
2000-04-25 23:02:51 +00:00
ws c17a22a40a Fix some bugs & annoyances when reparing defect disks 1998-01-22 18:48:43 +00:00
ws d445160e23 Add support for FAT32
Support dropping lost cluster chains (on request by Christoph Badura)
While being here, fix some minor bugs, mostly with format strings
1997-10-17 11:19:23 +00:00
lukem 5a94f6748f * cleanup for WARNS=1
* getopt returns -1 not EOF
* cleanup manpage
1997-09-14 14:40:10 +00:00
ws daa7d68f2a Fix a few bugs, especially when repairing disks:
Print correct pathname in error messages
Fix unterminating loop when trying to correct a bad fat
Require fat media byte to be the same as the one in the bpb
Fix unterminating loop when looking for free directory slot in LOST.DIR
(bad disk image provided by Christoph Badura)
1997-09-08 14:05:30 +00:00
ws fdbcbfc254 Fix handling of clusters marked bad
Noted by Rafal Boni
1997-01-03 14:32:47 +00:00
christos a0c84e7de2 util -> fsutil 1996-09-27 23:22:50 +00:00
christos 442314ab53 - use error printing code from fsck(8)
- remove fstab walking code
- add missing prototypes
- add missing argument in dir.c near "Truncate", where delete() was being
  called with fewer args. I think the missing argument should be a zero,
  but Wolfgang should check...
1996-09-23 16:27:56 +00:00
ws 25e3d62e87 Don't allocate data structures for non-directories
Free any data structures when finishing a check (at the latest)
1996-05-28 19:51:11 +00:00
ws 6ae4c91a82 Add fsck utility for msdosfs 1996-05-14 17:39:21 +00:00