Files
termux-packages/packages/golang/fix-hardcoded-etc-resolv-conf.diff
termux-pacman-bot b2b15d3a96 golang: Bump to 1.20
2023-02-03 20:31:59 +00:00

72 lines
1.8 KiB
Diff

--- a/src/net/conf.go
+++ b/src/net/conf.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build !js
+//go:build !js && !android
package net
--- a/src/net/conf_android.go
+++ b/src/net/conf_android.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build !js
+//go:build android
package net
@@ -109,7 +109,7 @@
return
}
- if _, err := os.Stat("/etc/mdns.allow"); err == nil {
+ if _, err := os.Stat("@TERMUX_PREFIX@/etc/mdns.allow"); err == nil {
confVal.hasMDNSAllow = true
}
}
--- a/src/net/dnsclient_unix.go
+++ b/src/net/dnsclient_unix.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build !js
+//go:build !js && !android
// DNS client: see RFC 1035.
// Has to be linked into package net for Dial.
--- a/src/net/dnsclient_android.go
+++ b/src/net/dnsclient_android.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build !js
+//go:build android
// DNS client: see RFC 1035.
// Has to be linked into package net for Dial.
@@ -349,7 +349,7 @@
var resolvConf resolverConfig
func getSystemDNSConfig() *dnsConfig {
- resolvConf.tryUpdate("/etc/resolv.conf")
+ resolvConf.tryUpdate("@TERMUX_PREFIX@/etc/resolv.conf")
return resolvConf.dnsConfig.Load()
}
@@ -357,7 +357,7 @@
func (conf *resolverConfig) init() {
// Set dnsConfig and lastChecked so we don't parse
// resolv.conf twice the first time.
- conf.dnsConfig.Store(dnsReadConfig("/etc/resolv.conf"))
+ conf.dnsConfig.Store(dnsReadConfig("@TERMUX_PREFIX@/etc/resolv.conf"))
conf.lastChecked = time.Now()
// Prepare ch so that only one update of resolverConfig may