#2924: [patch] copy_dir_dir: attributes of existing directories are never
preserved
---------------------------------+--------------------------------
Reporter: slackmail | Owner:
Type: defect | Status: new
Priority: major | Milestone: Future Releases
Component: mc-core | Version: master
Keywords: | Blocked By:
Blocking: | Branch state: no branch
Votes for changeset: |
---------------------------------+--------------------------------
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....
--
Ticket URL: <http://www.midnight-commander.org/ticket/2924>
Midnight Commander <http://www.midnight-commander.org>
Midnight Development Center