From 1fa4f9cb2e24794edb8dfcb5a566ec118f11763b Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sun, 7 Jul 2013 23:33:50 +0200 Subject: 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. --- libdiskfs/dir-renamed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libdiskfs') 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; -- cgit v1.2.3