Ensure consistent, readable working directory for WebProcess before entering sandbox
authormjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Mar 2011 22:27:15 +0000 (22:27 +0000)
committermjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Mar 2011 22:27:15 +0000 (22:27 +0000)
<rdar://problem/8951176>

Patch by Ivan Krstić <ike@apple.com> on 2011-03-30
Reviewed by Oliver Hunt.

* WebProcess/mac/WebProcessMac.mm:
(WebKit::WebProcess::platformInitializeWebProcess):

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

Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/mac/WebProcessMac.mm

index 477ae24..bacf704 100644 (file)
@@ -1,3 +1,13 @@
+2011-03-30  Ivan Krstić  <ike@apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        Ensure consistent, readable working directory for WebProcess before entering sandbox
+        <rdar://problem/8951176>
+
+        * WebProcess/mac/WebProcessMac.mm:
+        (WebKit::WebProcess::platformInitializeWebProcess):
+
 2011-03-30  Sam Weinig  <sam@webkit.org>
 
         Reviewed by Brady Eidson.
index 0d19913..88ef834 100644 (file)
@@ -188,6 +188,8 @@ static id NSApplicationAccessibilityFocusedUIElement(NSApplication*, SEL)
     
 void WebProcess::platformInitializeWebProcess(const WebProcessCreationParameters& parameters, CoreIPC::ArgumentDecoder*)
 {
+    [[NSFileManager defaultManager] changeCurrentDirectoryPath:[[NSBundle mainBundle] bundlePath]];
+
     initializeSandbox(parameters);
 
     if (!parameters.parentProcessName.isNull()) {