Bug 1380132 - Part 1 - Normalize() .app paths used in sandbox profiles. r=Alex_Gaynor
MozReview-Commit-ID: GjQk5ahpzrj
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -1408,35 +1408,33 @@ GetAppPaths(nsCString &aAppPath, nsCStri
// appDir points to .app/Contents/Resources, for our purposes we want
// .app/Contents.
nsCOMPtr<nsIFile> appDirParent;
rv = appDir->GetParent(getter_AddRefs(appDirParent));
if (NS_FAILED(rv)) {
return false;
}
- bool isLink;
- app->IsSymlink(&isLink);
- if (isLink) {
- app->GetNativeTarget(aAppPath);
- } else {
- app->GetNativePath(aAppPath);
+ rv = app->Normalize();
+ if (NS_FAILED(rv)) {
+ return false;
}
- appBinary->IsSymlink(&isLink);
- if (isLink) {
- appBinary->GetNativeTarget(aAppBinaryPath);
- } else {
- appBinary->GetNativePath(aAppBinaryPath);
+ app->GetNativePath(aAppPath);
+
+ rv = appBinary->Normalize();
+ if (NS_FAILED(rv)) {
+ return false;
}
- appDirParent->IsSymlink(&isLink);
- if (isLink) {
- appDirParent->GetNativeTarget(aAppDir);
- } else {
- appDirParent->GetNativePath(aAppDir);
+ appBinary->GetNativePath(aAppBinaryPath);
+
+ rv = appDirParent->Normalize();
+ if (NS_FAILED(rv)) {
+ return false;
}
+ appDirParent->GetNativePath(aAppDir);
return true;
}
// This function is only used in an |#ifdef DEBUG| path.
#ifdef DEBUG
// Given a path to a file, return the directory which contains it.
static nsAutoCString