flounder

A simple gemini site builder
Log | Files | Refs | README | LICENSE

commit 6a448532723ac8abf673b4964260d8f4a4ed2fb2
parent f8d68c8141b6f949e42d900e1def34d1d8198e10
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Sat, 27 Feb 2021 08:52:49 -0800

fix read bug

Diffstat:
Msftp.go | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sftp.go b/sftp.go @@ -28,7 +28,8 @@ type Connection struct { 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