summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Pierre André <jpandre@users.sourceforge.net>2012-08-22 10:00:22 +0200
committerJean-Pierre André <jpandre@users.sourceforge.net>2012-08-22 10:00:22 +0200
commitd4a42629caa85f9b8f197b15aba5b287f1f16f82 (patch)
tree601579dd94853e579f6160ac6e218d8e487e31e0
parent7f9a18e883a5318f45fd1f6bad702a2fb02087ce (diff)
downloadillumos-fusefs-d4a42629caa85f9b8f197b15aba5b287f1f16f82.tar.gz
Made sure directories are not hard linked
-rw-r--r--kernel/fuse_vnops.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/fuse_vnops.c b/kernel/fuse_vnops.c
index 4a76712..06c67aa 100644
--- a/kernel/fuse_vnops.c
+++ b/kernel/fuse_vnops.c
@@ -1623,6 +1623,9 @@ fuse_link(struct vnode *dvp, struct vnode *srcvp, char *tnm,
struct vnode *, dvp);
return (ENODEV);
}
+ /* Directories cannot be linked */
+ if (srcvp->v_type == VDIR)
+ return (EPERM);
msgp = fuse_setup_message(sizeof (*fli) + nmlen, FUSE_LINK,
VNODE_TO_NODEID(dvp), credp, FUSE_GET_UNIQUE(sep));