Topic "Problem with symbolic links"

Author Message
minnoce

Guest


I use versione 3.5.6, and I'm connecting to my SFTP server (SSH.com server 3.2.9) configured with SFTP-subsystem chrooted for my user-account.

WinSCP don't create correctly symbolic links.
The major problem is that WinSCP don't permit to create relative symbolic links (those with no starting slash).
WinSCP try to insert in all cases the absolute path to the target file, and in a chrooted environment the link created in that way don't point to the right location...

This is a bug?

Thanks in advance
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
OK, I'll consider supporting creation of relative symbolic links.
_________________
Martin Prikryl
Guest




Hi P!

Found another small thing concerning symbolic links: On our debian linux system a symbolic link (link2) pointing to a symbolic link (link1) pointing to a folder is displayed as a link to a file:

link2 -> link1
link1 -> folder

This may be correct though (as the second link is indeed pointing to a file, namely the other symbolic link file), but maybe there is a solution to let winscp find out what the final target of a link is...?

Thanks for answering my other post so quickly.
negg.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
minnoce wrote:
WinSCP don't create correctly symbolic links.
The major problem is that WinSCP don't permit to create relative symbolic links (those with no starting slash).
WinSCP try to insert in all cases the absolute path to the target file, and in a chrooted environment the link created in that way don't point to the right location...

I have checked this, and found out that WinSCP does create link to exact path that user specifies. So it DOES not insert absolute path to link target (unless user types absolute path).

Why do you think that WinSCP does it?
_________________
Martin Prikryl
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
Anonymous wrote:
Found another small thing concerning symbolic links: On our debian linux system a symbolic link (link2) pointing to a symbolic link (link1) pointing to a folder is displayed as a link to a file:

link2 -> link1
link1 -> folder

It works fine for me. Is it SFTP or SCP? What version of SFTP? Please post a log file.
_________________
Martin Prikryl
Guest




prikryl wrote:
I have checked this, and found out that WinSCP does create link to exact path that user specifies. So it DOES not insert absolute path to link target (unless user types absolute path).


That's the case:
- logged and chrooted to my account (WinSCP think mi home is /)
- in the home dir (/ for the client, not fo the server) WinSCP seems to be unable to create links. Any try cause a pop-up error 'no such file or directory', even if the file/directory clearly exists!
- if I walk to a subdir, when I try to create a relative link (I think in Unix terms of ln command: "ln -s target source", WinSCP dialog seems to invert the params labels, but want them in the Unix order!!) refuse if the target file don't exists, but create the link if He thinks the target exists (WinSCP prefix with the full path the target, in my case /), and the link is created but incorrect...

Too complicated?
I not tried all cases but the bits seems to be very confusing to me!
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
Anonymous wrote:
That's the case:
- logged and chrooted to my account (WinSCP think mi home is /)
- in the home dir (/ for the client, not fo the server) WinSCP seems to be unable to create links. Any try cause a pop-up error 'no such file or directory', even if the file/directory clearly exists!
- if I walk to a subdir, when I try to create a relative link (I think in Unix terms of ln command: "ln -s target source", WinSCP dialog seems to invert the params labels, but want them in the Unix order!!) refuse if the target file don't exists, but create the link if He thinks the target exists (WinSCP prefix with the full path the target, in my case /), and the link is created but incorrect...

I'm little bit confused by your email. Let's make it simpler Smile

I suppose that you still use SFTP (not SCP). What version of SFTP? On status line (bottom of the main windows) you can see something like "SFTP (v3)".

Please can you try repeat following tests that I did one my SFTP v3 server (and it was working as expected). The key shortcuts correspons to Norton-commander interface.
- create directory "somedir" (F7)
- enter the directory
- create directory "somesubdir" (F7)
- select "somesubdir" in panel (it should be selected when created)
- execute "add/edit link" command (Alt-F6). Dialog is displayed with 2nd box (point link to) prefilled with "somesubdir".
- enter "link1" to the first box (link file).
- press ok
- symbolic link "link1" is created in current directory. it has directory icon with small arrow over it.
- it is RELATIVE. it points to "somesubdir", NOT to "/.../somedir/somesubdir".
- select "somesubdir" or ".." in panel (or anything else than symlink = link1)
- execute "add/edit link" command (Alt-F6). Enter "link2" to "link file" box and "link1" to "point link to" box.
- press ok.
- symlink "link2" is created in current directory. it has directory icon with small arrow over it. And it is also RELATIVE.

