mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-27 12:15:33 +00:00
Bug 1384483 - Allow reading userContent.css in the sandbox. r=jld
MozReview-Commit-ID: A43RY1J95VF --HG-- extra : rebase_source : 0c8355b34e79d8b0f4ec744a6f2b8b4414e0ab5c extra : histedit_source : 6ddf29193d5a8b26e50a6a5b8e885caeff366033
This commit is contained in:
parent
91ca7a8cc8
commit
0d8bd27705
@ -250,6 +250,25 @@ SandboxBrokerPolicyFactory::GetContentPolicy(int aPid, bool aFileProcess)
|
||||
policy->AddDir(rdonly, "/");
|
||||
}
|
||||
|
||||
// userContent.css sits in the profile, which is normally blocked
|
||||
// and we can't get the profile dir earlier
|
||||
nsCOMPtr<nsIFile> profileDir;
|
||||
nsresult rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR,
|
||||
getter_AddRefs(profileDir));
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
rv = profileDir->AppendNative(NS_LITERAL_CSTRING("chrome"));
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
rv = profileDir->AppendNative(NS_LITERAL_CSTRING("userContent.css"));
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsAutoCString tmpPath;
|
||||
rv = profileDir->GetNativePath(tmpPath);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
policy->AddPath(rdonly, tmpPath.get());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Return the common policy.
|
||||
return policy;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user