diff options
author | Nick Mathewson <nickm@torproject.org> | 2013-09-13 12:31:41 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-09-13 12:31:41 -0400 |
commit | e0b2cd061bd62fc790d434b2da7ecc51ed100904 (patch) | |
tree | 0bdd72522895a018e4fc9765df0f3067eff940a1 /src/common/util.c | |
parent | dffc5c3f240e7734e85a427b951c4e493c85906c (diff) | |
parent | 7cf1b9cc33ab2ba13d84e08105699dd1f39dae1d (diff) | |
download | tor-e0b2cd061bd62fc790d434b2da7ecc51ed100904.tar.gz tor-e0b2cd061bd62fc790d434b2da7ecc51ed100904.zip |
Merge remote-tracking branch 'ctoader/gsoc-cap-stage2'
Conflicts:
src/common/sandbox.c
Diffstat (limited to 'src/common/util.c')
-rw-r--r-- | src/common/util.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/common/util.c b/src/common/util.c index 6e14a58dd1..02c51a4518 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -24,6 +24,7 @@ #include "torint.h" #include "container.h" #include "address.h" +#include "../common/sandbox.h" #ifdef _WIN32 #include <io.h> @@ -1799,7 +1800,7 @@ file_status(const char *fname) int r; f = tor_strdup(fname); clean_name_for_stat(f); - r = stat(f, &st); + r = stat(sandbox_intern_string(f), &st); tor_free(f); if (r) { if (errno == ENOENT) { @@ -1849,7 +1850,7 @@ check_private_dir(const char *dirname, cpd_check_t check, tor_assert(dirname); f = tor_strdup(dirname); clean_name_for_stat(f); - r = stat(f, &st); + r = stat(sandbox_intern_string(f), &st); tor_free(f); if (r) { if (errno != ENOENT) { @@ -3039,6 +3040,7 @@ smartlist_t * tor_listdir(const char *dirname) { smartlist_t *result; + const char *prot_dname = sandbox_intern_string(dirname); #ifdef _WIN32 char *pattern=NULL; TCHAR tpattern[MAX_PATH] = {0}; @@ -3082,7 +3084,7 @@ tor_listdir(const char *dirname) #else DIR *d; struct dirent *de; - if (!(d = opendir(dirname))) + if (!(d = opendir(prot_dname))) return NULL; result = smartlist_new(); |