1 diff -u -r ../apt-1.1.3/apt-pkg/contrib/fileutl.cc ./apt-pkg/contrib/fileutl.cc
2 --- ../apt-1.1.3/apt-pkg/contrib/fileutl.cc 2015-11-30 03:08:24.000000000 -0500
3 +++ ./apt-pkg/contrib/fileutl.cc 2015-12-03 17:43:23.360831115 -0500
8 - if (chdir("/tmp/") != 0)
9 + if (chdir("@TERMUX_PREFIX@/tmp/") != 0)
12 unsigned int Count = 1;
14 std::vector<std::string> Glob(std::string const &pattern, int flags)
16 std::vector<std::string> result;
22 result.push_back(string(globbuf.gl_pathv[i]));
29 @@ -2136,10 +2138,10 @@
31 if (!tmpdir || strlen(tmpdir) == 0 || // tmpdir is set
32 stat(tmpdir, &st) != 0 || (st.st_mode & S_IFDIR) == 0) // exists and is directory
34 + tmpdir = "@TERMUX_PREFIX@/tmp";
35 else if (geteuid() != 0 && // root can do everything anyway
36 faccessat(-1, tmpdir, R_OK | W_OK | X_OK, AT_EACCESS | AT_SYMLINK_NOFOLLOW) != 0) // current user has rwx access to directory
38 + tmpdir = "@TERMUX_PREFIX@/tmp";
40 return string(tmpdir);