From 1f16d9914c08f4feaf802393454911b5b6514b18 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Thu, 8 Aug 2013 04:52:05 +0000 Subject: fix two year old regression: symlinking a file would incorrectly canonicalise the target path. bz#2129 report from delphij AT freebsd.org --- usr.bin/ssh/sftp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'usr.bin') diff --git a/usr.bin/ssh/sftp.c b/usr.bin/ssh/sftp.c index 55975ff697c..90bb03c516e 100644 --- a/usr.bin/ssh/sftp.c +++ b/usr.bin/ssh/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 * @@ -1337,7 +1337,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; -- cgit v1.2.3