Set the current working directory to TMPDIR when entering the sandbox in the plug...
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Oct 2012 22:59:41 +0000 (22:59 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Oct 2012 22:59:41 +0000 (22:59 +0000)
Based on a patch by Ivan Krstić.

Reviewed by Anders Carlsson.

* WebProcess/Plugins/Netscape/mac/NetscapeSandboxFunctions.mm:
(enterSandbox):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@130566 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapeSandboxFunctions.mm

index 8374854..00b2b11 100644 (file)
@@ -1,3 +1,13 @@
+2012-10-05  Sam Weinig  <sam@webkit.org>
+
+        Set the current working directory to TMPDIR when entering the sandbox in the plug-in process.
+        Based on a patch by Ivan Krstić.
+
+        Reviewed by Anders Carlsson.
+
+        * WebProcess/Plugins/Netscape/mac/NetscapeSandboxFunctions.mm:
+        (enterSandbox):
+
 2012-10-05  Tim Horton  <timothy_horton@apple.com>
 
         [cg] GraphicsContextCG should ask CG whether the shadow offset workaround is required
index 07cd2e7..e947449 100644 (file)
@@ -109,6 +109,10 @@ NPError enterSandbox(const char* sandboxProfile, const char* readOnlyPaths[], co
         exit(EX_NOPERM);
     }
     setenv("TMPDIR", temporaryDirectory, 1);
+    if (chdir(temporaryDirectory) == -1) {
+        WTFLogAlways("PluginProcess: couldn't change working directory to temporary path: %s, errno %d\n", temporaryDirectory, errno);
+        exit(EX_OSERR);
+    }
 #endif