Ticket #71 (closed defect: fixed)

Opened 16 years ago

Last modified 11 years ago

savannah: Skip vs. Abort on multi-file/dir operation

Reported by: zlatk0 Owned by: andrew_b
Priority: major Milestone: 4.8.1
Component: mc-core Version: master
Keywords: Cc: m-c.org@…, zlatko-m-c-org@…
Blocked By: Blocking:
Branch state: merged Votes for changeset: committed-master

Description (last modified by ossi) (diff)

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

Submitted by:Thomas Zajic <ZlatkO>Submitted on:Sat 16 Jun 2007 08:47:06 AM UTC
Category:CoreSeverity:3 - Normal
Status:ConfirmedPrivacy:Public
Assigned to:NoneOpen/Closed:Open
Release:current (CVS or snapshot)Operating System:GNU/Linux

Original submission:

When mc encounters an error (eg. permission denied) while operating 
on multiple files and/or directories (eg. move, delete), it presents
an error dialog stating the problem and offers "Skip, Retry, Abort",
 which is fine.

However, if you chose "Skip", it actually does the same as if you 
had chosen "Abort", ie. it cancels the whole operation instead of 
actually skipping the problem file/directory and going on with the 
rest. This is especially annoying if you want to delete a huge 
directory tree which happens to have a few files strewn in that 
belong to a different user.

To reproduce, copy a directory tree as a user, change a few file 
ownerships and permissions somewhere within the tree, then go back 
to the top of the directory structure and hit F8. This has been 
bugging me for a while already, and I just stumbled across it again 
when I wanted to delete the thunderbird-2.0.0.4 build tree, so I 
decided to finally report this bug. :-)

I'm using the release version of mc-4.6.1 with a couple of Uhulinux 
patches from Egmont Koblinger (all of the UTF-8 patches and a few 
other ones).

[zlatko@disclosure]:~$ mc --version
GNU Midnight Commander 4.6.1
Virtual File System: tarfs, extfs, cpiofs, ftpfs, fish, mcfs, undelfs
With builtin Editor
Using system-installed S-Lang library with terminfo database
With subshell support as default
With support for background operations
With mouse support on xterm and Linux console
With support for X11 events
With internationalization support
With multiple codepages support 

Comment 1 by me <me4mc> at Sat 14 Jul 2007 09:27:33 PM UTC:

can confirm this bug in cvs, 4.6.1 or 4.6.1 + patches.
it only works if the complete tree is 755, otherwise they are 
unlinked without notice - however that works

i am working on a patch to support skipall, it might be possible i 
could fix that too.
but looking at the code i worry about recursion :)

its on line 1356 in file.c (recursive_erase)
the returnstatus gets abused and therefore lost unless it is a 
FILE_CONTINE:

1346: return file_error if != FILE_CONT
1328: return_status = file_error != FILE_CONT
1338: return return_status

the operation in line 1328 seems to be the odd one, but i cannot 
fully understand its working:
return_status =
(recursive_erase
(ctx, path, progress_count, progress_bytes)
!= FILE_CONT);

is it to end the while loop on abort?

besides the fact skip is ignored completely this should be a clean 
path before adding skip (&skipall)?

thanks for i|o

Attachments

mc-4.7.0.8-skipall.diff (10.4 KB) - added by ZlatkO 14 years ago.
updated patch for 4.7.0.8
mc-4.6.1-skipall.patch (10.3 KB) - added by ZlatkO 14 years ago.
original patch against 4.6.1-CVS
mc-4.7.5.1-skipall.diff (12.1 KB) - added by ZlatkO 14 years ago.
updated and cleaned up patch for 4.7.5.1

Change History

comment:1 Changed 16 years ago by styx

  • Milestone set to future releases

comment:2 Changed 15 years ago by andrew_b

  • Version set to 4.6.1
  • Component changed from mc-vfs to mc-core
  • severity set to no branch

