From c702402b878b43ef73b69308924a620b24a2cb8c Mon Sep 17 00:00:00 2001 From: MickaelK Date: Tue, 2 Jan 2024 23:26:25 +1100 Subject: [PATCH] fix (plg_backend_local): don't enforce home to be set --- server/plugin/plg_backend_local/index.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/plugin/plg_backend_local/index.go b/server/plugin/plg_backend_local/index.go index 884096cd..fd549418 100644 --- a/server/plugin/plg_backend_local/index.go +++ b/server/plugin/plg_backend_local/index.go @@ -46,7 +46,11 @@ func (this Local) LoginForm() Form { } func (this Local) Home() (string, error) { - return os.UserHomeDir() + home, err := os.UserHomeDir() + if err != nil { + return "/", nil + } + return home, nil } func (this Local) Ls(path string) ([]os.FileInfo, error) {