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-04 07:11:09.531546721 -0500
18 - if (chdir("/tmp/") != 0)
19 + if (chdir("@TERMUX_PREFIX@/tmp/") != 0)
22 unsigned int Count = 1;
24 std::vector<std::string> Glob(std::string const &pattern, int flags)
26 std::vector<std::string> result;
32 result.push_back(string(globbuf.gl_pathv[i]));
39 @@ -2136,10 +2140,10 @@
41 if (!tmpdir || strlen(tmpdir) == 0 || // tmpdir is set
42 stat(tmpdir, &st) != 0 || (st.st_mode & S_IFDIR) == 0) // exists and is directory
44 + tmpdir = "@TERMUX_PREFIX@/tmp";
45 else if (geteuid() != 0 && // root can do everything anyway
46 faccessat(-1, tmpdir, R_OK | W_OK | X_OK, AT_EACCESS | AT_SYMLINK_NOFOLLOW) != 0) // current user has rwx access to directory
48 + tmpdir = "@TERMUX_PREFIX@/tmp";
50 return string(tmpdir);