summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2013-08-21 02:40:44 +1000
committerDamien Miller <djm@mindrot.org>2013-08-21 02:40:44 +1000
commit034f27a0c09e69fe3589045b41f03f6e345b63f5 (patch)
tree2cc8f94b7a702638c36c281ca4f6c31e79a406ff
parentc6895c5c67492144dd28589e5788f783be9152ed (diff)
- djm@cvs.openbsd.org 2013/08/08 04:52:04
[sftp.c] fix two year old regression: symlinking a file would incorrectly canonicalise the target path. bz#2129 report from delphij AT freebsd.org
-rw-r--r--ChangeLog4
-rw-r--r--sftp.c5
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 295c42ab..16bb10b4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,6 +15,10 @@
- jmc@cvs.openbsd.org 2013/08/07 06:24:51
[sftp.1 sftp.c]
sort -a;
+ - djm@cvs.openbsd.org 2013/08/08 04:52:04
+ [sftp.c]
+ fix two year old regression: symlinking a file would incorrectly
+ canonicalise the target path. bz#2129 report from delphij AT freebsd.org
20130808
- (dtucker) [regress/Makefile regress/test-exec.sh] Don't try to use test -nt
diff --git a/sftp.c b/sftp.c
index 4e1a026f..6f16f7cc 100644
--- a/sftp.c
+++ b/sftp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp.c,v 1.150 2013/08/07 06:24:51 jmc Exp $ */
+/* $OpenBSD: sftp.c,v 1.151 2013/08/08 04:52:04 djm Exp $ */
/*
* Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
*
@@ -1358,7 +1358,8 @@ parse_dispatch_command(struct sftp_conn *conn, const char *cmd, char **pwd,
case I_SYMLINK:
sflag = 1;
case I_LINK:
- path1 = make_absolute(path1, *pwd);
+ if (!sflag)
+ path1 = make_absolute(path1, *pwd);
path2 = make_absolute(path2, *pwd);
err = (sflag ? do_symlink : do_hardlink)(conn, path1, path2);
break;