Ticket #4507 (closed defect: fixed)

Opened 7 months ago

Last modified 6 months ago

Shell link shows incorrect file names with cyrillic or diacritic symbols

Reported by: lnx Owned by: andrew_b
Priority: major Milestone: 4.8.31
Component: mc-vfs Version: master
Keywords: Cc:
Blocked By: Blocking:
Branch state: merged Votes for changeset: committed-master

Description

When using Shell link, filenames with cyrillic or diacritic symbols are displayed as chains of numbers. It is not possible to perform operations with such files.
example contents of some directory:

ls -gn
-rw-r--r-- 1 1000 0 Oct 14 13:11 aaa
-rw-r--r-- 1 1000 0 Oct 14 13:26 āāā
-rw-r--r-- 1 1000 0 Oct 14 13:11 bbb
lrwxrwxrwx 1 1000 6 Oct 14 13:26 fff -> āāā
lrwxrwxrwx 1 1000 6 Oct 14 13:26 sss -> ššš
-rw-r--r-- 1 1000 0 Oct 14 13:26 ššš
-rw-r--r-- 1 1000 0 Oct 14 13:26 ввв
-rw-r--r-- 1 1000 0 Oct 14 13:26 ггг
lrwxrwxrwx 1 1000 6 Oct 14 13:26 ддд -> ššš

how the same directory is displayed via shell link (ssh) to localhost:

/..                     │UP--DIR│Oct 14 13:44
│ 304201304201304201    │      0│Oct 14 13:26
│ 305241305241305241    │      0│Oct 14 13:26
│ 320262320262320262    │      0│Oct 14 13:26
│ 320263320263320263    │      0│Oct 14 13:26
│@320264320264320264    │      6│Oct 14 13:26
│ aaa                   │      0│Oct 14 13:11
│ bbb                   │      0│Oct 14 13:11
│@fff                   │      6│Oct 14 13:26
│@sss                   │      6│Oct 14 13:26

Problem is with fish_list_perl() in /usr/lib/mc/fish/ls:
S_IMODE and S_IFMT subroutines are not being imported from Fcntl
due to line 128 import Fcntl ":mode" unless defined &S_ISLNK;

changing /usr/lib/mc/fish/ls line 126 use Fcntl; to use Fcntl ":mode"; fixes the problem.

Additional information:
Arch Linux with all recent updates

LC_MESSAGES=C mc -V
GNU Midnight Commander 4.8.30
Built with GLib 2.76.4
Built with S-Lang 2.3.3 with terminfo database
Built with libssh2 1.11.0
With builtin Editor and Aspell support
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
With ext2fs attributes support
Virtual File Systems:

cpiofs, tarfs, sfs, extfs, ftpfs, sftpfs, fish

Data types:

char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64;

mc --configure-options

'--prefix=/usr' '--libexecdir=/usr/lib' '--sysconfdir=/etc' '--enable-aspell' '--with-screen=slang' '--with-x' 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/mc/src=/usr/src/debug/mc -flto=auto' 'LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -flto=auto'

Attachments

fix-fish_list_perl.patch (480 bytes) - added by lnx 7 months ago.
diff -u ls.orig ls > fix-fish_list_perl.patch

Change History

comment:1 Changed 7 months ago by lnx

I have 3 Arch machines with the same issue. Found than on machine with Debian testing there is no such problem.
The problem is due to Perl version. Debian have Perl v5.36.0 and there is no S_ISLNK in POSIX.pm.
Arch have Perl v5.38.0 and there is S_ISLNK in POSIX.pm, so S_IMODE and S_IFMT are not imported from Fcntl due to condition unless defined &S_ISLNK.

comment:2 Changed 7 months ago by zaytsev

Can you prepare a patch that works on all Perl versions?

Changed 7 months ago by lnx

diff -u ls.orig ls > fix-fish_list_perl.patch

comment:3 Changed 7 months ago by lnx

diff -u ls.orig ls > fix-fish_list_perl.patch
patch file is in attachment
I have tested it with Perl 5.36.0 and 5.38.0
I do not know all the details and not sure why author of the fish_list_perl() created it in this manner.
Just make sure my patch doesn't break anything else.

comment:4 Changed 7 months ago by andrew_b

  • Status changed from new to accepted
  • Owner set to andrew_b
  • Version changed from 4.8.30 to master
  • Branch state changed from no branch to on review
  • Milestone changed from Future Releases to 4.8.31

Thanks!

Branch: 4507_shell_vfs_cyrillic
changeset:3c4941867aed0941e6c30048ee4430549e38fd04

comment:5 Changed 6 months ago by andrew_b

  • Votes for changeset set to andrew_b
  • Branch state changed from on review to approved

comment:6 Changed 6 months ago by andrew_b

  • Status changed from accepted to testing
  • Votes for changeset changed from andrew_b to committed-master
  • Resolution set to fixed
  • Branch state changed from approved to merged

comment:7 Changed 6 months ago by andrew_b

  • Status changed from testing to closed
Note: See TracTickets for help on using tickets.