summaryrefslogtreecommitdiff
path: root/sys/ufs
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1999-02-26 16:35:34 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1999-02-26 16:35:34 +0000
commited730bf4e3f6e7f647c18257936abfa1e63940f0 (patch)
tree796ebc91ad28755b90792fd1fb184b499a9adcf5 /sys/ufs
parent8390ff832499783fe0da5b7eb47fcb4c5c2b4e07 (diff)
ext2fs is missing a LINK_MAX check too
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ext2fs/ext2fs_vnops.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/ufs/ext2fs/ext2fs_vnops.c b/sys/ufs/ext2fs/ext2fs_vnops.c
index 74f14ebffce..8348a54b15d 100644
--- a/sys/ufs/ext2fs/ext2fs_vnops.c
+++ b/sys/ufs/ext2fs/ext2fs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ext2fs_vnops.c,v 1.9 1999/02/26 03:22:00 art Exp $ */
+/* $OpenBSD: ext2fs_vnops.c,v 1.10 1999/02/26 16:35:33 millert Exp $ */
/* $NetBSD: ext2fs_vnops.c,v 1.1 1997/06/11 09:34:09 bouyer Exp $ */
/*
@@ -650,6 +650,11 @@ abortit:
goto abortit;
dp = VTOI(fdvp);
ip = VTOI(fvp);
+ if ((nlink_t)ip->i_e2fs_nlink >= LINK_MAX) {
+ VOP_UNLOCK(fvp, 0, p);
+ error = EMLINK;
+ goto abortit;
+ }
if ((ip->i_e2fs_flags & (EXT2_IMMUTABLE | EXT2_APPEND)) ||
(dp->i_e2fs_flags & EXT2_APPEND)) {
VOP_UNLOCK(fvp, 0, p);