From 022fb24cd92035470496d50d86bf8c9ee74b1e7e Mon Sep 17 00:00:00 2001 From: Chuangbo Li Date: Mon, 12 Aug 2024 18:11:59 +0800 Subject: [PATCH] Fix command get policy works with relative policy path (#2051) --- hscontrol/grpcv1.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hscontrol/grpcv1.go b/hscontrol/grpcv1.go index a351048..d4e1084 100644 --- a/hscontrol/grpcv1.go +++ b/hscontrol/grpcv1.go @@ -692,7 +692,8 @@ func (api headscaleV1APIServer) GetPolicy( }, nil case types.PolicyModeFile: // Read the file and return the contents as-is. - f, err := os.Open(api.h.cfg.Policy.Path) + absPath := util.AbsolutePathFromConfigPath(api.h.cfg.Policy.Path) + f, err := os.Open(absPath) if err != nil { return nil, err }