diff --git a/sbin/fsck_ext2fs/dir.c b/sbin/fsck_ext2fs/dir.c index 9ebdafd437df..308cf8b5b4cd 100644 --- a/sbin/fsck_ext2fs/dir.c +++ b/sbin/fsck_ext2fs/dir.c @@ -1,4 +1,4 @@ -/* $NetBSD: dir.c,v 1.5 2000/01/28 16:01:46 bouyer Exp $ */ +/* $NetBSD: dir.c,v 1.6 2002/05/09 02:55:49 simonb Exp $ */ /* * Copyright (c) 1997 Manuel Bouyer. @@ -39,7 +39,7 @@ #if 0 static char sccsid[] = "@(#)dir.c 8.5 (Berkeley) 12/8/94"; #else -__RCSID("$NetBSD: dir.c,v 1.5 2000/01/28 16:01:46 bouyer Exp $"); +__RCSID("$NetBSD: dir.c,v 1.6 2002/05/09 02:55:49 simonb Exp $"); #endif #endif /* not lint */ @@ -251,8 +251,8 @@ dircheck(idesc, dp) return (1); size = EXT2FS_DIRSIZ(dp->e2d_namlen); if (reclen < size || - idesc->id_filesize < size || - dp->e2d_namlen > EXT2FS_MAXNAMLEN) + idesc->id_filesize < size /* || + dp->e2d_namlen > EXT2FS_MAXNAMLEN */) return (0); for (cp = dp->e2d_name, size = 0; size < dp->e2d_namlen; size++) if (*cp == '\0' || (*cp++ == '/')) diff --git a/sbin/fsck_ffs/dir.c b/sbin/fsck_ffs/dir.c index 3b7cc0b6bc27..cee0307c8862 100644 --- a/sbin/fsck_ffs/dir.c +++ b/sbin/fsck_ffs/dir.c @@ -1,4 +1,4 @@ -/* $NetBSD: dir.c,v 1.32 2001/01/23 02:35:51 mycroft Exp $ */ +/* $NetBSD: dir.c,v 1.33 2002/05/09 02:55:50 simonb Exp $ */ /* * Copyright (c) 1980, 1986, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)dir.c 8.8 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: dir.c,v 1.32 2001/01/23 02:35:51 mycroft Exp $"); +__RCSID("$NetBSD: dir.c,v 1.33 2002/05/09 02:55:50 simonb Exp $"); #endif #endif /* not lint */ @@ -326,7 +326,7 @@ dircheck(idesc, dp) } if (iswap16(dp->d_reclen) < size || idesc->id_filesize < size || - namlen > MAXNAMLEN || + /* namlen > MAXNAMLEN || */ type > 15) return (0); for (cp = dp->d_name, size = 0; size < namlen; size++) diff --git a/sbin/fsck_lfs/dir.c b/sbin/fsck_lfs/dir.c index 2536fd644690..d38d21605f27 100644 --- a/sbin/fsck_lfs/dir.c +++ b/sbin/fsck_lfs/dir.c @@ -1,4 +1,4 @@ -/* $NetBSD: dir.c,v 1.5 2001/07/13 20:30:18 perseant Exp $ */ +/* $NetBSD: dir.c,v 1.6 2002/05/09 02:55:50 simonb Exp $ */ /* * Copyright (c) 1980, 1986, 1993 @@ -265,7 +265,7 @@ dircheck(struct inodesc * idesc, struct direct * dp) # endif if (dp->d_reclen < size || idesc->id_filesize < size || - namlen > MAXNAMLEN || + /* namlen > MAXNAMLEN || */ type > 15) { printf("reclen15\n"); return (0); diff --git a/sbin/restore/dirs.c b/sbin/restore/dirs.c index 376d2f456e49..b8f1b862608b 100644 --- a/sbin/restore/dirs.c +++ b/sbin/restore/dirs.c @@ -1,4 +1,4 @@ -/* $NetBSD: dirs.c,v 1.36 2002/01/04 06:48:49 lukem Exp $ */ +/* $NetBSD: dirs.c,v 1.37 2002/05/09 02:55:50 simonb Exp $ */ /* * Copyright (c) 1983, 1993 @@ -43,7 +43,7 @@ #if 0 static char sccsid[] = "@(#)dirs.c 8.7 (Berkeley) 5/1/95"; #else -__RCSID("$NetBSD: dirs.c,v 1.36 2002/01/04 06:48:49 lukem Exp $"); +__RCSID("$NetBSD: dirs.c,v 1.37 2002/05/09 02:55:50 simonb Exp $"); #endif #endif /* not lint */ @@ -384,8 +384,8 @@ putdir(buf, size) i = DIRBLKSIZ - (loc & (DIRBLKSIZ - 1)); if ((dp->d_reclen & 0x3) != 0 || dp->d_reclen > i || - dp->d_reclen < DIRSIZ(0, dp, 0) || - dp->d_namlen > NAME_MAX) { + dp->d_reclen < DIRSIZ(0, dp, 0) /* || + dp->d_namlen > NAME_MAX */) { vprintf(stdout, "Mangled directory: "); if ((dp->d_reclen & 0x3) != 0) vprintf(stdout, @@ -394,10 +394,12 @@ putdir(buf, size) vprintf(stdout, "reclen less than DIRSIZ (%d < %lu) ", dp->d_reclen, (u_long)DIRSIZ(0, dp, 0)); +#if 0 /* dp->d_namlen is a uint8_t, always < NAME_MAX */ if (dp->d_namlen > NAME_MAX) vprintf(stdout, "reclen name too big (%d > %d) ", dp->d_namlen, NAME_MAX); +#endif vprintf(stdout, "\n"); loc += i; continue;