From 1172566d4e298aa6c3555a0d606af4ff31d0db48 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Sat, 17 Dec 2016 15:19:50 -0500 Subject: Change how security config is loaded --- sway/commands/commands.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sway/commands/commands.c') diff --git a/sway/commands/commands.c b/sway/commands/commands.c index 5d248e30..8c7ed487 100644 --- a/sway/commands/commands.c +++ b/sway/commands/commands.c @@ -19,5 +19,10 @@ struct cmd_results *cmd_commands(int argc, char **argv) { return cmd_results_new(CMD_FAILURE, "commands", "Can only be used in config file."); } + if (!current_config_path || strcmp(SYSCONFDIR "/sway/security", current_config_path) != 0) { + return cmd_results_new(CMD_INVALID, "permit", + "This command is only permitted to run from " SYSCONFDIR "/sway/security"); + } + return cmd_results_new(CMD_BLOCK_COMMANDS, NULL, NULL); } -- cgit v1.2.3