Skip to content

Commit

Permalink
Fix a bug in pathname processing in SFTP client symlink request
Browse files Browse the repository at this point in the history
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!
  • Loading branch information
ronf committed Jan 26, 2024
1 parent 88e87eb commit 3807b64
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions asyncssh/sftp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 3807b64

Please sign in to comment.