aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/commands.c
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2017-02-21 05:18:42 -0500
committerLibravatar GitHub <noreply@github.com>2017-02-21 05:18:42 -0500
commitf68d2fb33c433d13def0921db561eb23d400683c (patch)
treecd8ec8565a63cd5b047e45b001debed16d6a2bdd /sway/commands/commands.c
parentMerge pull request #1075 from zandrmartin/floating-positioning (diff)
parentUpdate 00-defaults.in (diff)
downloadsway-8b37a8edfeb056a5efc29d27ebaeec45b2f7d7e8.tar.gz
sway-8b37a8edfeb056a5efc29d27ebaeec45b2f7d7e8.tar.zst
sway-8b37a8edfeb056a5efc29d27ebaeec45b2f7d7e8.zip
Merge pull request #1080 from SirCmpwn/ipc-security0.12-rc1
Revise IPC security configuration
Diffstat (limited to 'sway/commands/commands.c')
-rw-r--r--sway/commands/commands.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sway/commands/commands.c b/sway/commands/commands.c
index 8c7ed487..0c64970c 100644
--- a/sway/commands/commands.c
+++ b/sway/commands/commands.c
@@ -10,6 +10,9 @@ struct cmd_results *cmd_commands(int argc, char **argv) {
10 if ((error = checkarg(argc, "commands", EXPECTED_EQUAL_TO, 1))) { 10 if ((error = checkarg(argc, "commands", EXPECTED_EQUAL_TO, 1))) {
11 return error; 11 return error;
12 } 12 }
13 if ((error = check_security_config())) {
14 return error;
15 }
13 16
14 if (strcmp(argv[0], "{") != 0) { 17 if (strcmp(argv[0], "{") != 0) {
15 return cmd_results_new(CMD_FAILURE, "commands", "Expected block declaration"); 18 return cmd_results_new(CMD_FAILURE, "commands", "Expected block declaration");
@@ -19,10 +22,5 @@ struct cmd_results *cmd_commands(int argc, char **argv) {
19 return cmd_results_new(CMD_FAILURE, "commands", "Can only be used in config file."); 22 return cmd_results_new(CMD_FAILURE, "commands", "Can only be used in config file.");
20 } 23 }
21 24
22 if (!current_config_path || strcmp(SYSCONFDIR "/sway/security", current_config_path) != 0) {
23 return cmd_results_new(CMD_INVALID, "permit",
24 "This command is only permitted to run from " SYSCONFDIR "/sway/security");
25 }
26
27 return cmd_results_new(CMD_BLOCK_COMMANDS, NULL, NULL); 25 return cmd_results_new(CMD_BLOCK_COMMANDS, NULL, NULL);
28} 26}