aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands.c
diff options
context:
space:
mode:
authorLibravatar Érico Rolim <erico.erc@gmail.com>2020-05-21 00:46:28 -0300
committerLibravatar Simon Ser <contact@emersion.fr>2020-05-21 10:57:00 +0200
commit1d3681f5213535c1f47ed8bd0cddb7df775dd75e (patch)
treeb9fce1efbd9b479832b0f1d3210602ec77e876b5 /sway/commands.c
parentFix typos in comments (diff)
downloadsway-1d3681f5213535c1f47ed8bd0cddb7df775dd75e.tar.gz
sway-1d3681f5213535c1f47ed8bd0cddb7df775dd75e.tar.zst
sway-1d3681f5213535c1f47ed8bd0cddb7df775dd75e.zip
Remove code related to the security features
- Remove struct definitions - Remove struct members - Remove initializations and frees
Diffstat (limited to 'sway/commands.c')
-rw-r--r--sway/commands.c23
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
516cleanup: 493cleanup: