Skip to content

Commit

Permalink
Fix command get policy works with relative policy path (#2051)
Browse files Browse the repository at this point in the history
  • Loading branch information
chuangbo authored Aug 12, 2024
1 parent fcd1183 commit 022fb24
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hscontrol/grpcv1.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 022fb24

Please sign in to comment.