christos
d3037dba83
fix error messages containing \n
2015-06-16 23:18:54 +00:00
mlelstv
d15e4a5d5d
Avoid mixing cluster numbers and sector numbers. Makes code more readable.
2015-01-02 06:21:28 +00:00
msaitoh
48b712a059
Add #include <inttypes.h> for intmax_t to fix compile error.
2014-11-04 03:05:43 +00:00
jakllsch
d8015429ba
ClusterOffset actually needs to be able to be negative.
2014-11-03 18:55:04 +00:00
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
698f62dfb8
Well, if you set FSFIXFAT, better do it... Try running fsck on:
...
$ newfs_msdos -C 1M ./poc.fs
$ dd if=/dev/zero of=poc.fs conv=notrunc bs=1 count=1 seek=512
multiple times and see that it does not get fixed.
2014-07-10 21:06:20 +00:00
christos
ffdedd8608
Bring in a regression for the previous fix from OpenBSD
2014-07-10 21:00:52 +00:00
christos
0a21325ef0
From: http://marc.info/?l=openbsd-tech&m=140354518512871&w=2
...
more consistency checks
2014-07-07 19:04:37 +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
christos
453164da22
fix compilation.
2011-06-09 21:23:29 +00:00
christos
6df320733c
undo part of the previous patch, which I suspect is bad.
2011-02-20 21:42:50 +00:00
christos
b805ecec3f
PR/44529: Martin Danielsson: fsck_msdos crashes when verifying corrupt file
...
system. Avoid using the long name index when it is 0. Refactor the code to
avoid duplication.
2011-02-07 17:36:42 +00:00
wiz
c4f8f360fc
New sentence, new line. Sort SEE ALSO.
...
Improve formatting of option list.
2010-04-11 21:29:37 +00:00
hannken
738a97ca87
Add -x option which allows to run `fsck_msdos -n' on a snapshot of
...
a live file system.
While here modify snap_open() to accept a character device as its
first arg and remove now unneeded get_snap_device().
Reviewed by: Manuel Bouyer <bouyer@netbsd.org>
2010-04-11 08:23:51 +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
358764c860
Catch signals and exit with the proper error code like all the other fsck
...
programs.
2008-02-24 00:59:03 +00:00
christos
742b48d55e
Make sure that the exit values are always sane, and use symbolic instead
...
of magic constants. Reviewed by go@
2008-02-23 21:41:47 +00:00
gdt
9da1e4cf5f
Change mismatch of bytes 11 to 90 to be a warning, not an error, and
...
print out the values of the bytes that do not match.
Add comment explaining that there is no documented rationale for the
check.
fsck_msdos checks that several bytes are equal in the primary and
backup bootblock. There is no documented rationale. The kernel does
not enforce this when mounting a filesystem. I have a FAT32
filesystem on my disk (mounted as /share) which fails this check, but
is accepted by both Windows XP and NetBSD. My volume differs in bytes
71-81. The primary contains "SHARE " and the backup NUL bytes.
Further, fsck_msdos does not have code to repair the mismatch. As a
result such filesystems can be used not checked.
2007-03-19 18:30:40 +00:00
hubertf
d8a2863966
- removes unused ctype.h header
...
- correct comment in mount_nfs/getnfsargs.c: s/Nead/Need/
From: Slava Semushin <php-coder@altlinux.ru>
2007-03-10 00:30:36 +00:00
hubertf
df06563bc3
Remove more duplicate #includes,
...
from Slava Semushin <slava.semushin@gmail.com>
2007-01-17 21:59:49 +00:00
christos
2a1607d040
Programs that use efun.
2006-08-26 18:14:28 +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
dbj
a015786b0d
the root directory of non fat32 filesystems is stored in a special area.
...
a couple of corner cases can cause it to fail to write out that area
after it performs repairs.
2006-04-10 03:25:11 +00:00
christos
4b15f35af4
Coverity CID 2302: Free fat if fatal error to avoid leak.
2006-03-20 01:42:47 +00:00
christos
e5919d97fc
Coverity CID 1078: Add assertion check for NULL pointer.
2006-03-20 01:25:14 +00:00
xtraeme
76500fc2f9
WARNS=2 is the default defined in sbin/Makefile.inc. (thanks wiz)
2005-01-20 16:39:22 +00:00
xtraeme
65e67723b5
Kill __P(), ANSIfy, remove main() prototype.
2005-01-19 20:00:45 +00:00
christos
a73c2bd574
Add a progress meter to fsck_ffs based on the work by thorpej presented
...
to the mailing lists last January. This is optional.
2005-01-13 15:22:35 +00:00
jmmv
b635f565e7
Homogenize usage messages: make the 'usage' word all lowercase, as this seems
...
to be the most common practice in our tree.
2004-01-05 23:23:32 +00:00
dsl
e69ce3e4bf
Add a -q (quiet) option to print nothing for clean filesystems.
...
Support in fsck_ffs and stub in fsck_xxx.
Push a few more messages through pwarn() instead of printf() to ensure
disk name is shown.
2003-10-20 12:04:38 +00:00
ws
ebd1f55e89
Only compare the interesting part of the bootblock with its backup.
2003-07-24 19:25:46 +00:00
itojun
0e4dc5229d
use bounded string op
2003-07-13 08:16:15 +00:00
matt
25b98a109b
Eliminate a -Wshadow warning
2003-02-28 05:50:33 +00:00
wiz
990562bfef
.Nm does not need a dummy argument ("") before punctuation or
...
for correct formatting of the SYNOPSIS any longer.
2003-02-25 10:34:36 +00:00
wiz
2fb4b1db52
New sentence, new line. By Robert Elz with minimal fixes.
2002-10-01 13:40:23 +00:00
lukem
7360d7b6ae
Use ${NETBSDSRCDIR}/some/path instead of ${.CURDIR}/../../some/path
2002-08-19 10:16:51 +00:00
wiz
c632c8bea4
__STDC__ is always defined on NetBSD.
2002-05-25 23:45:12 +00:00
augustss
da3c0f78d9
Allow check to proceed with bad backup boot block if we're doing a readonly
...
check.
2001-12-22 17:25:20 +00:00
wiz
8d4080ddcb
Drop an unnecessary .Pp.
2001-11-16 11:36:33 +00:00
wiz
4c99916337
va_{start,end} audit:
...
Make sure that each va_start has one and only one matching va_end,
especially in error cases.
If the va_list is used multiple times, do multiple va_starts/va_ends.
If a function gets va_list as argument, don't let it use va_end (since
it's the callers responsibility).
Improved by comments from enami and christos -- thanks!
Heimdal/krb4/KAME changes already fed back, rest to follow.
Inspired by, but not not based on, OpenBSD.
2001-09-24 13:22:25 +00:00
wiz
456dff6cb8
Spell 'occurred' with two 'r's.
2001-09-16 16:34:23 +00:00
wiz
30b2bf87ed
Various typos in comments (neccessary, sceme, choise, ...).
2001-07-26 15:05:07 +00:00
wiz
73f545bb5b
Drop arguments of .Os.
2001-06-05 11:22:41 +00:00