Ticket #72 (closed defect: fixed) — at Version 22

Opened 16 years ago

Last modified 11 years ago

savannah: "preserve Attributes" unchecked, but chmod errors still there

Reported by: bilboq Owned by: slavazanko
Priority: major Milestone: 4.7.0-pre1
Component: mc-vfs Version: master
Keywords: Cc:
Blocked By: Blocking:
Branch state: merged Votes for changeset:

Description (last modified by ossi) (diff)

Original: http://savannah.gnu.org/bugs/?21030

Submitted by:Martin Petricek <bilboq>Submitted on:Tue 11 Sep 2007 09:38:08 AM UTC
Category:CoreSeverity:3 - Normal
Status:In ProgressPrivacy:Public
Assigned to:Pavel Tsekov <ptsekov>Open/Closed:Open
Release:current (CVS or snapshot)Operating System:GNU/Linux

Original submission:

I have tried copying files from mounted FAT filesystem (memory card)
 to a NTFS filesystem (which was mounted using ntfs-3g over FUSE). I
unchecked "preserve Attributes" (as NTFS does not support 
chown/chmod)

But even with the preserve attributes unchecked I got following 
error message:

Cannot chmod target file "/m/s/eg/100_4646.jpg"
Operation not permitted (1)

on each of the files. I hoped to avoid this when I unchecked 
"preserve Attributes".

I am using CVS version of MC, checked out and recompiled just few 
minutes ago, running on debian unstable, amd64 architecture.

Comment 1 by Pavel Tsekov <ptsekov> at Thu 13 Sep 2007 09:35:30 AM UTC:

This problem has been discussed already in that thread:

http://mail.gnome.org/archives/mc-devel/2007-January/msg00075.html

I'll reread the thread and see whether to apply the suggested 
solution/workaround.

Comment 2 by Pavel Tsekov <ptsekov> at Thu 13 Sep 2007 12:49:30 PM UTC:

Please, test the attached patch.

(file #13935)

Comment 3 by Martin Petricek <bilboq> at Thu 13 Sep 2007 02:34:33 PM UTC:

Tried attached patch (file #13935) and it works for me. No more 
chmod complaints when "preserve attributes" unchecked when copying 
from FAT32 to NTFS partition. I have not observerd any ill effects 
from the patch.

Comment 4 by Pavel Tsekov <ptsekov> at Mon 17 Sep 2007 07:03:46 PM UTC:

I just have to think how to handle the EEXIST case from the patch 
and I'll commit it in CVS - hopefully it will get in 4.6.2. I'll 
appreciate it of anyone could help me with that and especially with 
the wording of the error message to be displayed to the user.

branch:72_preserve_attributes
changeset:5097e9b62ed28ada175a4cfc27eee3f823d7345b

Change History

Changed 16 years ago by slavazanko

added by ptsekov

comment:1 Changed 16 years ago by guanx

  • Keywords review added

This patch fixed two problems:

  1. When copying files, between mc's checking the target's non-existence and open(2)-ing the target file, (sym)link attack is possible.
  2. Even when "Preserve Attributes" is unchecked, permissions are still preserved.

comment:2 Changed 16 years ago by guanx

  • Milestone set to 4.6.3

comment:3 Changed 16 years ago by guanx

  • Owner set to guanx
  • Status changed from new to accepted

comment:4 Changed 16 years ago by metux

  • Owner changed from guanx to metux
  • Description modified (diff)

comment:5 Changed 16 years ago by angel_il

  • Owner changed from metux to angel_il

comment:6 Changed 16 years ago by angel_il

  • Status changed from accepted to assigned

comment:7 Changed 16 years ago by angel_il

this patch still actual? i think no.

comment:8 Changed 16 years ago by slavazanko

  • Milestone changed from 4.6.2.1 to 4.7

comment:9 Changed 16 years ago by slavazanko

  • Owner changed from angel_il to slavazanko
  • Status changed from assigned to accepted

Patch actual.

Now rebased to master.

Also, added automatic toggle 'Preserve attributes' checkbox (relative to type of target filesystem)

Review & vote, please.

comment:10 Changed 15 years ago by iNode

When checkbox 'Preserve attributes' unchecked file permissions also saved.
How to repeat:

touch test
umask 022
chmod 0600 test
F5 (without Preserve attributes checked)
ls -l %D/test

comment:11 Changed 15 years ago by slavazanko

  • Milestone changed from 4.7 to 4.7.0-pre1

comment:12 Changed 15 years ago by angel_il

branch: 72_preserve_attributes (parent: master)

comment:13 Changed 15 years ago by angel_il

  • Keywords vote-angel_il added
  • Version set to master

comment:15 Changed 15 years ago by iNode

  • Keywords rework added; review vote-angel_il removed

It's still doesn't work as described in case 2.

Please rework.

comment:16 Changed 15 years ago by slavazanko

  • Keywords rewiew added; rework removed

It's still doesn't work as described in case 2

changeset:f37120e8fc69a8e307f44b65e8f940f32f5b23a8

review

comment:17 Changed 15 years ago by angel_il

  • Keywords vote-angel_il added

comment:18 Changed 15 years ago by iNode

  • Keywords approved added; rewiew vote-angel_il removed

Now it work correct. Thanks.

comment:19 Changed 15 years ago by andrew_b

  • Keywords vote-angel_il vote-iNode added

comment:20 Changed 15 years ago by slavazanko

  • Keywords commited-master added; vote-angel_il vote-iNode approved removed
  • Status changed from accepted to testing
  • Resolution set to fixed

comment:21 Changed 15 years ago by slavazanko

  • Status changed from testing to closed

comment:22 Changed 11 years ago by ossi

  • Description modified (diff)
  • Branch state set to no branch
  • Reporter changed from slavazanko to bilboq
Note: See TracTickets for help on using tickets.