From 3807b64d43cecd5473b822752203e8226e52d8a5 Mon Sep 17 00:00:00 2001 From: Ron Frederick Date: Thu, 25 Jan 2024 17:07:25 -0800 Subject: [PATCH] Fix a bug in pathname processing in SFTP client symlink request MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit fixes the processing of path name arguments in the SFTPClient symlink method. Path normalization was previously being done on the wrong argument. Thanks go to André Glüpker for reporting the problem and providing test code to demonstrate it! --- asyncssh/sftp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/asyncssh/sftp.py b/asyncssh/sftp.py index 96f1e6a..365ba1e 100644 --- a/asyncssh/sftp.py +++ b/asyncssh/sftp.py @@ -5329,8 +5329,8 @@ async def symlink(self, oldpath: _SFTPPath, newpath: _SFTPPath) -> None: """ - oldpath = self.compose_path(oldpath) - newpath = self.encode(newpath) + oldpath = self.encode(oldpath) + newpath = self.compose_path(newpath) await self._handler.symlink(oldpath, newpath) async def link(self, oldpath: _SFTPPath, newpath: _SFTPPath) -> None: