Ticket #2031 (closed defect: fixed)

Opened 9 years ago

Last modified 8 years ago

Permission denied (13) on ssh to sun solaris

Reported by: Peach Owned by: angel_il
Priority: major Milestone: 4.7.5
Component: mc-vfs Version: 4.7.0.1
Keywords: Cc: zaytsev, izemsky
Blocked By: Blocking:
Branch state: Votes for changeset: commited-master

Description

I'm on a linux machine and I'm trying to access a remote Sun Os machine via ssh. so what I'm doing is only Alt+C and insert:
/#sh:user@remote

the error popup states the following:

Cannot chdir to "/#sh:user@remote"
Permission denied (13)

via command line everything works fine with no problems whatsoever.

Attachments

ls_hack (4.5 KB) - added by mcaccount 8 years ago.
The 'not very nice solution' for both perl 5.0 and perl 5.8

Change History

comment:1 Changed 9 years ago by zaytsev

  • Cc zaytsev added

What is the version of Sun OS?

Still reproducible with rewritten FISH scripts?

comment:2 Changed 9 years ago by zaytsev

  • Blocked By 2242 added

Related to #2242.

comment:3 Changed 9 years ago by Peach

Unfortunately I don't have access any more to those servers, so I cannot reproduce the error nor test if it's been fixed with the latest FISH update.
Feel free to close the bug as "non-reproducible" or something like that, I'm really sorry I can't help closing it.

Best Regards.

comment:4 Changed 9 years ago by zaytsev

  • Status changed from new to closed
  • Resolution set to invalid
  • Milestone 4.7 deleted

That's a pity. Please feel free to reopen if this is still an issue and you are able to provide us with more information about the system.

comment:5 Changed 9 years ago by izemsky

  • Status changed from closed to reopened
  • Resolution invalid deleted

Hi,

I have the same behavior. I am connecting to:

bash-2.03$ uname -a
SunOS hostname 5.8 Generic_117350-22 sun4u sparc SUNW,UltraAX-i2

I am running GNU Midnight Commander 4.7.0.6 from repositories on Ubuntu 10.10

Can I provide any further information?

br

Igor

comment:6 Changed 9 years ago by zaytsev

Hmmm... I have a Solaris 10 blade right now, so I can check if I can reproduce it.

comment:7 Changed 9 years ago by angel_il

  • Owner set to angel_il
  • Status changed from reopened to accepted

comment:8 Changed 8 years ago by angel_il

  • Cc izemsky added
  • severity changed from no branch to on review

zaytsev, izemsky, Peach

please try branch
2031_solaris_FISH_fix

changeset: 5b1771e5c4a8a72b94d62a270a5e4f42c6fb90b3

comment:9 Changed 8 years ago by mcaccount

Hi,

I tried:

git clone http://git.midnight-commander.org/mc.git
git checkout 2031_solaris_FISH_fix
./autogen.sh
./configure
make
sudo make install

resulted in:

mc -V
GNU Midnight Commander 4.7.4-277-g5b1771e
Built with GLib 2.26.0
Using the S-Lang library with terminfo database
With builtin Editor
With subshell support as default
With support for background operations
With mouse support on xterm
With internationalization support
With multiple codepages support
Virtual File Systems: cpiofs, tarfs, sfs, extfs, ftpfs, fish
Data types: char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64;

But I still cannot connect to the solaris machine.

Hangs with message

'fish: Reading directory ...'

and I have to kill the application..

comment:10 Changed 8 years ago by angel_il

can you execute under target (solaris) host next script

LC_TIME=C
export LC_TIME
#FISH_HAVE_HEAD         1
#FISH_HAVE_SED          2
#FISH_HAVE_AWK          4
#FISH_HAVE_PERL         8
#FISH_HAVE_LSQ         16
#FISH_HAVE_DATE_MDYT   32
#FISH_HAVE_TAIL        64
res=0
echo "test HEAD -C"
if `echo yes| head -c 1 > /dev/null 2>&1` ; then
    echo OK
    res=`expr $res + 1`
