From 6ba1198c47582af92f940b454dbd2a1d4d8e01ed Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Mon, 22 Jul 2024 19:21:26 +0200 Subject: [PATCH] sftpd: remove unused folder prefix from Connection struct Signed-off-by: Nicola Murino --- internal/sftpd/handler.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/internal/sftpd/handler.go b/internal/sftpd/handler.go index 12adc753..ea65f394 100644 --- a/internal/sftpd/handler.go +++ b/internal/sftpd/handler.go @@ -37,11 +37,10 @@ type Connection struct { // client's version string ClientVersion string // Remote address for this connection - RemoteAddr net.Addr - LocalAddr net.Addr - channel io.ReadWriteCloser - command string - folderPrefix string + RemoteAddr net.Addr + LocalAddr net.Addr + channel io.ReadWriteCloser + command string } // GetClientVersion returns the connected client's version @@ -221,7 +220,7 @@ func (c *Connection) Filelist(request *sftp.Request) (sftp.ListerAt, error) { return nil, err } modTime := time.Unix(0, 0) - if request.Filepath != "/" || c.folderPrefix != "" { + if request.Filepath != "/" { lister.Add(vfs.NewFileInfo("..", true, 0, modTime, false)) } lister.Add(vfs.NewFileInfo(".", true, 0, modTime, false))