NetBSD/sbin/fsck_ffs
lukem 1b81d6353d remove third argument (`int ns') from ffs_sb_swap(), and let ffs_sb_swap()
determine the endianness of the `struct fs *o' superblock from o->fs_magic
and set needswap as necessary, rather than trusting the caller to get
it right.  invariably, almost every caller of ffs_sb_swap() was calling it
with ns set to the wrong value for ns anyway!
ansi KNF ffs_bswap.c declarations whilst here.

this fixes all sorts of problems when trying to use other-endian file systems,
notably the kernel trying to access memory *way* off, possibly corrupting or
panicing, and userland programs SEGVing and/or corrupting things (e.g,
"fsck_ffs -B"  to swap a file system endianness).

whilst the previous rev of ffs_bswap.c (1.10, 2000/12/23) made this problem
worse, i suspect that the problem was always there and previous versions
just happened not to trash things at the wrong time.

FFS_EI should now be a lot more stable.
2001-08-17 02:18:46 +00:00
..
SMM.doc Bug fix from Kirk McKusick <mckusick@McKusick.COM>: 1996-10-11 20:15:46 +00:00
dir.c Fix a rather glaring byte-swapping bug: di_size is 64 bits, not 16. 2001-01-23 02:35:51 +00:00
extern.h remove redundant declarations 2001-02-04 21:25:54 +00:00
fsck_ffs.8 - implement -F; treat provided filesystems as images in regular files 2001-08-15 03:54:53 +00:00
fsck.h remove third argument (`int ns') from ffs_sb_swap(), and let ffs_sb_swap() 2001-08-17 02:18:46 +00:00
inode.c use %ll_ instead of the less standard %q_ 2001-01-05 02:02:57 +00:00
main.c - implement -F; treat provided filesystems as images in regular files 2001-08-15 03:54:53 +00:00
Makefile #include machine/bswap.h and remove -lutil. 1999-01-15 13:32:05 +00:00
pass1.c use %ll_ instead of the less standard %q_ 2001-01-05 02:02:57 +00:00
pass1b.c Add support for non-native byteorder FFS, and converting byteorder. 1998-03-18 17:01:23 +00:00
pass2.c The reconnect algorithm was historically O(n^4). 2001-01-09 05:51:14 +00:00
pass3.c Abstract the code to attach a directory to its parent's child list into a 2001-01-10 08:22:20 +00:00
pass4.c - don't indiscriminately include <stdlib.h> and <unistd.h> in "fsck.h" 1997-09-20 06:16:23 +00:00
pass5.c remove third argument (`int ns') from ffs_sb_swap(), and let ffs_sb_swap() 2001-08-17 02:18:46 +00:00
setup.c remove third argument (`int ns') from ffs_sb_swap(), and let ffs_sb_swap() 2001-08-17 02:18:46 +00:00
utilities.c - implement -F; treat provided filesystems as images in regular files 2001-08-15 03:54:53 +00:00