mirror of
https://github.com/juanfont/headscale.git
synced 2026-04-23 00:58:43 +02:00
policy/v2: keep partial IPSet on SSH destination resolution errors
In compileSSHPolicy, when resolving other (non-autogroup:self) destinations, the code discards the entire result on error via `continue`. If a destination alias (e.g., a tag owned by a group with a non-existent user) returns a partial IPSet alongside an error, valid IPs are lost. Both ACL compilation paths (compileFilterRules and compileACLWithAutogroupSelf) already handle this correctly by logging the error and using the IPSet if non-nil. Remove the `continue` so the SSH path is consistent with the ACL paths. Fixes #2990
This commit is contained in:
@@ -409,7 +409,6 @@ func (pol *Policy) compileSSHPolicy(
|
|||||||
ips, err := dst.Resolve(pol, users, nodes)
|
ips, err := dst.Resolve(pol, users, nodes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Trace().Caller().Err(err).Msgf("resolving destination ips")
|
log.Trace().Caller().Err(err).Msgf("resolving destination ips")
|
||||||
continue
|
|
||||||
}
|
}
|
||||||
if ips != nil {
|
if ips != nil {
|
||||||
dest.AddSet(ips)
|
dest.AddSet(ips)
|
||||||
|
|||||||
Reference in New Issue
Block a user