Skip to content

Commit

Permalink
Fix dns handling on headless/docker systems
Browse files Browse the repository at this point in the history
Signed-off-by: keliramu <[email protected]>
  • Loading branch information
keliramu authored and mariusSincovici committed Apr 3, 2024
1 parent aa08f07 commit 7a8d07a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions daemon/dns/dns_resolvectl.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import (
"log"
"os/exec"
"strings"

"github.com/NordSecurity/nordvpn-linux/internal"
)

// Executables
Expand All @@ -27,7 +25,13 @@ func (m *Resolvectl) Unset(iface string) error {
}

func (m *Resolvectl) IsAvailable() bool {
return internal.IsCommandAvailable(execResolvectl)
// resolvectl binary can be installed/available in headless/docker system;
// let's check if it is functional;
// #nosec G204 -- input is properly validated
if _, err := exec.Command("resolvectl", "status").CombinedOutput(); err != nil {
return false
}
return true
}

func (m *Resolvectl) Name() string {
Expand Down

0 comments on commit 7a8d07a

Please sign in to comment.