Blame SOURCES/0001-extensionDownloader-Refuse-to-override-system-extens.patch

1bd53d
From c18b7b7819f17f5d14be1ba2760653f3d93b81b1 Mon Sep 17 00:00:00 2001
1bd53d
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
1bd53d
Date: Mon, 1 Feb 2021 18:26:00 +0100
1bd53d
Subject: [PATCH] extensionDownloader: Refuse to override system extensions
1bd53d
1bd53d
The website allows to "update" system extensions by installing the
1bd53d
upstream version into the user's home directory.
1bd53d
1bd53d
Prevent that by refusing to download and install extensions that are
1bd53d
already installed system-wide.
1bd53d
---
1bd53d
 js/ui/extensionDownloader.js | 8 ++++++++
1bd53d
 1 file changed, 8 insertions(+)
1bd53d
1bd53d
diff --git a/js/ui/extensionDownloader.js b/js/ui/extensionDownloader.js
1bd53d
index 6a3b2b488..471ddab14 100644
1bd53d
--- a/js/ui/extensionDownloader.js
1bd53d
+++ b/js/ui/extensionDownloader.js
1bd53d
@@ -17,6 +17,14 @@ var REPOSITORY_URL_UPDATE   = 'https://extensions.gnome.org/update-info/';
1bd53d
 let _httpSession;
1bd53d
 
1bd53d
 function installExtension(uuid, invocation) {
1bd53d
+    const oldExt = Main.extensionManager.lookup(uuid);
1bd53d
+    if (oldExt && oldExt.type === ExtensionUtils.ExtensionType.SYSTEM) {
1bd53d
+        log('extensionDownloader: Trying to replace system extension %s'.format(uuid));
1bd53d
+        invocation.return_dbus_error('org.gnome.Shell.InstallError',
1bd53d
+            'System extensions cannot be replaced');
1bd53d
+        return;
1bd53d
+    }
1bd53d
+
1bd53d
     let params = { uuid,
1bd53d
                    shell_version: Config.PACKAGE_VERSION };
1bd53d
 
1bd53d
-- 
1bd53d
2.31.1
1bd53d