Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#993471: mc crashes if ftp server specified on cmdline requires authentication

14 views
Skip to first unread message

Matija Nalis

unread,
Sep 1, 2021, 3:10:04 PM9/1/21
to
Package: mc
Version: 3:4.8.26-1.1
Severity: normal

Dear Maintainer,

Trying to specify FTP URL with username crashes mc if invoked from command line.
For example:

mc /tmp ftp://some...@192.168.43.1:2121/

mc would start to show the dialog to ask password, and then crash:
┌─────────────────────────── FTP: Password required for someuser ───────────────────────────┐
│ Password: │
│ zsh: segmentation fault mc /tmp ftp://some...@192.168.43.1:2121/


* What exactly did you do (or not do) that was effective (or
ineffective)?

- When invoked via menus (eg. F9 / Right / FTP link / ftp://mna...@192.168.43.1:2121/) it asks for password normally and connects.
- if anonymous FTP is attempted (which does not require inputting password) it works.
- if correct password is also specified on command line, it also works
- if incorrect password is specified on command line, it fails as it tries to re-ask the password
- Also, it worked in Buster version of mc just fine. After upgrade to Bullseye it crashes.

In short, it seems to crash only if URL which was specified IN COMMAND LINE requires some user input.

-- System Information:
Debian Release: 11.0
APT prefers stable-security
APT policy: (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.0-8-amd64 (SMP w/4 CPU threads)
Locale: LANG=hr_HR.UTF-8, LC_CTYPE=hr_HR.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
LSM: AppArmor: enabled

Versions of packages mc depends on:
ii libc6 2.31-13
ii libext2fs2 1.46.2-2
ii libglib2.0-0 2.66.8-1
ii libgpm2 1.20.7-8
ii libslang2 2.3.2-5
ii libssh2-1 1.9.0-2
ii mc-data 3:4.8.26-1.1

Versions of packages mc recommends:
ii mime-support 3.66
ii perl 5.32.1-4+deb11u1
ii sensible-utils 0.0.14
ii unzip 6.0-26

Versions of packages mc suggests:
pn arj <none>
ii bzip2 1.0.8-4
pn catdvi | texlive-binaries <none>
ii dbview 1.0.4-4
pn djvulibre-bin <none>
ii epub-utils 0.2.2-4+b4
ii evince [pdf-viewer] 3.38.2-1
ii file 1:5.39-3
ii genisoimage 9:1.1.11-3.2
pn gv <none>
ii imagemagick 8:6.9.11.60+dfsg-1.3
ii imagemagick-6.q16 [imagemagick] 8:6.9.11.60+dfsg-1.3
pn libaspell-dev <none>
ii lynx 2.9.0dev.6-3~deb11u1
pn odt2txt <none>
ii poppler-utils 20.09.0-3.1
pn python <none>
pn python-boto <none>
pn python-tz <none>
pn unar <none>
ii w3m 0.5.3+git20210102-6
pn wimtools <none>
ii zip 3.0-12

-- no debconf information

Bernhard Übelacker

unread,
Sep 17, 2021, 3:10:05 PM9/17/21
to
Dear Maintainer,
I tried to have a look and received the backtrace below [3].

As far as I see is 4.8.27 in current testing not affected.

And a 'git bisect' led to the upstream commit [1], which
is tracked in upstream bug [2].
A package 4.8.26 built with this commit is also
working as expected (see attached patch).

Kind regards,
Bernhard



[1] https://github.com/MidnightCommander/mc/commit/0375997c789eef9b6355aadd80aaf4aced68c560

[2] https://midnight-commander.org/ticket/4244

[3]
Program terminated with signal SIGSEGV, Segmentation fault.
#0 widget_set_size (w=0x0, y=y@entry=59, x=<optimized out>, lines=lines@entry=1, cols=cols@entry=19) at widget-common.c:450
450 if (w->owner != NULL && widget_get_state (WIDGET (w->owner), WST_ACTIVE))
(gdb) set width 0
(gdb) set pagination off
(gdb) bt
#0 widget_set_size (w=0x0, y=y@entry=59, x=<optimized out>, lines=lines@entry=1, cols=cols@entry=19) at widget-common.c:450
#1 0x000055d9c539ae14 in setup_cmdline () at layout.c:999
#2 0x000055d9c53f54d0 in set_prompt_string () at common.c:728
#3 set_prompt_string () at common.c:720
#4 read_subshell_prompt () at common.c:1575
#5 0x000055d9c539be56 in do_load_prompt () at layout.c:1473
#6 0x000055d9c539bee6 in load_prompt (fd=<optimized out>, unused=<optimized out>) at layout.c:1502
#7 0x000055d9c5397a4a in check_selects (select_set=select_set@entry=0x7ffe62e65cd0) at key.c:618
#8 0x000055d9c53998e1 in tty_get_event (event=event@entry=0x7ffe62e65da0, redo_event=0, block=block@entry=1) at key.c:2055
#9 0x000055d9c5380d01 in frontend_dlg_run (h=0x55d9c66744c0) at dialog.c:318
#10 dlg_run (h=h@entry=0x55d9c66744c0) at dialog.c:575
#11 0x000055d9c53ad165 in quick_dialog_skip (quick_dlg=quick_dlg@entry=0x7ffe62e65ed0, nskip=<optimized out>, nskip@entry=1) at quick.c:581
#12 0x000055d9c53c01c6 in quick_dialog (quick_dlg=0x7ffe62e65ed0) at ../../lib/widget/quick.h:353
#13 fg_input_dialog_help (header=0x55d9c66732c0 "FTP: Passwort benötigt für ftpuser", text=<optimized out>, help=0x55d9c5428833 "[Input Line Keys]", history_name=<optimized out>, def_text=0x55d9c542e960 "", strip_password=0, completion_flags=INPUT_COMPLETE_NONE) at wtools.c:226
#14 0x000055d9c53c0eeb in input_dialog (header=header@entry=0x55d9c66732c0 "FTP: Passwort benötigt für ftpuser", text=<optimized out>, history_name=history_name@entry=0x55d9c542872a "mc.vfs.password", def_text=def_text@entry=0xffffffffffffffff <error: Cannot access memory at address 0xffffffffffffffff>, completion_flags=completion_flags@entry=INPUT_COMPLETE_NONE) at wtools.c:506
#15 0x000055d9c53be3f4 in vfs_get_password (msg=msg@entry=0x55d9c66732c0 "FTP: Passwort benötigt für ftpuser") at utilvfs.c:365
#16 0x000055d9c53c5d21 in ftpfs_login_server (me=me@entry=0x55d9c5479e60 <ftpfs_subclass>, super=super@entry=0x55d9c6673210, netrcpass=netrcpass@entry=0x0) at ftpfs.c:643
#17 0x000055d9c53c7bb8 in ftpfs_open_archive_int (super=0x55d9c6673210, me=0x55d9c5479e60 <ftpfs_subclass>) at ftpfs.c:973
#18 ftpfs_open_archive (super=0x55d9c6673210, vpath=<optimized out>, vpath_element=<optimized out>) at ftpfs.c:1028
#19 0x000055d9c53ccb1b in vfs_s_get_path (vpath=vpath@entry=0x55d9c6672f10, archive=archive@entry=0x7ffe62e66450, flags=flags@entry=0) at direntry.c:1207
#20 0x000055d9c53ccc29 in vfs_s_inode_from_path (vpath=vpath@entry=0x55d9c6672f10, flags=flags@entry=5) at direntry.c:398
#21 0x000055d9c53cce01 in vfs_s_opendir (vpath=0x55d9c6672f10) at direntry.c:426
#22 0x000055d9c53cce86 in vfs_s_chdir (vpath=<optimized out>) at direntry.c:496
#23 0x000055d9c5397167 in mc_chdir (vpath=vpath@entry=0x55d9c6672d20) at interface.c:678
#24 0x000055d9c5387f95 in create_panels () at filemanager.c:665
#25 create_file_manager () at filemanager.c:924
#26 do_nc () at filemanager.c:1836
#27 0x000055d9c53754d1 in main (argc=<optimized out>, argv=<optimized out>) at main.c:463

debugging.txt
0375997c_Ticket__4244__fix_segfault_on_dialog_before_panels_get_visible.patch
0 new messages