In SSH terminal "ls -la" in "somedir" directory prints:
total 4
lrwxrwxrwx 1 xprim14 users 10 Mar 19 09:01 link1 -> somesubdir
lrwxrwxrwx 1 xprim14 users 5 Mar 19 09:06 link2 -> link1
drwxr-xr-x 2 xprim14 users 4096 Mar 19 08:58 somesubdir
_________________
Martin Prikryl
Guest




prikryl wrote:

I'm little bit confused by your email. Let's make it simpler Smile

I'm sorry... Embarassed
prikryl wrote:

I suppose that you still use SFTP (not SCP). What version of SFTP? On status line (bottom of the main windows) you can see something like "SFTP (v3)".

YES, SFTP (v3), my SFTP server is a linux SSH.com 3.2.9.1
prikryl wrote:

Please can you try repeat following tests that I did one my SFTP v3 server (and it was working as expected). The key shortcuts correspons to Norton-commander interface.
- create directory "somedir" (F7)

YES
prikryl wrote:

- enter the directory

YES
prikryl wrote:

- create directory "somesubdir" (F7)

YES
prikryl wrote:

- select "somesubdir" in panel (it should be selected when created)

YES
prikryl wrote:

- execute "add/edit link" command (Alt-F6). Dialog is displayed with 2nd box (point link to) prefilled with "somesubdir".

YES
prikryl wrote:

- enter "link1" to the first box (link file).
- press ok

YES
prikryl wrote:

- symbolic link "link1" is created in current directory. it has directory icon with small arrow over it.

