[MC]: zip issues, ftp wants, and others (was: Re: Norton Commander?)



oops, forgot to include mailing list when sending this originally, sorry Pavel that you haveto recieve this again, now throgh mailing list.

could the mailing list have reply-to:mc gnome org added to the headers so that default behaviour, reply, is to mailing list?




Pavel Roskin wrote:

> >Other things like forgetting keys, crashing on bad archives,badbadftp
> >support I assume are being worked on so I dont want to waste time
> >raising these issues which most likely someone already did.
>
>
> Exactly that would not be a waste of time.
>
> Please don't assume that anything of that is worked on. Please look in
> src/TODO on CVS (http://cvs.gnome.org/lxr/source/mc/src/TODO?raw=1),
> but the descriptions there are very terse.  Your problems can be
> trivial to solve and it can happen that they are not identical to
> those already reported.


Thanks for response. I am happy to have this great utility and dont want to be a burden by going over and over things that might have already been discussed (just joined).

Included

mc_duplicate_directories.zip -> shows duplicate directories problem
mc_segfault_and_coredump.zip -> crashes mc

There is another way that mc crashes than mc_segfault_and_coredump.zip makes it to do, but I could not find in last hour a zip file that would crash mc spectacularily, be valid, and be under 50k, will keep looking.


> Let me just comment on your short description to show you what the
> known problems are:
>
> 1) Forgetting keys.  There are two known cases when it can happen.
> One is mc linked with ncurses, running on xterm under heavy load (e.g.
> unpacking a bzip2 archive).  The other is running one mc from another
> and then switching to the first and to the second mc (i.e. press
> Ctrl-O Ctrl-O Ctrl-L).



could be happenning on either cases. I do alot of work with various archivers (I like collecting useless junk), as well as all my Linuxen are servers only so all my mc'ing is through ssh/screen (does that count as xterm'ing?). Currently my sollution is to have mc alias that first overwrites /.mc/ with contents from /.mc.good/ so that it never looses my key settings.


> 2) Crashing on bad archives.  I'm not aware of this problem.  In fact,
> it can be a security risk.  Many crashes can be exploited to run
> random code.
> Just imagine somebody sending specially crafted archives that make mc
> send that file by mail to further recipients - that would be an mc
> worm.
> Please report the problem is full detail - it's extremely important to
> fix this one.



Here is one, I will try to find a smaller zip that also crashes that I could send without overloading your mailbox:

ls -lr New_ico.zip
-rw-r--r--    1 apz      apz       1684933 Oct 20 01:33 New_ico.zip


zip -T New_ico.zip
test of New_ico.zip OK


unzip New_ico.zip
## no errors


mc -h
The Midnight Commander 4.5.52
## Mandrake 8.0 beta
## Mandrake 8.2 final


Pressing f3 (view stats of the zip) no errors
Pressing enter (to pretend its just another directory) core dump:

----/ segfault on a New_ico.zip /---------------------------------------
Segmentation fault (core dumped)                                 [^]
/usr/lib/mc/extfs/uzip: line 4: 20558 Broken pipe $XZIPINFO -l "$1" 20559 | gawk -v uid=${UID-0} -v zipfile="$1" -v xunzip=${XUNZIP-unzip} '
/^Archive/ { next }
/^[0-9]*\ file/ { next }
/(unx|fat|ntf)/ {
split($0,a,":")
nam = substr(a[2],4)
if ($1 ~ /^l/ ) {
    arrow=" -> "
    linkname=""
    cmd=xunzip " -p " zipfile " " nam
    cmd | getline linkname
} else {
    arrow=""
    linkname=""
}
#if ($1 ~ /^d/ )  -- not okay -- this would break empty directories --pavel
#    next

if (length($1) == 7)
    $1 = "-rw-r--r--"

if (nam ~ /^\^/)
    nam=substr(nam, 2)
split($8, a, "-")
if (a[3] < 50)
    a[3] = 2000 + a[3]
else
    a[3] = 1900 + a[3]
printf "%s 1 %-8d %-8d %8d %3s %2d %4d %s %s%s%s\n", $1, uid, 0, $4, a[2], a[1], a[3], $9, nam, arrow, linkname
next
}
{
exit 214
}' 2>/dev/null

