summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>1999-02-26 16:35:33 +0000
committermillert <millert@openbsd.org>1999-02-26 16:35:33 +0000
commit4592dbef082ec2a1fdfa5f1e350442bd406234ee (patch)
tree8c42846de58467e4d7fed97a87f7188d053f2e49
parentdocument that the max value for the -n option is 20 (diff)
downloadwireguard-openbsd-4592dbef082ec2a1fdfa5f1e350442bd406234ee.tar.xz
wireguard-openbsd-4592dbef082ec2a1fdfa5f1e350442bd406234ee.zip
ext2fs is missing a LINK_MAX check too
-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);