From bd5cd438f270c38b4d2e706ee4fdf8bc45458121 Mon Sep 17 00:00:00 2001 From: dg Date: Tue, 2 Aug 1994 12:54:27 +0000 Subject: [PATCH] Fixed so that it can grok old style "fastlinks". --- sbin/fsck/inode.c | 2 +- sbin/fsck/pass1.c | 2 +- sbin/fsck_ffs/inode.c | 2 +- sbin/fsck_ffs/pass1.c | 2 +- sbin/fsck_ifs/inode.c | 2 +- sbin/fsck_ifs/pass1.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sbin/fsck/inode.c b/sbin/fsck/inode.c index f1c1758f746a..381bfc0b4cf7 100644 --- a/sbin/fsck/inode.c +++ b/sbin/fsck/inode.c @@ -63,7 +63,7 @@ ckinode(dp, idesc) idesc->id_filesize = dp->di_size; mode = dp->di_mode & IFMT; if (mode == IFBLK || mode == IFCHR || (mode == IFLNK && - dp->di_size < sblock.fs_maxsymlinklen)) + (dp->di_size < sblock.fs_maxsymlinklen || dp->di_blocks == 0))) return (KEEPON); dino = *dp; ndb = howmany(dino.di_size, sblock.fs_bsize); diff --git a/sbin/fsck/pass1.c b/sbin/fsck/pass1.c index ca255fe78579..a3ab2f9842cd 100644 --- a/sbin/fsck/pass1.c +++ b/sbin/fsck/pass1.c @@ -160,7 +160,7 @@ checkinode(inumber, idesc) * Fake ndb value so direct/indirect block checks below * will detect any garbage after symlink string. */ - if (dp->di_size < sblock.fs_maxsymlinklen) { + if ((dp->di_size < sblock.fs_maxsymlinklen) || dp->di_blocks == 0) { ndb = howmany(dp->di_size, sizeof(daddr_t)); if (ndb > NDADDR) { j = ndb - NDADDR; diff --git a/sbin/fsck_ffs/inode.c b/sbin/fsck_ffs/inode.c index f1c1758f746a..381bfc0b4cf7 100644 --- a/sbin/fsck_ffs/inode.c +++ b/sbin/fsck_ffs/inode.c @@ -63,7 +63,7 @@ ckinode(dp, idesc) idesc->id_filesize = dp->di_size; mode = dp->di_mode & IFMT; if (mode == IFBLK || mode == IFCHR || (mode == IFLNK && - dp->di_size < sblock.fs_maxsymlinklen)) + (dp->di_size < sblock.fs_maxsymlinklen || dp->di_blocks == 0))) return (KEEPON); dino = *dp; ndb = howmany(dino.di_size, sblock.fs_bsize); diff --git a/sbin/fsck_ffs/pass1.c b/sbin/fsck_ffs/pass1.c index ca255fe78579..a3ab2f9842cd 100644 --- a/sbin/fsck_ffs/pass1.c +++ b/sbin/fsck_ffs/pass1.c @@ -160,7 +160,7 @@ checkinode(inumber, idesc) * Fake ndb value so direct/indirect block checks below * will detect any garbage after symlink string. */ - if (dp->di_size < sblock.fs_maxsymlinklen) { + if ((dp->di_size < sblock.fs_maxsymlinklen) || dp->di_blocks == 0) { ndb = howmany(dp->di_size, sizeof(daddr_t)); if (ndb > NDADDR) { j = ndb - NDADDR; diff --git a/sbin/fsck_ifs/inode.c b/sbin/fsck_ifs/inode.c index f1c1758f746a..381bfc0b4cf7 100644 --- a/sbin/fsck_ifs/inode.c +++ b/sbin/fsck_ifs/inode.c @@ -63,7 +63,7 @@ ckinode(dp, idesc) idesc->id_filesize = dp->di_size; mode = dp->di_mode & IFMT; if (mode == IFBLK || mode == IFCHR || (mode == IFLNK && - dp->di_size < sblock.fs_maxsymlinklen)) + (dp->di_size < sblock.fs_maxsymlinklen || dp->di_blocks == 0))) return (KEEPON); dino = *dp; ndb = howmany(dino.di_size, sblock.fs_bsize); diff --git a/sbin/fsck_ifs/pass1.c b/sbin/fsck_ifs/pass1.c index ca255fe78579..a3ab2f9842cd 100644 --- a/sbin/fsck_ifs/pass1.c +++ b/sbin/fsck_ifs/pass1.c @@ -160,7 +160,7 @@ checkinode(inumber, idesc) * Fake ndb value so direct/indirect block checks below * will detect any garbage after symlink string. */ - if (dp->di_size < sblock.fs_maxsymlinklen) { + if ((dp->di_size < sblock.fs_maxsymlinklen) || dp->di_blocks == 0) { ndb = howmany(dp->di_size, sizeof(daddr_t)); if (ndb > NDADDR) { j = ndb - NDADDR;