all repos — flounder @ 521d6b600460a4d4ebb271b50e003c9d9d8218b5

A small site builder for the Gemini protocol

Hide hidden folder (hacky)
alex wennerberg alex@alexwennerberg.com
Fri, 26 Feb 2021 21:26:42 -0800
commit

521d6b600460a4d4ebb271b50e003c9d9d8218b5

parent

d47a986e83bfba489d6c7a5cf05c602f64254f74

1 files changed, 3 insertions(+), 0 deletions(-)

jump to
M sftp.gosftp.go

@@ -50,6 +50,9 @@ }

func (conn *Connection) Filelist(request *sftp.Request) (sftp.ListerAt, error) { fullpath := path.Join(c.FilesDirectory, filepath.Clean(request.Filepath)) + if strings.Contains(request.Filepath, ".hidden") { + return nil, fmt.Errorf("Invalid permissions") // TODO fix better + } switch request.Method { case "List": f, err := os.Open(fullpath)