From 70c2c1100ac57b9444e71fd76b5c5f3205c71024 Mon Sep 17 00:00:00 2001 From: Jeff Halter <868228+jhalter@users.noreply.github.com> Date: Mon, 1 Apr 2024 14:38:09 -0700 Subject: Fix handling of absolute paths in FileRoot config field --- hotline/server.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'hotline') diff --git a/hotline/server.go b/hotline/server.go index 6b55cf8..e4232b6 100644 --- a/hotline/server.go +++ b/hotline/server.go @@ -257,7 +257,10 @@ func NewServer(configDir, netInterface string, netPort int, logger *zap.SugaredL return nil, err } - server.Config.FileRoot = filepath.Join(configDir, "Files") + // If the FileRoot is an absolute path, use it, otherwise treat as a relative path to the config dir. + if !filepath.IsAbs(server.Config.FileRoot) { + server.Config.FileRoot = filepath.Join(configDir, server.Config.FileRoot) + } *server.NextGuestID = 1 -- cgit