Bug 825538 - sftp: remote directory always prepended to relative symbolic links
Summary: sftp: remote directory always prepended to relative symbolic links
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: openssh
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Petr Lautrbach
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-05-27 15:44 UTC by Enrico Scholz
Modified: 2015-02-03 12:02 UTC (History)
6 users (show)

Fixed In Version: openssh-6.4p1-8.fc20
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-03 12:02:40 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Dist git patch to backport fix from upstream to f20 (1.86 KB, patch)
2015-01-09 16:17 UTC, Jakub Jelen
no flags Details | Diff

Description Enrico Scholz 2012-05-27 15:44:17 UTC
Description of problem:

It is impossible to create relative symbolic links with recent 'sftp' utilities because the remote path will always be prepended:

----
$ sftp `hostname`
sftp> symlink foo0 /tmp/foo
debug3: Sent message SSH2_FXP_SYMLINK "/home/ensc/foo0" -> "/tmp/foo"

sftp> symlink ../bar /tmp/bar
debug3: Sent message SSH2_FXP_SYMLINK "/home/ensc/../bar" -> "/tmp/bar"

$ ls -l /tmp/foo /tmp/bar
lrwxrwxrwx. 1 ensc ensc 17 27. Mai 17:37 /tmp/bar -> /home/ensc/../bar
lrwxrwxrwx. 1 ensc ensc 14 27. Mai 17:37 /tmp/foo -> /home/ensc/foo0
----

Working symbolic links are critical because they do not depend on how filesystems are mounted.

The 'symlink' implementations of RHEL6 (openssh-5.3p1-70.el6_2.2.x86_64) and RHEL5 are creating relative links.


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

openssh-clients-5.8p2-25.fc16.x86_64

Comment 1 Fedora End Of Life 2013-01-16 17:02:15 UTC
This message is a reminder that Fedora 16 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 16. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '16'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 16's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 16 is end of life. If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora, you are encouraged to click on 
"Clone This Bug" and open it against that version of Fedora.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 2 Enrico Scholz 2013-01-16 22:23:51 UTC
still with openssh-5.9p1-28.fc17.x86_64

Comment 3 Fedora End Of Life 2013-07-04 02:42:04 UTC
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '17'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 17's end of life.

Bug Reporter:  Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 17 is end of life. If you 
would still like  to see this bug fixed and are able to reproduce it 
against a later version  of Fedora, you are encouraged  change the 
'version' to a later Fedora version prior to Fedora 17's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 4 Fedora End Of Life 2013-08-01 09:12:52 UTC
Fedora 17 changed to end-of-life (EOL) status on 2013-07-30. Fedora 17 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 5 Enrico Scholz 2014-02-02 01:44:38 UTC
reopening; still with openssh-6.4p1-3.fc20.x86_64

Comment 6 Jakub Jelen 2015-01-09 15:45:07 UTC
I tried your use case and it works for me now on current F-21 release:
openssh-6.6.1p1-9.fc21.x86_64


[root@localhost ~]# sftp localhost
Connected to localhost.
sftp> symlink foo0 /tmp/foo
sftp> symlink ../bar /tmp/bar
sftp> ^D
[root@localhost ~]# 
[root@localhost ~]# ls -l /tmp/foo /tmp/bar
lrwxrwxrwx. 1 root root 6 Jan  9 16:16 /tmp/bar -> ../bar
lrwxrwxrwx. 1 root root 4 Jan  9 16:16 /tmp/foo -> foo0


But still doesn't work on current F-20:
openssh-6.4p1-7.fc20.x86_64

This problem should be pretty easy to fix with patch from bz1084079. This fix was introduced into upstream in version 6.5 [1]

[1] https://anongit.mindrot.org/openssh.git/commit/?id=034f27a0c09e69fe3589045b41f03f6e345b63f5

Comment 7 Jakub Jelen 2015-01-09 16:17:25 UTC
Created attachment 978264 [details]
Dist git patch to backport fix from upstream to f20

Comment 8 Petr Lautrbach 2015-01-09 16:23:40 UTC
I've pushed it to dist git. It will be in the next update. Thanks Jakub!

Comment 9 Fedora Update System 2015-01-15 15:03:34 UTC
openssh-6.4p1-8.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/openssh-6.4p1-8.fc20

Comment 10 Fedora Update System 2015-01-17 05:40:10 UTC
Package openssh-6.4p1-8.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing openssh-6.4p1-8.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2015-0756/openssh-6.4p1-8.fc20
then log in and leave karma (feedback).

Comment 11 Fedora Update System 2015-02-03 12:02:40 UTC
openssh-6.4p1-8.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.


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