diff options
Diffstat (limited to 'sway/commands.c')
-rw-r--r-- | sway/commands.c | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/sway/commands.c b/sway/commands.c index afe05b26..f20a8baa 100644 --- a/sway/commands.c +++ b/sway/commands.c | |||
@@ -9,7 +9,6 @@ | |||
9 | #include "sway/commands.h" | 9 | #include "sway/commands.h" |
10 | #include "sway/config.h" | 10 | #include "sway/config.h" |
11 | #include "sway/criteria.h" | 11 | #include "sway/criteria.h" |
12 | #include "sway/security.h" | ||
13 | #include "sway/input/input-manager.h" | 12 | #include "sway/input/input-manager.h" |
14 | #include "sway/input/seat.h" | 13 | #include "sway/input/seat.h" |
15 | #include "sway/tree/view.h" | 14 | #include "sway/tree/view.h" |
@@ -489,28 +488,6 @@ struct cmd_results *config_commands_command(char *exec) { | |||
489 | context |= context_names[j].context; | 488 | context |= context_names[j].context; |
490 | } | 489 | } |
491 | 490 | ||
492 | struct command_policy *policy = NULL; | ||
493 | for (int i = 0; i < config->command_policies->length; ++i) { | ||
494 | struct command_policy *p = config->command_policies->items[i]; | ||
495 | if (strcmp(p->command, cmd) == 0) { | ||
496 | policy = p; | ||
497 | break; | ||
498 | } | ||
499 | } | ||
500 | if (!policy) { | ||
501 | policy = alloc_command_policy(cmd); | ||
502 | if (!sway_assert(policy, "Unable to allocate security policy")) { | ||
503 | results = cmd_results_new(CMD_INVALID, | ||
504 | "Unable to allocate memory"); | ||
505 | goto cleanup; | ||
506 | } | ||
507 | list_add(config->command_policies, policy); | ||
508 | } | ||
509 | policy->context = context; | ||
510 | |||
511 | sway_log(SWAY_INFO, "Set command policy for %s to %d", | ||
512 | policy->command, policy->context); | ||
513 | |||
514 | results = cmd_results_new(CMD_SUCCESS, NULL); | 491 | results = cmd_results_new(CMD_SUCCESS, NULL); |
515 | 492 | ||
516 | cleanup: | 493 | cleanup: |