Bug 127164 - mc hangs with directory names with newline inside (with subshell enabled)
mc hangs with directory names with newline inside (with subshell enabled)
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: mc (Show other bugs)
2
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jindrich Novy
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-07-02 17:16 EDT by Doncho N. Gunchev
Modified: 2013-07-02 19:00 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-10-11 08:20:27 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
Output of lsof at the time of the hang. (1.77 KB, text/plain)
2004-11-18 05:43 EST, Pavel Tsekov
no flags Details

  None (edit)
Description Doncho N. Gunchev 2004-07-02 17:16:17 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040627

Description of problem:
If I create a directory with newline (yes, quite unusual) inside,
enter this directory and then start mc, that's the last thing I can
do, it hangs and only kill <mc_pid> helps.

Version-Release number of selected component (if applicable):
mc-4.6.0-15

How reproducible:
Always

Steps to Reproduce:
1. A=$(echo -ne 'newline\ndir')
2. mkdir "$A"
3. cd "$A"
4. mc
5. press <TAB>

Actual Results:  mc hangs there when you try to change the dir or
switcg the panels.

Expected Results:  Such directory should be displayed like in ls ('?'
instead new line or whatever), but not hang mc.

Additional info:

    I've tested this with RH9, FC1 (text and graphical console) and
FC2 with UTF-8 and without. Even the Leonard den Ottolander's patched
version (mc-4.6.0-14.10n) nothing changes for me. If I run mc with
ltrace: 'ltrace mc 2> ZZZ' it seems to work (slow, verry slow but
works), but with 'strace mc 2> ZZZ' it hangs again and in the log
there's probably something usefull I did not find. When used without
concurrent shell (mc -u) everything works fine (but the newline
character is simply ignored when showing the path).
    I suspect there can be other weird characters that can hang or
even crash mc, but I have not tested this yet.
Comment 1 Jindrich Novy 2004-10-11 08:20:27 EDT
This is now fixed in rawhide.

Jindrich
Comment 2 Pavel Tsekov 2004-11-18 05:43:42 EST
Created attachment 106947 [details]
Output of lsof at the time of the hang.
Comment 3 Pavel Tsekov 2004-11-18 05:45:36 EST
The patch is not good enough. It causes MC to hang when the subshell
is tcsh, as can be seen from this strace:

9770 pts/0    S+     0:00 /home/ptsekov/mc-test/usr/bin/mc -U
9773 pts/5    Ts+    0:00 -csh

[ptsekov@baba-meca abcdef]$ strace -p 9770
Process 9770 attached - interrupt to quit
read(6,

See also the lsof output.
Comment 4 Leonard den Ottolander 2005-05-18 09:34:42 EDT
Which patch would this be again?
Comment 5 Jindrich Novy 2005-05-18 09:58:44 EDT
This is the "uglydir" patch you can see in our src.rpm.

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