From 82cfece6aeeefc738b7a638181cac0ab142e0088 Mon Sep 17 00:00:00 2001 From: Slack Date: Sun, 25 Nov 2012 13:39:44 +0400 Subject: [PATCH] Ticket #2924: attributes of existing directories are never preserved. If superuser copies a directory tree (e.g. from a safe backup location (with sane permission, owner, group, timestamp) over an existing tree, any attributes are not preserved. All destination dirs retain all their existing attributes instead of change attributes from source. Signed-off-by: Andrew Borodin --- src/filemanager/file.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/filemanager/file.c b/src/filemanager/file.c index 2586a401c..7d0cdfb58 100644 --- a/src/filemanager/file.c +++ b/src/filemanager/file.c @@ -2066,6 +2066,7 @@ copy_dir_dir (FileOpTotalContext * tctx, FileOpContext * ctx, const char *s, con { dest_dir = d; d = NULL; + dest_dir_vpath = vfs_path_from_str (dest_dir); goto dont_mkdir; } } @@ -2091,6 +2092,7 @@ copy_dir_dir (FileOpTotalContext * tctx, FileOpContext * ctx, const char *s, con lp->dev = buf.st_dev; dest_dirs = g_slist_prepend (dest_dirs, lp); + dont_mkdir: if (ctx->preserve_uidgid) { while (mc_chown (dest_dir_vpath, cbuf.st_uid, cbuf.st_gid) != 0) @@ -2109,7 +2111,6 @@ copy_dir_dir (FileOpTotalContext * tctx, FileOpContext * ctx, const char *s, con } } - dont_mkdir: /* open the source dir for reading */ reading = mc_opendir (src_vpath); if (reading == NULL) -- 2.11.4.GIT