id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	blockedby	blocking	branch_state	votes
2924	[patch] copy_dir_dir: attributes of existing directories are never preserved	slackmail	andrew_b	"
Copying a directory tree (e.g. from a safe backup location (with sane permission, owner, group, timestamp) over an existing tree does not preserve ANY attributes.

- Found in version 4.8.x

After a little bit of playing with the source code I found two issues in ""src/filemanager/file.c""

- ""dest_dir_vpath"" remaines uninitialized if the directory exists because of the ""goto dont_mkdir;""
- ""goto dont_mkdir;"" jumps over the ""mc_chown"" block

So if the *superuser* copies a backup directory tree over an existing,
the following happens:

In 4.8.x:
 All destination dirs retain ALL their existing(!) attributes.
In older versions:
 All destination dirs get correct permissions and timestamp, but owner and group are unchanged.

The second bug really affects the superuser, as owner and group are normally preserved in this situation!

TIA, hope this gets fixed before any admins severely screw up any systems....

"	defect	closed	critical	4.8.7	mc-core	master	fixed		gotar@…			merged	committed-master committed-stable
