summaryrefslogtreecommitdiff
path: root/src/core/main.c
diff options
context:
space:
mode:
authorMike Gabriel <[email protected]>2022-03-28 08:07:49 +0200
committerVictor Kareh <[email protected]>2022-04-07 08:19:50 -0400
commitb4a6c7c87674a36daba7bc158f884037fa5c3f7d (patch)
tree89ec04daf2119d815382741c246fe5f13bfc8486 /src/core/main.c
parent0e517d0fe102296e4b44253c1673cb767b5f444c (diff)
downloadmarco-b4a6c7c87674a36daba7bc158f884037fa5c3f7d.tar.bz2
marco-b4a6c7c87674a36daba7bc158f884037fa5c3f7d.tar.xz
marco: Add cmdline option --no-keybindings for disabling all key bindings directly on WM startup.
The marco WM is used in Arctica Greeter [1]. There recently has a security issue been detected where people could open applications via marco keybindings inside the greeter (display manager) session. . A work-around could be evoking marco-message after marco startup and disable all keybindings then. However, a more preferred fix is provided by this patch: start-up marco with keybindings disabled from the beginning.
Diffstat (limited to 'src/core/main.c')
-rw-r--r--src/core/main.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core/main.c b/src/core/main.c
index 8b90f689..651bdc64 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -51,6 +51,7 @@
#include "util.h"
#include "display-private.h"
#include "errors.h"
+#include "keybindings.h"
#include "ui.h"
#include "session.h"
#include "prefs.h"
@@ -211,6 +212,7 @@ typedef struct
gboolean composite;
gboolean no_composite;
gboolean no_force_fullscreen;
+ gboolean no_keybindings;
} MetaArguments;
#ifdef HAVE_COMPOSITE_EXTENSIONS
@@ -298,6 +300,12 @@ meta_parse_options (int *argc, char ***argv,
N_("Don't make fullscreen windows that are maximized and have no decorations"),
NULL
},
+ {
+ "no-keybindings", 0, 0, G_OPTION_ARG_NONE,
+ &my_args.no_keybindings,
+ N_("Have all keybindings disabled on startup"),
+ NULL
+ },
{NULL}
};
GOptionContext *ctx;
@@ -550,6 +558,9 @@ main (int argc, char **argv)
if (meta_args.no_force_fullscreen)
meta_prefs_set_force_fullscreen (FALSE);
+ if (meta_args.no_keybindings)
+ meta_set_keybindings_disabled (TRUE);
+
if (!meta_display_open ())
meta_exit (META_EXIT_ERROR);