----/ end of segfault on New_ico.zip /---------------------------------

when I tried it again I got:

    Inconsistant EXTfs archive

some garbage in red color, and within few keystrokes mc segfaulted again.





Another wierd zip issue is that for some archives directory structure is duplicated. I mean I will see:
  /Ico
  /Ico
  file1
  file2

So directory "Ico" is shown twice. From quick glancing at the zip file through f3 I think the problem is that directory definition is at the end of directory contents definition. That is, a well displayed archive shows in f3:
  /Ico/
  /Ico/someSubDirFile
  /Ico/AnotherSubDirFile
  /Ico/SubDirFile3

while a zip file which shows duplicated directories under f3 shows:
  /Ico/someSubDirFile
  /Ico/AnotherSubDirFile
  /Ico/SubDirFile3
  /Ico/

maybe its some code which learns of new directories if it finds slashes in filenames, or filename ends with a slash, but never checks if directory was already discovered when finding one by checking filename ending with slash, and adds it again, hence giving duplicate directories?

When I try to decompress (and mark both directories) I get error on second directory that it cannot make a hard link.


I am able to create such zipfiles easily with Windows Commander.





Ok, found a zip file that I could get mc to segfault and coredump on. I tried removing from the zipfile files to make it smaller while still retaining ability of it to crash. This zipfile also tests ok with 'zip -T' and unzip, so again somewhere mc is at fault.

However this test file (mc_segfault_and_coredump.zip) does not coredump as nicely as the New_ico.zip (none of that nice source code listing).




> 3) Bad bad ftp support.  Known problems are: starting in user's home
> directory without notifying the upper levels about the current directory, inability to follow links on some servers, bad handling of broken connection, inability to interrupt some operations, incorrect parsing of file names beginning with a year number.



how about:
 - cannot type own commands:
    cd anything  - instead of changing directory on server changes it
                   locally on file system, forcing trying to reconnect
    site who     - you just cant
 - no ability to see the log of what really happends with communication
   with server. Needed if such features as typing own commands is to be
   allowed (like site who, or site kick, etc). Helps debugging as well
 - file upload copies file first to some temp spot (why?) and then
   really uploads it to server, annoying when tranferring large files
 - disconnections are really trouble some, i haveto often pretend that
   am connecting to completly new server for it to actually reconnect
   (by trying different hostname)
 - background mode, is there a way to see how background mode is doing?
   is there one thread that does background mode, so everything that
   is assigned to background mode is sent to background queue? or is
   each background task started immidiatelly? Found this confusing
 - wishlist:
   - fxp support.
   - tsl ftp support
   - ftp remembered list
   - possibility:
         merge ftp capabilities with pFTP (http://pftp.suxx.sk/pftp/)

ofcourse I might be missing something, I am still to go through man/info of mc, mostly I relate my mc usage to how it worked with either wincmd/far/nc.95v2/nc5.


> That said, I cannot say that even those problems are being actively
> fixed.  Nobody works on this project full-time.

I understand this, thats why I did not want to be really whining and asking for fixing-bugs/adding features when I know someone else propably will anyways.

Currently just got the 4.6.0.pre1 and trying to compile and read full documentation to see if some features that am missing from wincmd are there already. Advanced Rename Tool (cltr-t), directory synchronize (like in wincmd), directory history (alt-down), directory bookmarks (ctrl-d), easy volume/mount point switching (altf1/f2) (that also would come in handy with working with ftps, where we could pretend that ftp is a new fake mountpoint so that we can access it through the volume/mount point switching). I started reading some of TTY docs which mention that some key combinations are reserved by TTY for own transmission controll (I believe that is the case with either alt or ctrl with f1/f2).


Anyways, whoever are the people who did work on mc, thank you, its the only tool that makes linux managable. Without it I would never propably bother with linux. Dont take my whining seriously, I love the tool, yet I think that there can be much more done. I will try to send in some patches once I get time to play with internals of mc, and catch up with various c lingo and various libs that mc relies on (ncurses), but no promises. Again, thanks for awesome tool.



/apz,  Nothing is impossible for a man who doesn't have to do it himself

Attachment: mc_duplicate_directories.zip
Description: Zip archive

Attachment: mc_segfault_and_coredump.zip
Description: Zip archive



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]