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

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