From 7752733fb9fa73db6fb789e83a8069a23ba9610f Mon Sep 17 00:00:00 2001 From: hexxa Date: Fri, 13 Aug 2021 17:22:35 +0800 Subject: [PATCH] feat(files): disallow normal users to access home dir --- src/handlers/fileshdr/handlers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/handlers/fileshdr/handlers.go b/src/handlers/fileshdr/handlers.go index 42cad39..75fd2d1 100644 --- a/src/handlers/fileshdr/handlers.go +++ b/src/handlers/fileshdr/handlers.go @@ -96,7 +96,7 @@ func (h *FileHandlers) canAccess(userID, role, op, path string) bool { // the file path must start with userID: /... parts := strings.Split(path, "/") - if len(parts) < 1 { + if len(parts) < 2 { // the path must be longer than /files return false } else if parts[0] == userID { return true