[gnome-shell/run-dialog-parental-control] runDialog: Don't run commands for apps filtered by parental controls




commit 6e0a404cbcb802bc059939422a3d27d70941d351
Author: Felipe Borges <felipeborges gnome org>
Date:   Thu Jun 24 15:19:57 2021 +0200

    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 bc9689d4d1..8e7e1a921e 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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]