From 6e0a404cbcb802bc059939422a3d27d70941d351 Mon Sep 17 00:00:00 2001 From: Felipe Borges Date: Thu, 24 Jun 2021 15:19:57 +0200 Subject: [PATCH] runDialog: Don't run commands for apps filtered by parental controls Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4415 --- js/ui/runDialog.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/ui/runDialog.js b/js/ui/runDialog.js index bc9689d4d..8e7e1a921 100644 --- a/js/ui/runDialog.js +++ b/js/ui/runDialog.js @@ -6,6 +6,7 @@ const { Clutter, Gio, GLib, GObject, Meta, Shell, St } = imports.gi; const Dialog = imports.ui.dialog; const Main = imports.ui.main; const ModalDialog = imports.ui.modalDialog; +const ParentalControlsManager = imports.misc.parentalControlsManager; const ShellEntry = imports.ui.shellEntry; const Util = imports.misc.util; const History = imports.misc.history; @@ -196,7 +197,10 @@ class RunDialog extends ModalDialog.ModalDialog { let execArg = this._terminalSettings.get_string(EXEC_ARG_KEY); command = '%s %s %s'.format(exec, execArg, input); } - Util.trySpawnCommandLine(command); + + let app_info = Gio.AppInfo.create_from_commandline(command, null, Gio.AppInfoCreateFlags.SUPPORTS_STARTUP_NOTIFICATION); + if (ParentalControlsManager.getDefault().shouldShowApp(app_info)) + Util.trySpawnCommandLine(command); } catch (e) { // Mmmh, that failed - see if @input matches an existing file let path = null;