Bug 177111 - Bug when copying/move file to deleted directory
Bug when copying/move file to deleted directory
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: mc (Show other bugs)
4
All Linux
medium Severity low
: ---
: ---
Assigned To: Jindrich Novy
http://mail.gnome.org/archives/mc-dev...
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-01-06 08:13 EST by Marcin Garski
Modified: 2013-07-02 19:12 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-03-16 07:05:24 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch to fix your problem. (487 bytes, patch)
2006-01-12 07:11 EST, Jindrich Novy
no flags Details | Diff

  None (edit)
Description Marcin Garski 2006-01-06 08:13:27 EST
Hello Jindrich,

I send this bug report on mc-devel but as I see, no one has reply, so I have
decided to put it in RH bugzilla. Feel free to close it and wait for upstream
resolution :)

1. cd /tmp && mkdir dir && mkdir dir/subdir && touch dir/file.txt
2. cd dir && mc
3. press Alt+i and in right panel cd into subdir
4. on left you should be in /tmp/dir on right in /tmp/dir/subdir
5. open second MC in new console, delete /tmp/dir/subdir
6. go back to first MC, in left panel selcet file.txt and copy or move it to
directory in right panel (/tmp/dir/subdir) that don't exist
7. see what will happen (filename of file.txt will be changed to subdir)

MC should report that /tmp/dir/subdir don't exist and it's immposible to
copy/move file to it.
Comment 1 Jindrich Novy 2006-01-06 15:41:28 EST
Hello Marcin,

I successfully reproduced it after I saw your post on mc's upstream. I'll look
more into it after the weekend. The more bugzillas you file, the more likely
someone will look at it ;) Thanks for the heads-up, I almost forgot about it.
Comment 2 Jindrich Novy 2006-01-12 07:11:23 EST
Created attachment 123109 [details]
Patch to fix your problem.

This is caused by the fact, that mc won't refresh contents of panels when a
delete/move/copy command is requested. This causes in your particular case that
the source file is /tmp/dir/file.txt and the default destination is
/tmp/dir/subdir. Since /tmp/dir/subdir directory no more exists, mc thinks you
want to move/copy the file.txt to a file named subdir.

Note that a more suitable fix would be to present /tmp/dir/subdir/ as a
destination in case it's directory, otherwise it's indisqushable for mc from a
file.
Comment 3 Marcin Garski 2006-01-13 08:01:46 EST
This patch fix my problem. As you note it's not a perfect solution (but it's
better then currently mc state), because user may not notice that after pressing
F5 or F6 directory has changed. Maybe mc before delete/move/copy command should
check if the directory exist if not then display warning message?

I didn't have installed slang-devel and during configure:
checking slang.h usability... no
checking slang.h presence... no
checking for slang.h... no
checking slang/slang.h usability... no
checking slang/slang.h presence... no
checking for slang/slang.h... no
configure: error: S-Lang library not found
so it would be good to add slang-devel to BuildRequires.
Comment 4 Jindrich Novy 2006-01-13 09:29:05 EST
It does. MC checks whether the directory to which is something copied exists,
but in this case MC has no clue to figure out whether /tmp/dir/subdir was a
directory or a file. This is the reason I vote for /tmp/dir/subdir/ to be sure
it'll be considered a directory even if it doesn't exist.

The both panels contain a directory without the slash and the information for
target in copy/move dialog is taken from the panels. So stuff need to be fixed
there instead. I'll have a look at it when I have some time.

Regarding the slang problem, the FC3/FC4 versions don't contain slang-devel
dependency since they're compiled with internal mcslang support. devel MC is
linked against external slang, and there's slang-devel dependency so I don't
understand how did you happen to see this.

What mc version do you compile?
Comment 5 Marcin Garski 2006-01-13 09:47:41 EST
Thanks for answer about directories.

I've downloaded this source rpm:
http://download.fedora.redhat.com/pub/fedora/linux/core/updates/4/SRPMS/mc-4.6.1a-4.FC4.src.rpm
and only added patch, bump release number and done rpmbuilb -ba mc.spec
Comment 6 Jindrich Novy 2006-01-13 11:13:57 EST
Yes, I reproduced it. I changed in CVS a while ago, but fotgot that I haven't
released any updates. Now I'm waiting to gather more fixes to ship them with
upcoming updates all at once.

Note You need to log in before you can comment on or make changes to this bug.