fi
echo "test SED"
if `echo 1 | sed 's/1/2/' >/dev/null 2>&1` ; then
    echo OK
    res=`expr $res + 2`
fi
echo "test AWK"
if `echo 1| awk '{print}' > /dev/null 2>&1` ; then
    echo OK
    res=`expr $res + 4`
fi
echo "test PERL"
if `perl -v > /dev/null 2>&1` ; then
    echo OK
    res=`expr $res + 8`
fi
echo "test LS -Q"
if `ls -Q / >/dev/null 2>&1` ; then
    echo OK
    res=`expr $res + 16`
fi
echo "test LS -lan"
dat=`ls -lan / 2>/dev/null | head -n 3 | (
    while read p l u g s rec; do
      if [ -n "$g" ]; then
        if [ -n "$l" ]; then
          echo "$rec"
        fi
      fi
    done
)`
dat=`echo $dat | cut -c1 2>/dev/null`
r=`echo "0123456789"| grep "$dat"`
if [ -z "$r" ]; then
    echo OK
    res=`expr $res + 32`
fi
echo "test TAIL -c"
if `echo yes| tail -c +1 - > /dev/null 2>&1` ; then
    echo OK
    res=`expr $res + 64`
fi
echo $res
echo "### 200"

comment:11 Changed 8 years ago by angel_il

and attach result?

comment:12 Changed 8 years ago by mcaccount

the output is:

test HEAD -C
test SED
OK
test AWK
OK
test PERL
OK
test LS -Q
test LS -lan
OK
test TAIL -c
46
### 200

head fails because:

