Ticket #2924 (closed defect: fixed)

Opened 6 years ago

Last modified 5 years ago

[patch] copy_dir_dir: attributes of existing directories are never preserved

Reported by: slackmail Owned by: andrew_b
Priority: critical Milestone: 4.8.7
Component: mc-core Version: master
Keywords: Cc: gotar@…
Blocked By: Blocking:
Branch state: merged Votes for changeset: committed-master committed-stable

Description

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....

Attachments

file.c_preserve_dir_attributes.diff (642 bytes) - added by slackmail 6 years ago.

Change History

Changed 6 years ago by slackmail

comment:1 Changed 6 years ago by slackmail

  • Priority changed from major to critical
  • Milestone changed from Future Releases to 4.8.7

comment:2 Changed 6 years ago by andrew_b

  • Status changed from new to accepted
  • Keywords stable-candidate added
  • Owner set to andrew_b
  • Branch state changed from no branch to on review

Branch: 2924_preserve_dir_attributes (parent: master).
Initial changeset:48d2026dc23d42c4db45b93bd1dcbc53146b945e

comment:3 Changed 6 years ago by angel_il

  • Votes for changeset set to angel_il

comment:4 Changed 6 years ago by gotar

  • Cc gotar@… added

comment:5 Changed 6 years ago by slavazanko

  • Votes for changeset changed from angel_il to angel_il slavazanko
  • Branch state changed from on review to approved

comment:6 Changed 6 years ago by andrew_b

  • Status changed from accepted to testing
  • Votes for changeset changed from angel_il slavazanko to committed-master
  • Resolution set to fixed

Merged to master: [f0d1d9186402bfca38962eeddef15b2c4c3967ca].

git log --pretty=oneline 4ee4959..f0d1d91

comment:7 Changed 6 years ago by andrew_b

  • Keywords stable-candidate removed
  • Status changed from testing to closed
  • Votes for changeset changed from committed-master to committed-master committed-stable

Merged to 4.8.1-stable: [65569af25546b2e4906f8429d0dd73c2d863fe56].

git log --pretty=oneline 52108b5..65569af

comment:8 Changed 5 years ago by andrew_b

  • Branch state changed from approved to merged
Note: See TracTickets for help on using tickets.