all repos — flounder @ 6a448532723ac8abf673b4964260d8f4a4ed2fb2

A small site builder for the Gemini protocol

fix read bug
alex wennerberg alex@alexwennerberg.com
Sat, 27 Feb 2021 08:52:49 -0800
commit

6a448532723ac8abf673b4964260d8f4a4ed2fb2

parent

f8d68c8141b6f949e42d900e1def34d1d8198e10

1 files changed, 2 insertions(+), 1 deletions(-)

jump to
M sftp.gosftp.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