Commit 829e1edb authored by weinig@apple.com's avatar weinig@apple.com

Rollout r82042 (If a user doesn't have a Database/LocalStorage directory, it...

Rollout r82042 (If a user doesn't have a Database/LocalStorage directory, it can't be created (sandbox violations))

-[NSString stringByResolvingSymlinksInPath] does not do what we needed for paths within /private.
This caused all SSL sites to stop working.

* WebProcess/mac/WebProcessMac.mm:
(WebKit::appendSandboxParameterPath):
(WebKit::initializeSandbox):



git-svn-id: svn://svn.chromium.org/blink/trunk@82043 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 63d489e7
2011-03-26 Sam Weinig <sam@webkit.org>
Rollout r82042 (If a user doesn't have a Database/LocalStorage directory, it can't be created (sandbox violations))
-[NSString stringByResolvingSymlinksInPath] does not do what we needed for paths within /private.
This caused all SSL sites to stop working.
* WebProcess/mac/WebProcessMac.mm:
(WebKit::appendSandboxParameterPath):
(WebKit::initializeSandbox):
2011-03-26 Sam Weinig <sam@webkit.org>
Reviewed by Anders Carlsson.
......
......@@ -121,15 +121,14 @@ bool WebProcess::fullKeyboardAccessEnabled()
}
#if ENABLE(WEB_PROCESS_SANDBOX)
static void appendSandboxParameterPath(Vector<const char*>& vector, const char* name, NSString *path)
{
vector.append(name);
vector.append(fastStrDup([[path stringByResolvingSymlinksInPath] fileSystemRepresentation]));
}
static void appendSandboxParameterPath(Vector<const char*>& vector, const char* name, const char* path)
{
appendSandboxParameterPath(vector, name, [[NSFileManager defaultManager] stringWithFileSystemRepresentation:path length:strlen(path)]);
char normalizedPath[PATH_MAX];
if (!realpath(path, normalizedPath))
normalizedPath[0] = '\0';
vector.append(name);
vector.append(fastStrDup(normalizedPath));
}
static void appendSandboxParameterConfPath(Vector<const char*>& vector, const char* name, int confID)
......@@ -152,12 +151,12 @@ static void initializeSandbox(const WebProcessCreationParameters& parameters)
Vector<const char*> sandboxParameters;
appendSandboxParameterPath(sandboxParameters, "HOME_DIR", NSHomeDirectory());
appendSandboxParameterPath(sandboxParameters, "WEBKIT2_FRAMEWORK_DIR", [[[NSBundle bundleForClass:NSClassFromString(@"WKView")] bundlePath] stringByDeletingLastPathComponent]);
appendSandboxParameterPath(sandboxParameters, "HOME_DIR", [NSHomeDirectory() fileSystemRepresentation]);
appendSandboxParameterPath(sandboxParameters, "WEBKIT2_FRAMEWORK_DIR", [[[[NSBundle bundleForClass:NSClassFromString(@"WKView")] bundlePath] stringByDeletingLastPathComponent] fileSystemRepresentation]);
appendSandboxParameterConfPath(sandboxParameters, "DARWIN_USER_TEMP_DIR", _CS_DARWIN_USER_TEMP_DIR);
appendSandboxParameterConfPath(sandboxParameters, "DARWIN_USER_CACHE_DIR", _CS_DARWIN_USER_CACHE_DIR);
appendSandboxParameterPath(sandboxParameters, "WEBKIT_DATABASE_DIR", (NSString *)parameters.databaseDirectory);
appendSandboxParameterPath(sandboxParameters, "WEBKIT_LOCALSTORAGE_DIR", (NSString *)parameters.localStorageDirectory);
appendSandboxParameterPath(sandboxParameters, "WEBKIT_DATABASE_DIR", [(NSString *)parameters.databaseDirectory fileSystemRepresentation]);
appendSandboxParameterPath(sandboxParameters, "WEBKIT_LOCALSTORAGE_DIR", [(NSString *)parameters.localStorageDirectory fileSystemRepresentation]);
appendSandboxParameterPath(sandboxParameters, "NSURL_CACHE_DIR", parameters.nsURLCachePath.data());
appendSandboxParameterPath(sandboxParameters, "UI_PROCESS_BUNDLE_RESOURCE_DIR", parameters.uiProcessBundleResourcePath.data());
sandboxParameters.append(static_cast<const char*>(0));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment