summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/files.ml12
-rw-r--r--src/test.ml15
2 files changed, 20 insertions, 7 deletions
diff --git a/src/files.ml b/src/files.ml
index 3728c92..41f6580 100644
--- a/src/files.ml
+++ b/src/files.ml
@@ -377,7 +377,8 @@ let rec createDirectories fspath localPath props =
createDirectories fspath parentPath rem;
try
let absolutePath = Fspath.concat fspath parentPath in
- Fs.mkdir absolutePath (Props.perms desc)
+ Fs.mkdir absolutePath (Props.perms desc);
+ Fileinfo.set fspath parentPath (`Copy parentPath) desc
(* The directory may have already been created
if there are several paths with the same prefix *)
with Unix.Unix_error (Unix.EEXIST, _, _) -> ()
@@ -452,15 +453,12 @@ let deleteSpuriousChildrenLocal (_, (fspathTo, pathTo, archChildren)) =
let deleteSpuriousChildren =
Remote.registerRootCmd "deleteSpuriousChildren" deleteSpuriousChildrenLocal
-let rec normalizePropsRec propsFrom propsTo =
+let rec normalizeProps propsFrom propsTo =
match propsFrom, propsTo with
- d :: r, d' :: r' -> normalizePropsRec r r'
- | _, [] -> propsFrom
+ d :: r, d' :: r' -> normalizeProps r r'
+ | _, [] -> (Safelist.rev propsFrom)
| [], _ :: _ -> assert false
-let normalizeProps propsFrom propsTo =
- normalizePropsRec (Safelist.rev propsFrom) (Safelist.rev propsTo)
-
(* ------------------------------------------------------------ *)
let copyReg = Lwt_util.make_region 50
diff --git a/src/test.ml b/src/test.ml
index 31ad7c9..94404ee 100644
--- a/src/test.ml
+++ b/src/test.ml
@@ -522,6 +522,21 @@ let test() =
put R1 (Dir ["y", Link "x"]); sync();
check "1" R2 orig;
);
+
+ (* Check for the bug reported by Sebastian Elsner (Jan 2017) *)
+ (* NOT POSSIBLE because the test API does not enable one to play with file
+ owners, but I put the test here anyway. *)
+ (*
+ runtest "owner of path directories" ["owner"; "path = a/b"] (fun() ->
+ put R1 (Dir ["a", Dir ["b", Dir["foo", File "Foo";
+ "bar", File "Bar";
+ "baz", File "Baz";]]]]);
+ setOwner R1 "a/b" "testuser"; (* does not exist *)
+ put R2 (Dir []);
+ sync();
+ checkOwner "1" R2 "a/b" "testuser"; (* does not exist *)
+ );
+ *)
end;
if !failures = 0 then