aboutsummaryrefslogtreecommitdiff
path: root/src/common/util.c
diff options
context:
space:
mode:
authorCristian Toader <cristian.matei.toader@gmail.com>2013-07-29 16:30:39 +0300
committerCristian Toader <cristian.matei.toader@gmail.com>2013-07-29 16:30:39 +0300
commit8022def6f05bf40e1c6e0fd15d77ed0ecf5c3406 (patch)
treef080ff487369b0a17d6c0e1a9b4c88560e7c379c /src/common/util.c
parent6d5b0367f6e0035f99570b5bb76a75322ae9a85e (diff)
downloadtor-8022def6f05bf40e1c6e0fd15d77ed0ecf5c3406.tar
tor-8022def6f05bf40e1c6e0fd15d77ed0ecf5c3406.tar.gz
added openat parameter filter
Diffstat (limited to 'src/common/util.c')
-rw-r--r--src/common/util.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/common/util.c b/src/common/util.c
index 651554ed2..75462b68a 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>
@@ -3042,6 +3043,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};
@@ -3085,7 +3087,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();