freebsd-dev/sbin/fsck
Bruce Evans cc52d04f9f Guard against a block size of 0 in the label. When the first
superblock is invalid, fsck looks at the label to help guess where
the next superblock should be.  If the partition type is 4.2BSD,
fsck assumed that the block size was valid and divided by it, so
it dumped core if the size was 0.

Initialization of the label was broken almost 3 years ago in rev.1.9
of newfs/newfs.c.  Newfs does not change the label at all, so there
is no problem (except the breakage of the automatic search for
backup superblocks) unless something else sets the partition type
to 4.2BSD.  However, it is too easy to set partition types to
4.2.BSD by copying an old label or by using a disktab entry to
create the label.

PR:	2537
1998-01-19 16:28:29 +00:00
..
SMM.doc Fix the case where fsck would not see sparse directories and the kernel would 1996-10-08 14:54:53 +00:00
dir.c Finished (?) merging with Lite2: cleaned up #include mess. 1997-03-12 16:49:28 +00:00
fsck.8 Restored lost reference to fsdb(8). 1997-03-12 16:35:26 +00:00
fsck.h Merge from Lite2. Note that Lite2 has it's own filesystem clean check 1997-03-11 12:20:21 +00:00
inode.c Fixed overflow in chkrange(). Some out of bounds block numbers, 1997-12-21 00:00:44 +00:00
main.c Fixed style bugs in the printing of statistics after preening. Use 1997-12-20 22:24:32 +00:00
Makefile Merge from Lite2. Note that Lite2 has it's own filesystem clean check 1997-03-11 12:20:21 +00:00
pass1.c Restore check for ridiculous directory sizes. 1997-03-18 19:53:54 +00:00
pass1b.c Merge from Lite2. Note that Lite2 has it's own filesystem clean check 1997-03-11 12:20:21 +00:00
pass2.c Finished (?) merging with Lite2: cleaned up #include mess. 1997-03-12 17:01:11 +00:00
pass3.c Merge from Lite2. Note that Lite2 has it's own filesystem clean check 1997-03-11 12:20:21 +00:00
pass4.c Merge from Lite2. Note that Lite2 has it's own filesystem clean check 1997-03-11 12:20:21 +00:00
pass5.c Finished (?) merging with Lite2: cleaned up #include mess. 1997-03-12 17:01:11 +00:00
preen.c Finished (?) merging with Lite2: cleaned up #include mess. 1997-03-12 16:58:35 +00:00
setup.c Guard against a block size of 0 in the label. When the first 1998-01-19 16:28:29 +00:00
utilities.c Finished (?) merging with Lite2: cleaned up #include mess. 1997-03-12 17:01:11 +00:00