comment:3 Changed 14 years ago by ZlatkO

As this bug annoys me whenever I stumble across it, I finally got off my lazy ass
and ported the patch for 4.6.1 that has been posted to the mailing list back in 2007
to the current stable version, 4.7.0.8.

The patch fixed the problem in 4.6.x, and it also works fine with 4.7.0.8 so far.

Related posts from the mailing list archive:

http://mail.gnome.org/archives/mc-devel/2007-July/msg00005.html
http://mail.gnome.org/archives/mc-devel/2007-July/msg00006.html
http://mail.gnome.org/archives/mc-devel/2007-September/msg00039.html
http://mail.gnome.org/archives/mc-devel/2007-September/msg00040.html

Changed 14 years ago by ZlatkO

updated patch for 4.7.0.8

comment:4 Changed 14 years ago by ZlatkO

  • Cc m-c.org@… added

comment:5 Changed 14 years ago by andrew_b

  • Version changed from 4.6.1 to 4.7.0.8

I see many empty conditions in the patch:

if (return_status == FILE_SKIP);

What reason for that?

comment:6 Changed 14 years ago by ZlatkO

I have no idea, you'd have to ask the original author. ;-)

All I did was "port" the original patch against 4.6.1 to 4.7.0.x. Maybe it's just
the author's way of saying "No, I didn't forget the FILE_SKIP case, but there's
nothing special we need to do here"? But that's only speculation.

I'll also attach the original patch against 4.6.1 that has been posted to the
mailing list, just in case.

Changed 14 years ago by ZlatkO

original patch against 4.6.1-CVS

comment:7 Changed 14 years ago by ZlatkO

  • Version changed from 4.7.0.8 to 4.7.5.1

Just as a reminder, this annoying bug is still alive and kicking in 4.7.5.1 ... updated version accordingly (hope that's okay).

comment:8 Changed 14 years ago by ZlatkO

  • Cc zlatko-m-c-org@… added

comment:9 Changed 14 years ago by ZlatkO

Okay, so I've updated the patch yet again, to apply cleanly against 4.7.5.1. I also removed the empty conditions this time and re-arranged stuff a bit. Works fine for me so far.

Changed 14 years ago by ZlatkO

updated and cleaned up patch for 4.7.5.1

comment:10 Changed 14 years ago by andrew_b

  • Status changed from new to accepted
  • Owner set to andrew_b
  • Version changed from 4.7.5.1 to master
  • severity changed from no branch to on review
  • Milestone changed from Future Releases to 4.8.0-pre1

Created 71_skip_all branch (parent: master).
changeset:2f28c66edd8946370fe5dea790610b259bff4766

comment:11 Changed 14 years ago by slavazanko

  • Votes for changeset set to slavazanko

comment:12 Changed 14 years ago by angel_il

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

comment:13 Changed 14 years ago by andrew_b

  • Status changed from accepted to testing
  • Votes for changeset slavazanko angel_il deleted
  • Resolution set to fixed
  • severity changed from approved to merged

comment:14 Changed 14 years ago by andrew_b

  • Status changed from testing to closed

comment:15 Changed 13 years ago by slyfox

  • Status changed from closed to reopened
  • Resolution fixed deleted
  • Branch state set to no branch

I've managed to get a hangup today.

Steps to reproduce:

  1. run mc as unprivileged user
  2. Left panel: create and enter empty /tmp/z/ directory
  3. Right panel: go to /bin/ directory where
    $ ls -l /bin/ping*
    -rws--x--x 1 root root 39336 Feb 18 11:16 /bin/ping
    -rws--x--x 1 root root 43784 Feb 18 11:16 /bin/ping6
    

(note root-only read attribute!)

  1. Select ping and ping6 and attempt to copy(F5).
  2. When error dialog will pop up select Skip all.

Copy dialog won't dsappear without user interaction.

comment:16 Changed 13 years ago by andrew_b

  • Branch state changed from no branch to on review

Sorry, this is my fault.

Created 71_skip_all_fix branch (parent: master).
changeset:eccdc09b985a12682b43f03f64a9382413084425

comment:17 Changed 13 years ago by slavazanko

  • Votes for changeset set to slavazanko

comment:18 Changed 13 years ago by angel_il

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

comment:19 Changed 13 years ago by andrew_b

  • Status changed from reopened to closed
  • Votes for changeset changed from slavazanko angel_il to committed-master
  • Resolution set to fixed
  • Branch state changed from approved to merged

comment:20 follow-up: ↓ 21 Changed 13 years ago by oernii

  • Status changed from closed to reopened
  • Resolution fixed deleted

I just clonened the latest from git and "Skip all" does not work on errors (copy all with symlinks) :(

comment:21 in reply to: ↑ 20 Changed 13 years ago by angel_il

Replying to oernii:

I just clonened the latest from git and "Skip all" does not work on errors (copy all with symlinks) :(

how to reproduce this? step by step

comment:22 follow-up: ↓ 23 Changed 13 years ago by oernii

1) untar this somewhere http://www.oernii.sk/mc_symlinks_skip_all_test.tar.gz
2) untar that to another_dir
3) mc-latest-git/mc somewhere another_dir
4) select "profiles" and hit F5
5) select "overwrite none"
6) select "skip all"

