42 lines
1.3 KiB
Diff
42 lines
1.3 KiB
Diff
diff -u -r ../apt-1.1.3/apt-pkg/contrib/fileutl.cc ./apt-pkg/contrib/fileutl.cc
|
|
--- ../apt-1.1.3/apt-pkg/contrib/fileutl.cc 2015-11-30 03:08:24.000000000 -0500
|
|
+++ ./apt-pkg/contrib/fileutl.cc 2015-12-03 17:43:23.360831115 -0500
|
|
@@ -100,7 +100,7 @@
|
|
_exit(100);
|
|
}
|
|
|
|
- if (chdir("/tmp/") != 0)
|
|
+ if (chdir("@TERMUX_PREFIX@/tmp/") != 0)
|
|
_exit(100);
|
|
|
|
unsigned int Count = 1;
|
|
@@ -2102,6 +2102,7 @@
|
|
std::vector<std::string> Glob(std::string const &pattern, int flags)
|
|
{
|
|
std::vector<std::string> result;
|
|
+#ifndef __ANDROID__
|
|
glob_t globbuf;
|
|
int glob_res;
|
|
unsigned int i;
|
|
@@ -2121,6 +2122,7 @@
|
|
result.push_back(string(globbuf.gl_pathv[i]));
|
|
|
|
globfree(&globbuf);
|
|
+#endif
|
|
return result;
|
|
}
|
|
/*}}}*/
|
|
@@ -2136,10 +2138,10 @@
|
|
struct stat st;
|
|
if (!tmpdir || strlen(tmpdir) == 0 || // tmpdir is set
|
|
stat(tmpdir, &st) != 0 || (st.st_mode & S_IFDIR) == 0) // exists and is directory
|
|
- tmpdir = "/tmp";
|
|
+ tmpdir = "@TERMUX_PREFIX@/tmp";
|
|
else if (geteuid() != 0 && // root can do everything anyway
|
|
faccessat(-1, tmpdir, R_OK | W_OK | X_OK, AT_EACCESS | AT_SYMLINK_NOFOLLOW) != 0) // current user has rwx access to directory
|
|
- tmpdir = "/tmp";
|
|
+ tmpdir = "@TERMUX_PREFIX@/tmp";
|
|
|
|
return string(tmpdir);
|
|
}
|