Skip to content

Commit f41c9ba

Browse files
author
Alexandre Lissy
committed
Bug 1723753 - Remove XRE_USER_SYS_EXTENSION_DEV_DIR r=handyman,robwu,haik,gcp
Differential Revision: https://phabricator.services.mozilla.com/D121647
1 parent 625f7a5 commit f41c9ba

File tree

8 files changed

+0
-101
lines changed

8 files changed

+0
-101
lines changed

security/sandbox/linux/broker/SandboxBrokerPolicyFactory.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -511,18 +511,6 @@ void SandboxBrokerPolicyFactory::InitContentPolicy() {
511511
}
512512
}
513513

514-
// ~/.mozilla/systemextensionsdev (bug 1393805)
515-
nsCOMPtr<nsIFile> sysExtDevDir;
516-
rv = NS_GetSpecialDirectory(XRE_USER_SYS_EXTENSION_DEV_DIR,
517-
getter_AddRefs(sysExtDevDir));
518-
if (NS_SUCCEEDED(rv)) {
519-
nsAutoCString tmpPath;
520-
rv = sysExtDevDir->GetNativePath(tmpPath);
521-
if (NS_SUCCEEDED(rv)) {
522-
policy->AddDir(rdonly, tmpPath.get());
523-
}
524-
}
525-
526514
if (mozilla::IsDevelopmentBuild()) {
527515
// If this is a developer build the resources are symlinks to outside the
528516
// binary dir. Therefore in non-release builds we allow reads from the whole

security/sandbox/mac/SandboxPolicyContent.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,6 @@ static const char SandboxPolicyContent[] = R"SANDBOX_LITERAL(
284284
(home-regex "/Library/Application Support/[^/]+/Extensions/")
285285
(regex "^/Library/Application Support/[^/]+/Extensions/"))
286286
287-
; bug 1393805
288-
(allow file-read*
289-
(home-subpath "/Library/Application Support/Mozilla/SystemExtensionsDev"))
290-
291287
; The following rules impose file access restrictions which get
292288
; more restrictive in higher levels. When file-origin-specific
293289
; content processes are used for file:// origin browsing, the

security/sandbox/test/browser_content_sandbox_fs_tests.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -104,16 +104,6 @@ async function testFileAccessAllPlatforms() {
104104
});
105105
}
106106

107-
let sysExtDevDir = GetSystemExtensionsDevDir();
108-
tests.push({
109-
desc: "system extensions dev dir",
110-
ok: true,
111-
browser: webBrowser,
112-
file: sysExtDevDir,
113-
minLevel: 0,
114-
func: readDir,
115-
});
116-
117107
let extensionsDir = GetProfileEntry("extensions");
118108
if (extensionsDir.exists() && extensionsDir.isDirectory()) {
119109
tests.push({

security/sandbox/test/browser_content_sandbox_utils.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,10 +289,6 @@ function GetSubdirFile(dir) {
289289
return newFile;
290290
}
291291

292-
function GetSystemExtensionsDevDir() {
293-
return Services.dirsvc.get("XRESysExtDev", Ci.nsIFile);
294-
}
295-
296292
function GetPerUserExtensionDir() {
297293
return Services.dirsvc.get("XREUSysExt", Ci.nsIFile);
298294
}

security/sandbox/win/src/sandboxbroker/sandboxBroker.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ static UniquePtr<nsString> sProfileDir;
5252
static UniquePtr<nsString> sContentTempDir;
5353
static UniquePtr<nsString> sRoamingAppDataDir;
5454
static UniquePtr<nsString> sLocalAppDataDir;
55-
static UniquePtr<nsString> sUserExtensionsDevDir;
5655
#ifdef ENABLE_SYSTEM_EXTENSION_DIRS
5756
static UniquePtr<nsString> sUserExtensionsDir;
5857
#endif
@@ -159,8 +158,6 @@ void SandboxBroker::GeckoDependentInitialize() {
159158
&sContentTempDir);
160159
CacheDirAndAutoClear(dirSvc, NS_WIN_APPDATA_DIR, &sRoamingAppDataDir);
161160
CacheDirAndAutoClear(dirSvc, NS_WIN_LOCAL_APPDATA_DIR, &sLocalAppDataDir);
162-
CacheDirAndAutoClear(dirSvc, XRE_USER_SYS_EXTENSION_DEV_DIR,
163-
&sUserExtensionsDevDir);
164161
#ifdef ENABLE_SYSTEM_EXTENSION_DIRS
165162
CacheDirAndAutoClear(dirSvc, XRE_USER_SYS_EXTENSION_DIR,
166163
&sUserExtensionsDir);
@@ -718,10 +715,6 @@ void SandboxBroker::SetSecurityLevelForContentProcess(int32_t aSandboxLevel,
718715
AddCachedDirRule(mPolicy, sandbox::TargetPolicy::FILES_ALLOW_READONLY,
719716
sProfileDir, u"\\extensions\\*"_ns);
720717

721-
// Read access to a directory for system extension dev (see bug 1393805)
722-
AddCachedDirRule(mPolicy, sandbox::TargetPolicy::FILES_ALLOW_READONLY,
723-
sUserExtensionsDevDir, u"\\*"_ns);
724-
725718
#ifdef ENABLE_SYSTEM_EXTENSION_DIRS
726719
// Add rule to allow read access to the per-user extensions directory.
727720
AddCachedDirRule(mPolicy, sandbox::TargetPolicy::FILES_ALLOW_READONLY,

toolkit/xre/nsXREDirProvider.cpp

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -485,8 +485,6 @@ nsXREDirProvider::GetFile(const char* aProperty, bool* aPersistent,
485485
#else
486486
return NS_ERROR_FAILURE;
487487
#endif
488-
} else if (!strcmp(aProperty, XRE_USER_SYS_EXTENSION_DEV_DIR)) {
489-
return GetSysUserExtensionsDevDirectory(aFile);
490488
} else if (!strcmp(aProperty, XRE_USER_RUNTIME_DIR)) {
491489
#if defined(XP_UNIX)
492490
nsPrintfCString path("/run/user/%d/%s/", getuid(), GetAppName());
@@ -1500,29 +1498,6 @@ nsresult nsXREDirProvider::GetSysUserExtensionsDirectory(nsIFile** aFile) {
15001498
return NS_OK;
15011499
}
15021500

1503-
nsresult nsXREDirProvider::GetSysUserExtensionsDevDirectory(nsIFile** aFile) {
1504-
nsCOMPtr<nsIFile> localDir;
1505-
nsresult rv = GetUserDataDirectoryHome(getter_AddRefs(localDir), false);
1506-
NS_ENSURE_SUCCESS(rv, rv);
1507-
1508-
rv = AppendSysUserExtensionsDevPath(localDir);
1509-
NS_ENSURE_SUCCESS(rv, rv);
1510-
1511-
rv = EnsureDirectoryExists(localDir);
1512-
NS_ENSURE_SUCCESS(rv, rv);
1513-
1514-
#if defined(XP_WIN) && defined(MOZ_SANDBOX)
1515-
// This is used in sandbox rules, so we need to make sure it doesn't contain
1516-
// any junction points or symlinks or the sandbox will reject those rules.
1517-
if (!mozilla::widget::WinUtils::ResolveJunctionPointsAndSymLinks(localDir)) {
1518-
NS_WARNING("Failed to resolve sys user extensions dev directory.");
1519-
}
1520-
#endif
1521-
1522-
localDir.forget(aFile);
1523-
return NS_OK;
1524-
}
1525-
15261501
#if defined(XP_UNIX) || defined(XP_MACOSX)
15271502
nsresult nsXREDirProvider::GetSystemExtensionsDirectory(nsIFile** aFile) {
15281503
nsresult rv;
@@ -1612,37 +1587,6 @@ nsresult nsXREDirProvider::AppendSysUserExtensionPath(nsIFile* aFile) {
16121587
return NS_OK;
16131588
}
16141589

1615-
nsresult nsXREDirProvider::AppendSysUserExtensionsDevPath(nsIFile* aFile) {
1616-
MOZ_ASSERT(aFile);
1617-
1618-
nsresult rv;
1619-
1620-
#if defined(XP_MACOSX) || defined(XP_WIN)
1621-
1622-
static const char* const sXR = "Mozilla";
1623-
rv = aFile->AppendNative(nsDependentCString(sXR));
1624-
NS_ENSURE_SUCCESS(rv, rv);
1625-
1626-
static const char* const sExtensions = "SystemExtensionsDev";
1627-
rv = aFile->AppendNative(nsDependentCString(sExtensions));
1628-
NS_ENSURE_SUCCESS(rv, rv);
1629-
1630-
#elif defined(XP_UNIX)
1631-
1632-
static const char* const sXR = ".mozilla";
1633-
rv = aFile->AppendNative(nsDependentCString(sXR));
1634-
NS_ENSURE_SUCCESS(rv, rv);
1635-
1636-
static const char* const sExtensions = "systemextensionsdev";
1637-
rv = aFile->AppendNative(nsDependentCString(sExtensions));
1638-
NS_ENSURE_SUCCESS(rv, rv);
1639-
1640-
#else
1641-
# error "Don't know how to get XRE system extension dev path on your platform"
1642-
#endif
1643-
return NS_OK;
1644-
}
1645-
16461590
nsresult nsXREDirProvider::AppendProfilePath(nsIFile* aFile, bool aLocal) {
16471591
NS_ASSERTION(aFile, "Null pointer!");
16481592

toolkit/xre/nsXREDirProvider.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ class nsXREDirProvider final : public nsIDirectoryServiceProvider2,
114114
nsISimpleEnumerator** aResult);
115115
static nsresult GetUserDataDirectoryHome(nsIFile** aFile, bool aLocal);
116116
static nsresult GetSysUserExtensionsDirectory(nsIFile** aFile);
117-
static nsresult GetSysUserExtensionsDevDirectory(nsIFile** aFile);
118117
#if defined(XP_UNIX) || defined(XP_MACOSX)
119118
static nsresult GetSystemExtensionsDirectory(nsIFile** aFile);
120119
#endif
@@ -125,7 +124,6 @@ class nsXREDirProvider final : public nsIDirectoryServiceProvider2,
125124
static nsresult AppendProfilePath(nsIFile* aFile, bool aLocal);
126125

127126
static nsresult AppendSysUserExtensionPath(nsIFile* aFile);
128-
static nsresult AppendSysUserExtensionsDevPath(nsIFile* aFile);
129127

130128
// Internal helper that splits a path into components using the '/' and '\\'
131129
// delimiters.

xpcom/build/nsXULAppAPI.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,6 @@ struct Module;
124124
*/
125125
#define XRE_USER_SYS_EXTENSION_DIR "XREUSysExt"
126126

127-
/**
128-
* A directory service key which specifies a directory where temporary
129-
* system extensions can be loaded from during development.
130-
*/
131-
#define XRE_USER_SYS_EXTENSION_DEV_DIR "XRESysExtDev"
132-
133127
/**
134128
* A directory service key which specifies the distribution specific files for
135129
* the application.

0 commit comments

Comments
 (0)