summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorteor <teor2345@gmail.com>2015-07-08 02:17:31 +1000
committerteor <teor2345@gmail.com>2015-07-08 02:17:31 +1000
commit57c61f39a0bf0b2e40f58719893a798189f6634f (patch)
tree329bb121f62653155185c57877838931f8487657 /src/common
parent19440b9e58b3d824057abd3a0faf08fd7cb891ff (diff)
downloadtor-57c61f39a0bf0b2e40f58719893a798189f6634f.tar.gz
tor-57c61f39a0bf0b2e40f58719893a798189f6634f.zip
Always use the sandbox in tor_open_cloexec
Use the sandbox in tor_open_cloexec, whether or not O_CLOEXEC is defined. Patch by "teor". Fix on 0.2.3.1-alpha.
Diffstat (limited to 'src/common')
-rw-r--r--src/common/compat.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/common/compat.c b/src/common/compat.c
index 7e50729c01..68544c8bd5 100644
--- a/src/common/compat.c
+++ b/src/common/compat.c
@@ -150,9 +150,8 @@ int
tor_open_cloexec(const char *path, int flags, unsigned mode)
{
int fd;
- const char *p = path;
+ const char *p = sandbox_intern_string(path);
#ifdef O_CLOEXEC
- p = sandbox_intern_string(path);
fd = open(p, flags|O_CLOEXEC, mode);
if (fd >= 0)
return fd;