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.
This commit is contained in:
teor 2015-07-08 02:17:31 +10:00
parent 19440b9e58
commit 57c61f39a0
2 changed files with 4 additions and 2 deletions

View File

@ -0,0 +1,3 @@
o Minor fixes (sandbox, files):
- Use the sandbox in tor_open_cloexec whether or not O_CLOEXEC is defined.
Patch by "teor". Fix on 0.2.3.1-alpha.

View File

@ -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;