NO, it is created a symbolic link "somesubdir" in the home root (/, I'm chrooted...).
Looking at symbolic link properties I see:
"Location: /
Links to: /somedir/link1"
prikryl wrote:

- it is RELATIVE. it points to "somesubdir", NOT to "/.../somedir/somesubdir".

NO, it is ABSOLUTE
Directly logged with SSH on the remote server (as superuser), I see in the SFTP account's home dir this symbolic link:
somesubdir -> /somedir/link1
It seems the server has execute the equivalent command: "ln -s /somedir/link1 somesubdir" and not the expected: "ln -s somesubdir link1"
prikryl wrote:

- select "somesubdir" or ".." in panel (or anything else than symlink = link1)

YES
prikryl wrote:

- execute "add/edit link" command (Alt-F6). Enter "link2" to "link file" box and "link1" to "point link to" box.
- press ok.

YES
prikryl wrote:

- symlink "link2" is created in current directory. it has directory icon with small arrow over it. And it is also RELATIVE.

NO, it is created a symbolic link "link1" in the home root, lookin at properties:
"Location: /
Links to: /somedir/link2"
prikryl wrote:

In SSH terminal "ls -la" in "somedir" directory prints:
total 4
lrwxrwxrwx 1 xprim14 users 10 Mar 19 09:01 link1 -> somesubdir
lrwxrwxrwx 1 xprim14 users 5 Mar 19 09:06 link2 -> link1
drwxr-xr-x 2 xprim14 users 4096 Mar 19 08:58 somesubdir

NO, "ls -la" in the SFTP account's root dir prints:
link1 -> /somedir/link2
somesubdir -> /somedir/link1

Sob! Crying or Very sad
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
Quote:
prikryl wrote:

- symbolic link "link1" is created in current directory. it has directory icon with small arrow over it.

NO, it is created a symbolic link "somesubdir" in the home root (/, I'm chrooted...).
Looking at symbolic link properties I see:
"Location: /
Links to: /somedir/link1"

Sad Do you have any non-chrooted account? If you do, please try to do the same with it to check it really has something to do with chrooted enviroment. It may break the SFTP implementation. Please let me know. However I'm leaving for one week now, so do not expect an anwer soon.
_________________
Martin Prikryl
Guest




prikryl wrote:
Anonymous wrote:
Found another small thing concerning symbolic links: On our debian linux system a symbolic link (link2) pointing to a symbolic link (link1) pointing to a folder is displayed as a link to a file:

link2 -> link1
link1 -> folder

It works fine for me. Is it SFTP or SCP? What version of SFTP? Please post a log file.


Sorry, my fault. Was using SCp. Now using SFTP all works fine. Should have checked this first. Thanks for the help!

negg.
minnoce

Guest


prikryl wrote:
Sad Do you have any non-chrooted account? If you do, please try to do the same with it to check it really has something to do with chrooted enviroment. It may break the SFTP implementation. Please let me know. However I'm leaving for one week now, so do not expect an anwer soon.


Yes, the server is under my full control Wink .
I tried the same test logged as root (no chrooted) with same bad results Crying or Very sad .

The problem seems to be restricted to WinSCP.
Using SSH.com's SFTP command line version (tested under both Linux & Windows) there are no problems at all creating symlinks (SFTP command SYMLINK) of any type, relative or absolute, logged as chrooted or no chrooted accounts.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
minnoce wrote:
The problem seems to be restricted to WinSCP.
Using SSH.com's SFTP command line version (tested under both Linux & Windows) there are no problems at all creating symlinks (SFTP command SYMLINK) of any type, relative or absolute, logged as chrooted or no chrooted accounts.

It seems rather restricted to SCP protocol with WinSCP. In the post before you wrote that with SFTP it works fine. Does it?
_________________
Martin Prikryl
minnoce

Guest


prikryl wrote:
It seems rather restricted to SCP protocol with WinSCP. In the post before you wrote that with SFTP it works fine. Does it?

NO. You are reading the incorrect "sub-thread"...
The messages signed by "negg" are not pertinent my problems with symbolic links (I are the user with chrooted environment problems).

minnoce
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
minnoce wrote:
NO. You are reading the incorrect "sub-thread"...
The messages signed by "negg" are not pertinent my problems with symbolic links (I are the user with chrooted environment problems).

Sorry, I haven't noticed that. However I do not know how to help you. Can you create a test account on your server for me?
_________________
Martin Prikryl
minnoce

Guest


prikryl wrote:
Sorry, I haven't noticed that. However I do not know how to help you. Can you create a test account on your server for me?

Sorry... creating accounts for externals is not permitted...
If You read my last previous messages, You notice that I think this is a GENERAL problem (not only chrooted environment) beetwen WinSCP and SSH.com server.
Can You test your own SSH.com server on Unix/Linux (is freely available) trying creating symbolic links with WinSCP client?

minnoce
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
minnoce wrote:
If You read my last previous messages, You notice that I think this is a GENERAL problem (not only chrooted environment) beetwen WinSCP and SSH.com server.
Can You test your own SSH.com server on Unix/Linux (is freely available) trying creating symbolic links with WinSCP client?

I do not have any unix server where I can install software. However I have downloaded evaluation version for Windows. I'll try it soon.
_________________
Martin Prikryl
minnoce

Guest


prikryl wrote:
I do not have any unix server where I can install software. However I have downloaded evaluation version for Windows. I'll try it soon.

Thanks for your work...
I tested WinSCP creating symbolic links on a Linux OpenSSH server and all work FINE.
The problem seems to be resctricted to SSH.com server.

minnoce
minnoce

Guest


prikryl wrote:
I do not have any unix server where I can install software. However I have downloaded evaluation version for Windows. I'll try it soon.

I obtained to open for You an account on a SSH.com Linux Box (only for a limited time, a week).
Can You tell-me instructions for send confidentially to You the login information?

Minnoce
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
minnoce wrote:
I obtained to open for You an account on a SSH.com Linux Box (only for a limited time, a week).
Can You tell-me instructions for send confidentially to You the login information?

That is good news, thanks! In my forum account profile, you'll an email address.
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License