[Midnight Commander] #2924: [patch] copy_dir_dir: attributes of existing directories are never preserved

24 views
Skip to first unread message

Ticket System

unread,
Nov 5, 2012, 12:12:11 PM11/5/12
to sla...@a1.net, mc-...@googlegroups.com
#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

Ticket System

unread,
Nov 5, 2012, 12:56:41 PM11/5/12
to sla...@a1.net, mc-...@googlegroups.com
#2924: [patch] copy_dir_dir: attributes of existing directories are never
preserved
--------------------------+------------------------------
Reporter: slackmail | Owner:
Type: defect | Status: new
Priority: critical | Milestone: 4.8.7
Component: mc-core | Version: master
Resolution: | Keywords:
Blocked By: | Blocking:
Branch state: no branch | Votes for changeset:
--------------------------+------------------------------
Changes (by slackmail):

* priority: major => critical
* milestone: Future Releases => 4.8.7


--
Ticket URL: <http://www.midnight-commander.org/ticket/2924#comment:1>

Ticket System

unread,
Nov 25, 2012, 4:56:25 AM11/25/12
to sla...@a1.net, andrew....@gmail.com, mc-...@googlegroups.com
#2924: [patch] copy_dir_dir: attributes of existing directories are never
preserved
--------------------------+----------------------------------------
Reporter: slackmail | Owner: andrew_b
Type: defect | Status: accepted
Priority: critical | Milestone: 4.8.7
Component: mc-core | Version: master
Resolution: | Keywords: stable-candidate
Blocked By: | Blocking:
Branch state: on review | Votes for changeset:
--------------------------+----------------------------------------
Changes (by andrew_b):

* keywords: => stable-candidate
* owner: => andrew_b
* status: new => accepted
* branch_state: no branch => on review


Comment:

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

--
Ticket URL: <http://www.midnight-commander.org/ticket/2924#comment:2>

Ticket System

unread,
Nov 27, 2012, 10:40:34 AM11/27/12
to sla...@a1.net, andrew....@gmail.com, mc-...@googlegroups.com
#2924: [patch] copy_dir_dir: attributes of existing directories are never
preserved
--------------------------+----------------------------------------
Reporter: slackmail | Owner: andrew_b
Type: defect | Status: accepted
Priority: critical | Milestone: 4.8.7
Component: mc-core | Version: master
Resolution: | Keywords: stable-candidate
Blocked By: | Blocking:
Branch state: on review | Votes for changeset: angel_il
--------------------------+----------------------------------------
Changes (by angel_il):

* votes: => angel_il


--
Ticket URL: <http://www.midnight-commander.org/ticket/2924#comment:3>

Ticket System

unread,
Nov 28, 2012, 7:04:32 AM11/28/12
to sla...@a1.net, andrew....@gmail.com, mc-...@googlegroups.com, go...@polanet.pl
#2924: [patch] copy_dir_dir: attributes of existing directories are never
preserved
--------------------------+----------------------------------------
Reporter: slackmail | Owner: andrew_b
Type: defect | Status: accepted
Priority: critical | Milestone: 4.8.7
Component: mc-core | Version: master
Resolution: | Keywords: stable-candidate
Blocked By: | Blocking:
Branch state: on review | Votes for changeset: angel_il
--------------------------+----------------------------------------
Changes (by gotar):

* cc: gotar@… (added)


--
Ticket URL: <http://www.midnight-commander.org/ticket/2924#comment:4>

Ticket System

unread,
Nov 29, 2012, 5:39:23 AM11/29/12
to sla...@a1.net, andrew....@gmail.com, mc-...@googlegroups.com, go...@polanet.pl
#2924: [patch] copy_dir_dir: attributes of existing directories are never
preserved
--------------------------+-------------------------------------------
Reporter: slackmail | Owner: andrew_b
Type: defect | Status: accepted
Priority: critical | Milestone: 4.8.7
Component: mc-core | Version: master
Resolution: | Keywords: stable-candidate
Blocked By: | Blocking:
Branch state: approved | Votes for changeset: angel_il slavazanko
--------------------------+-------------------------------------------
Changes (by slavazanko):

* votes: angel_il => angel_il slavazanko
* branch_state: on review => approved


--
Ticket URL: <http://www.midnight-commander.org/ticket/2924#comment:5>

Ticket System

unread,
Nov 29, 2012, 5:46:49 AM11/29/12
to sla...@a1.net, andrew....@gmail.com, mc-...@googlegroups.com, go...@polanet.pl
#2924: [patch] copy_dir_dir: attributes of existing directories are never
preserved
--------------------------+----------------------------------------
Reporter: slackmail | Owner: andrew_b
Type: defect | Status: testing
Priority: critical | Milestone: 4.8.7
Component: mc-core | Version: master
Resolution: fixed | Keywords: stable-candidate
Blocked By: | Blocking:
Branch state: approved | Votes for changeset: committed-master
--------------------------+----------------------------------------
Changes (by andrew_b):

* status: accepted => testing
* votes: angel_il slavazanko => committed-master
* resolution: => fixed


Comment:

Merged to master: [f0d1d9186402bfca38962eeddef15b2c4c3967ca].
{{{
git log --pretty=oneline 4ee4959..f0d1d91
}}}

--
Ticket URL: <http://www.midnight-commander.org/ticket/2924#comment:6>

Ticket System

unread,
Nov 29, 2012, 5:49:14 AM11/29/12
to sla...@a1.net, andrew....@gmail.com, mc-...@googlegroups.com, go...@polanet.pl
#2924: [patch] copy_dir_dir: attributes of existing directories are never
preserved
-------------------------------------+-------------------------------------
Reporter: slackmail | Owner: andrew_b
Type: defect | Status: closed
Priority: critical | Milestone: 4.8.7
Component: mc-core | Version: master
Resolution: fixed | Keywords:
Blocked By: | Blocking:
Branch state: approved | Votes for changeset: committed-
| master committed-stable
-------------------------------------+-------------------------------------
Changes (by andrew_b):

* keywords: stable-candidate =>
* status: testing => closed
* votes: committed-master => committed-master committed-stable


Comment:

Merged to 4.8.1-stable: [65569af25546b2e4906f8429d0dd73c2d863fe56].
{{{
git log --pretty=oneline 52108b5..65569af
}}}

--
Ticket URL: <http://www.midnight-commander.org/ticket/2924#comment:7>

Ticket System

unread,
Jan 14, 2014, 5:34:56 AM1/14/14
to sla...@a1.net, andrew....@gmail.com, mc-...@googlegroups.com, go...@polanet.pl
#2924: [patch] copy_dir_dir: attributes of existing directories are never
preserved
-------------------------------------+-------------------------------------
Reporter: slackmail | Owner: andrew_b
Type: defect | Status: closed
Priority: critical | Milestone: 4.8.7
Component: mc-core | Version: master
Resolution: fixed | Keywords:
Blocked By: | Blocking:
Branch state: merged | Votes for changeset: committed-

| master committed-stable
-------------------------------------+-------------------------------------
Changes (by andrew_b):

* branch_state: approved => merged


--
Ticket URL: <http://www.midnight-commander.org/ticket/2924#comment:8>

Reply all
Reply to author
Forward
0 new messages