summaryrefslogtreecommitdiff
path: root/libdiskfs
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2013-07-07 23:33:50 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2013-07-07 23:33:50 +0200
commit1fa4f9cb2e24794edb8dfcb5a566ec118f11763b (patch)
tree9198c19650f1536ccf6fa4d8382e70c5a29abca7 /libdiskfs
parent272cf0e4d15d927b692387d17c4cfa35d023ae63 (diff)
Fix directory rename in firmlinked directory
checkpath browses directories up to look against renaming a directory into itself. It used to assume being able to stop at the root of the filesystem. But some per-opens have a shadow_root, where recursion has to stop too. This means checkpath does not check up to the root any more. This is fine, since we already prevent cross-shadow-root renames very early in dir-rename.c, we do not need to check outside of this shadow root. * libdiskfs/dir-renamed.c (checkpath): Also stop at the per-open shadow_root.
Diffstat (limited to 'libdiskfs')
-rw-r--r--libdiskfs/dir-renamed.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libdiskfs/dir-renamed.c b/libdiskfs/dir-renamed.c
index 3990b138..d73dc282 100644
--- a/libdiskfs/dir-renamed.c
+++ b/libdiskfs/dir-renamed.c
@@ -50,7 +50,7 @@ checkpath(struct node *source,
return EINVAL;
}
- if (np == diskfs_root_node)
+ if (np == diskfs_root_node || np == cred->po->shadow_root)
{
diskfs_nput (np);
return 0;