Skip to content

Commit

Permalink
Merge pull request #14 from carapace-sh/termux-fix-path
Browse files Browse the repository at this point in the history
termux: fix path
  • Loading branch information
rsteube authored Oct 27, 2024
2 parents b99bcb9 + eff3853 commit f09a3aa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions termux/1-hardcoded-etc-resolv-conf/patch.diff
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
switch c.mdnsTest {
case mdnsFromSystem:
- _, err := os.Stat("/etc/mdns.allow")
+ _, err := os.Stat("/data/data/com.termux/files/etc/mdns.allow")
+ _, err := os.Stat("/data/data/com.termux/files/usr/etc/mdns.allow")
if err != nil && !errors.Is(err, fs.ErrNotExist) {
// Let libc figure out what is going on.
return hostLookupCgo, dnsConf
Expand Down Expand Up @@ -56,7 +56,7 @@

func getSystemDNSConfig() *dnsConfig {
- resolvConf.tryUpdate("/etc/resolv.conf")
+ resolvConf.tryUpdate("/data/data/com.termux/files/etc/resolv.conf")
+ resolvConf.tryUpdate("/data/data/com.termux/files/usr/etc/resolv.conf")
return resolvConf.dnsConfig.Load()
}

Expand All @@ -65,7 +65,7 @@
// 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("/data/data/com.termux/files/etc/resolv.conf"))
+ conf.dnsConfig.Store(dnsReadConfig("/data/data/com.termux/files/usr/etc/resolv.conf"))
conf.lastChecked = time.Now()

// Prepare ch so that only one update of resolverConfig may
2 changes: 1 addition & 1 deletion termux/3-src-crypto-x509-root_linux.go/patch.diff
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ index 8e79ccb..1176471 100644

// Possible certificate files; stop after finding one.
var certFiles = []string{
+ "/data/data/com.termux/files/etc/tls/cert.pem", // Termux
+ "/data/data/com.termux/files/usr/etc/tls/cert.pem", // Termux
"/etc/ssl/certs/ca-certificates.crt", // Debian/Ubuntu/Gentoo etc.
"/etc/pki/tls/certs/ca-bundle.crt", // Fedora/RHEL 6
"/etc/ssl/ca-bundle.pem", // OpenSUSE
2 changes: 1 addition & 1 deletion termux/4-src-os-file_unix.go.patch/patch.diff
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ index a527b23..3a302f9 100644
if dir == "" {
if runtime.GOOS == "android" {
- dir = "/data/local/tmp"
+ dir = "/data/data/com.termux/files/tmp"
+ dir = "/data/data/com.termux/files/usr/tmp"
} else {
dir = "/tmp"
}

0 comments on commit f09a3aa

Please sign in to comment.