diff options
author | Érico Rolim <erico.erc@gmail.com> | 2020-05-21 00:46:28 -0300 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2020-05-21 10:57:00 +0200 |
commit | 1d3681f5213535c1f47ed8bd0cddb7df775dd75e (patch) | |
tree | b9fce1efbd9b479832b0f1d3210602ec77e876b5 /sway | |
parent | 06fc42359bf155f81b559637e468b29266104d8f (diff) |
Remove code related to the security features
- Remove struct definitions
- Remove struct members
- Remove initializations and frees
Diffstat (limited to 'sway')
-rw-r--r-- | sway/commands.c | 23 | ||||
-rw-r--r-- | sway/config.c | 8 | ||||
-rw-r--r-- | sway/ipc-server.c | 1 | ||||
-rw-r--r-- | sway/meson.build | 1 | ||||
-rw-r--r-- | sway/security.c | 18 |
5 files changed, 0 insertions, 51 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 @@ #include "sway/commands.h" #include "sway/config.h" #include "sway/criteria.h" -#include "sway/security.h" #include "sway/input/input-manager.h" #include "sway/input/seat.h" #include "sway/tree/view.h" @@ -489,28 +488,6 @@ struct cmd_results *config_commands_command(char *exec) { context |= context_names[j].context; } - struct command_policy *policy = NULL; - for (int i = 0; i < config->command_policies->length; ++i) { - struct command_policy *p = config->command_policies->items[i]; - if (strcmp(p->command, cmd) == 0) { - policy = p; - break; - } - } - if (!policy) { - policy = alloc_command_policy(cmd); - if (!sway_assert(policy, "Unable to allocate security policy")) { - results = cmd_results_new(CMD_INVALID, - "Unable to allocate memory"); - goto cleanup; - } - list_add(config->command_policies, policy); - } - policy->context = context; - - sway_log(SWAY_INFO, "Set command policy for %s to %d", - policy->command, policy->context); - results = cmd_results_new(CMD_SUCCESS, NULL); cleanup: diff --git a/sway/config.c b/sway/config.c index fe811d27..bcf8d56f 100644 --- a/sway/config.c +++ b/sway/config.c @@ -154,9 +154,6 @@ void free_config(struct sway_config *config) { list_free(config->no_focus); list_free(config->active_bar_modifiers); list_free_items_and_destroy(config->config_chain); - list_free(config->command_policies); - list_free(config->feature_policies); - list_free(config->ipc_policies); free(config->floating_scroll_up_cmd); free(config->floating_scroll_down_cmd); free(config->floating_scroll_left_cmd); @@ -327,11 +324,6 @@ static void config_defaults(struct sway_config *config) { color_to_rgba(config->border_colors.background, 0xFFFFFFFF); - // Security - if (!(config->command_policies = create_list())) goto cleanup; - if (!(config->feature_policies = create_list())) goto cleanup; - if (!(config->ipc_policies = create_list())) goto cleanup; - // The keysym to keycode translation struct xkb_rule_names rules = {0}; config->keysym_translation_state = diff --git a/sway/ipc-server.c b/sway/ipc-server.c index 5e1cca89..bd9f40bc 100644 --- a/sway/ipc-server.c +++ b/sway/ipc-server.c @@ -47,7 +47,6 @@ struct ipc_client { struct wl_event_source *writable_event_source; struct sway_server *server; int fd; - uint32_t security_policy; enum ipc_command_type subscribed_events; size_t write_buffer_len; size_t write_buffer_size; diff --git a/sway/meson.build b/sway/meson.build index d71846a4..0db45836 100644 --- a/sway/meson.build +++ b/sway/meson.build @@ -6,7 +6,6 @@ sway_sources = files( 'ipc-json.c', 'ipc-server.c', 'main.c', - 'security.c', 'server.c', 'swaynag.c', 'xdg_decoration.c', diff --git a/sway/security.c b/sway/security.c deleted file mode 100644 index 6a00229e..00000000 --- a/sway/security.c +++ /dev/null @@ -1,18 +0,0 @@ -#define _POSIX_C_SOURCE 200809L -#include <stdlib.h> -#include <string.h> -#include "sway/security.h" - -struct command_policy *alloc_command_policy(const char *command) { - struct command_policy *policy = malloc(sizeof(struct command_policy)); - if (!policy) { - return NULL; - } - policy->command = strdup(command); - if (!policy->command) { - free(policy); - return NULL; - } - policy->context = 0; - return policy; -} |