We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e2d4733 + c61aaad commit a6203a5Copy full SHA for a6203a5
pkg/hosts/hosts.go
@@ -2,6 +2,7 @@ package hosts
2
3
import (
4
"fmt"
5
+ "os"
6
"regexp"
7
"runtime"
8
"sort"
@@ -27,6 +28,14 @@ type Hosts struct {
27
28
HostFilter func(string) bool
29
}
30
31
+func init() {
32
+ // goodhosts unconditionnally uses this environment variable
33
+ // as an override for the hosts file to use. We don't want admin-helper
34
+ // to modify arbitrary file, so we have to unset it before calling into
35
+ // goodhosts.
36
+ os.Unsetenv("HOSTS_PATH")
37
+}
38
+
39
func New() (*Hosts, error) {
40
file, err := hostsfile.NewHosts()
41
if err != nil {
0 commit comments