head -c 1
head: illegal option -- c
usage: head [-n #] [-#] [filename...]

ls -q fails because:

ls -Q /
ls: illegal option -- Q
usage: ls -1RaAdCxmnlogrtucpFbqisfL [files]

echo yes| tail -c +1 - fails because:

echo yes| tail -c +1 -
tail: cannot open input

but if I do replace | with > it runs fine:
echo yes > tail -c +1 -

with the tail -c modification the output of the script is:

test HEAD -C
test SED
OK
test AWK
OK
test PERL
OK
test LS -Q
test LS -lan
OK
test TAIL -c
OK
110
### 200

comment:13 Changed 8 years ago by angel_il

mcaccount:

please copy mc/lib/vfs/mc-vfs/fish/* into ./mc/fish/<HOST NAME>

for example
connect from solaris to solaris

+---------- Shell link to machine -----------+
|                                            |
| Enter machine name (F1 for details):       |
| '''il@127.0.0.1'''                         |
|                                            |
+--------------------------------------------+

<HOST NAME> is 127.0.0.1
user dir for FISH scripts is ./mc/fish/172.0.0.1/

connect from linux to solaris

+---------- Shell link to machine -----------+
|                                            |
| Enter machine name (F1 for details):       |
| '''il@192.168.1.1'''                       |
|                                            |
+--------------------------------------------+

<HOST NAME> is 192.168.1.1
user dir for FISH scripts is ./mc/fish/192.168.1.1/

2) try connect to solaris

comment:14 Changed 8 years ago by zaytsev

I only have this to test:

Oracle Corporation SunOS 5.10 Generic Patch January 2005
-bash-3.00$ uname -a
SunOS betsy 5.10 Generic_142909-17 sun4u sparc SUNW,Sun-Blade-1000

Everything works w/o any patches :)

comment:15 Changed 8 years ago by mcaccount

Hi,

I did fix the issue for me (= found a workaround).

When I copied the scripts as you suggested and after checking the fish.c file I did find out that the trouble is coming from execution of fish 'ls' script.

The test script you did provide me was saying that fish can use perl ls implementation - 'test PERL OK' part. And because of the order of calls of different ls implementations in the fish 'ls' script my MC was trying to run the perl ls function. I did put some debug output to the perl ls function (modified the script so it wrote to /tmp/mc_fish_debug_output file on the target solaris machine) and did figure out:

The perl version used by the script was:

This is perl, version 5.005_03 built for sun4-solaris

and it produced an error:

"mode" is not defined in %Fcntl::EXPORT_TAGS at /usr/perl5/5.00503/Exporter.pm line 67
        Exporter::export('Fcntl', 'main', ':mode') called at /usr/perl5/5.00503/Exporter.pm line 182
        Exporter::import('Fcntl', ':mode') called at -e line 6
Can't continue after import errors at -e line 6

from line

./lib/vfs/mc-vfs/fish/ls

import Fcntl ":mode" unless defined &S_ISLNK; #and is now here

However if I was running the 'fish_list_perl' from fish ls script manually after logging via standard ssh the method did produced correct output.
The user logged in via ssh was running

This is perl, v5.8.7 built for sun4-solaris

So far I did not figure out why the fish script was using different perl binary than the user logged via ssh.
So the workaround for me was to modify the 'ls' script so it does use the same perl binary as the user logged via standard ssh (I did hard-coded path to the binary into the script for now)

Thanks a lot for the support and quick responses.

Btw. the 'fish: Reading directory ...' behaviour I was experiencing might be the same one as described in Ticket #2391 (at least the symptoms were similar)

comment:16 Changed 8 years ago by zaytsev

Ok, so I guess the point is that we need to fix it for Pel 5.0x? I have no clue about Perl, unfortunately.

comment:17 Changed 8 years ago by mcaccount

Thats a good point. Unfortunately I cannot help with Perl either.

comment:18 Changed 8 years ago by angel_il

changeset: e289b167aa6e3814bd06f18410b4e7af480484a0

mcaccount: i update 'ls' script, try again :)

comment:19 Changed 8 years ago by angel_il

Now if the perl script fails you can run other implementations: fish_list_lsq if 'ls -Q' works under target host, next fish_list_sed if you have SED, next fish_list_poor_ls

PS: if you know AWK welcome with patches :)

comment:20 Changed 8 years ago by angel_il

sorry.. i mean
if the perl script fails THEN MC runs other implementations: fish_list_lsq if 'ls -Q' works under target host, next fish_list_sed if you have SED, next fish_list_poor_ls

comment:21 Changed 8 years ago by mcaccount

Hi, the proposed https://www.midnight-commander.org/changeset/e289b167aa6e3814bd06f18410b4e7af480484a0 solution is not working for me. When trying to use the modified ls script I do get an error:

Cannot change dir to ...
Connection reset by peer (104)

comment:22 Changed 8 years ago by mcaccount

However what does work for me was to extract the missing S_ISLNK, S_IMODE and S_IFMT subroutines and manually implement them.

I suppose that it should be possible to somehow 'load' them from 'somewhere' but I was not able to do so so I went for this ugly 'hack' - but it is working for me on both perl 5.0 and perl 5.8.

It is not nice solution but since this was my first date with Perl I am satisfied with it for now...

Changed 8 years ago by mcaccount

The 'not very nice solution' for both perl 5.0 and perl 5.8

comment:23 Changed 8 years ago by angel_il

mcaccount
git pull
and try again :)

comment:24 Changed 8 years ago by angel_il

izemsky>but what will happen if PERL is not allowed on target machine?
fix commit: 424069e9583e8b0870b23a1a1236bd7d94077d05 (forced update)

do:
git pull
git reset --hard origin/2031_solaris_FISH_fix

comment:25 Changed 8 years ago by zaytsev

Ilya, how about using the proposed fix for PERL 5.0 as well???

comment:26 Changed 8 years ago by angel_il

patch for ls should be tested more detail on different versions of perl.
now propose to vote without this patch...

comment:27 Changed 8 years ago by andrew_b

  • Votes for changeset set to andrew_b
  • Component changed from mc-core to mc-vfs
  • Milestone set to 4.7.5

comment:28 Changed 8 years ago by andrew_b

  • Blocked By 2242 removed

comment:29 Changed 8 years ago by slavazanko

  • Votes for changeset changed from andrew_b to andrew_b slavazanko
  • severity changed from on review to approved

comment:30 Changed 8 years ago by slavazanko

  • Status changed from accepted to testing
  • Votes for changeset changed from andrew_b slavazanko to commited-master
  • Resolution set to fixed
  • severity changed from approved to merged

comment:31 Changed 8 years ago by slavazanko

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