]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Always use the sandbox in tor_open_cloexec
authorteor <teor2345@gmail.com>
Tue, 7 Jul 2015 16:17:31 +0000 (02:17 +1000)
committerteor <teor2345@gmail.com>
Tue, 7 Jul 2015 16:17:31 +0000 (02:17 +1000)
Use the sandbox in tor_open_cloexec, whether or not O_CLOEXEC is defined.
Patch by "teor". Fix on 0.2.3.1-alpha.

changes/bug16515-sandbox-cloexec [new file with mode: 0644]
src/common/compat.c

diff --git a/changes/bug16515-sandbox-cloexec b/changes/bug16515-sandbox-cloexec
new file mode 100644 (file)
index 0000000..2130f85
--- /dev/null
@@ -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.
index 7e50729c01d1241cda43a1c74a5468307cb07742..68544c8bd5b2ee41928a804d6b0a53320a611da3 100644 (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;