after this you receive 4 more "skip all" which is the bug. After "skip all" it should not bother me again and just skip the symlinks.

comment:23 in reply to: ↑ 22 Changed 13 years ago by andrew_b

Replying to oernii:

1) untar this somewhere http://www.oernii.sk/mc_symlinks_skip_all_test.tar.gz
2) untar that to another_dir
3) mc-latest-git/mc somewhere another_dir
4) select "profiles" and hit F5
5) select "overwrite none"

What is it? The 'None' button in 'File exists' dialog?

6) select "skip all"

I don't get any error message after "overwrite none".

mc-4.7.8-pre2

comment:24 Changed 13 years ago by oernii

I have this dialog:


Overwrite this target? [ Yes ] [ No ] [ Append ]
Overwrite all targets? [ All ] [ Update ] [ None ]


in step 5) select "None"

I've uploaded a short screencast to http://www.youtube.com/watch?v=9dStr6IE5FE

comment:25 Changed 13 years ago by andrew_b

I see, thanks!

comment:26 follow-up: ↓ 27 Changed 13 years ago by oernii

so is that a bug still?

comment:27 in reply to: ↑ 26 Changed 13 years ago by andrew_b

Yes

comment:28 Changed 13 years ago by andrew_b

  • Votes for changeset committed-master deleted
  • Milestone changed from 4.8.0-pre1 to Future Releases

comment:29 Changed 13 years ago by andrew_b

  • Branch state changed from merged to on review
  • Milestone changed from Future Releases to 4.8.1

Please review.
Branch: 71_skip_all_fix (parent: master).
changeset:f6be195b86850340b05b7e4f3371f44d17d46c67

Last edited 13 years ago by andrew_b (previous) (diff)

comment:30 Changed 13 years ago by slavazanko

  • Votes for changeset set to slavazanko

Vote here with my latest commit in branch.

Last edited 13 years ago by slavazanko (previous) (diff)

comment:31 Changed 13 years ago by angel_il

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

comment:32 Changed 13 years ago by andrew_b

  • Status changed from reopened to closed
  • Votes for changeset changed from slavazanko angel_il to committed-master
  • Resolution set to fixed
  • Branch state changed from approved to merged
Last edited 13 years ago by andrew_b (previous) (diff)

comment:33 Changed 13 years ago by oernii

Fantastic, works great. Now only if I could set that SKIP_ALL flag before the copying starts (like in tc) :-).

comment:34 Changed 11 years ago by ossi

  • Description modified (diff)
  • Reporter changed from slavazanko to zlatk0
Note: See TracTickets for help on using tickets.