fix read bug
alex wennerberg alex@alexwennerberg.com
Sat, 27 Feb 2021 08:52:49 -0800
1 files changed,
2 insertions(+),
1 deletions(-)
jump to
M
sftp.go
→
sftp.go
@@ -28,7 +28,8 @@ }
func (con *Connection) Fileread(request *sftp.Request) (io.ReaderAt, error) { // check user perms -- cant read others hidden files - fullpath := path.Join(c.FilesDirectory, filepath.Clean(request.Filepath)) + userDir := getUserDirectory(con.User) // NOTE -- not cross platform + fullpath := path.Join(userDir, filepath.Clean(request.Filepath)) f, err := os.OpenFile(fullpath, os.O_RDONLY, 0) if err != nil { return nil, err