mirror of
https://github.com/juanfont/headscale.git
synced 2026-03-30 22:22:14 +02:00
fix: add error checking in acl and poll
If aclPolicy is not defined, in updateAclPolicy, return an error.
This commit is contained in:
17
poll.go
17
poll.go
@@ -95,15 +95,16 @@ func (h *Headscale) PollNetMapHandler(ctx *gin.Context) {
|
||||
now := time.Now().UTC()
|
||||
|
||||
// update ACLRules with peer informations (to update server tags if necessary)
|
||||
err = h.UpdateACLRules()
|
||||
if err != nil {
|
||||
log.Error().
|
||||
Caller().
|
||||
Str("func", "handleAuthKey").
|
||||
Str("machine", machine.Name).
|
||||
Err(err)
|
||||
if h.aclPolicy != nil {
|
||||
err = h.UpdateACLRules()
|
||||
if err != nil {
|
||||
log.Error().
|
||||
Caller().
|
||||
Str("func", "handleAuthKey").
|
||||
Str("machine", machine.Name).
|
||||
Err(err)
|
||||
}
|
||||
}
|
||||
|
||||
// From Tailscale client:
|
||||
//
|
||||
// ReadOnly is whether the client just wants to fetch the MapResponse,
|
||||
|
||||
Reference in New Issue
Block a user