From 1d3681f5213535c1f47ed8bd0cddb7df775dd75e Mon Sep 17 00:00:00 2001 From: Érico Rolim Date: Thu, 21 May 2020 00:46:28 -0300 Subject: Remove code related to the security features - Remove struct definitions - Remove struct members - Remove initializations and frees --- include/sway/config.h | 60 ------------------------------------------------- include/sway/security.h | 18 --------------- 2 files changed, 78 deletions(-) delete mode 100644 include/sway/security.h (limited to 'include/sway') diff --git a/include/sway/config.h b/include/sway/config.h index 85605ce4..b3fd6668 100644 --- a/include/sway/config.h +++ b/include/sway/config.h @@ -401,61 +401,6 @@ enum command_context { CONTEXT_ALL = 0xFFFFFFFF, }; -struct command_policy { - char *command; - uint32_t context; -}; - -enum secure_feature { - FEATURE_LOCK = 1 << 0, - FEATURE_PANEL = 1 << 1, - FEATURE_BACKGROUND = 1 << 2, - FEATURE_SCREENSHOT = 1 << 3, - FEATURE_FULLSCREEN = 1 << 4, - FEATURE_KEYBOARD = 1 << 5, - FEATURE_MOUSE = 1 << 6, -}; - -struct feature_policy { - char *program; - uint32_t features; -}; - -enum ipc_feature { - IPC_FEATURE_COMMAND = 1 << 0, - IPC_FEATURE_GET_WORKSPACES = 1 << 1, - IPC_FEATURE_GET_OUTPUTS = 1 << 2, - IPC_FEATURE_GET_TREE = 1 << 3, - IPC_FEATURE_GET_MARKS = 1 << 4, - IPC_FEATURE_GET_BAR_CONFIG = 1 << 5, - IPC_FEATURE_GET_VERSION = 1 << 6, - IPC_FEATURE_GET_INPUTS = 1 << 7, - IPC_FEATURE_EVENT_WORKSPACE = 1 << 8, - IPC_FEATURE_EVENT_OUTPUT = 1 << 9, - IPC_FEATURE_EVENT_MODE = 1 << 10, - IPC_FEATURE_EVENT_WINDOW = 1 << 11, - IPC_FEATURE_EVENT_BINDING = 1 << 12, - IPC_FEATURE_EVENT_INPUT = 1 << 13, - IPC_FEATURE_GET_SEATS = 1 << 14, - - IPC_FEATURE_ALL_COMMANDS = IPC_FEATURE_COMMAND | - IPC_FEATURE_GET_WORKSPACES | IPC_FEATURE_GET_OUTPUTS | - IPC_FEATURE_GET_TREE | IPC_FEATURE_GET_MARKS | - IPC_FEATURE_GET_BAR_CONFIG | IPC_FEATURE_GET_VERSION | - IPC_FEATURE_GET_INPUTS | IPC_FEATURE_GET_SEATS, - IPC_FEATURE_ALL_EVENTS = IPC_FEATURE_EVENT_WORKSPACE | - IPC_FEATURE_EVENT_OUTPUT | IPC_FEATURE_EVENT_MODE | - IPC_FEATURE_EVENT_WINDOW | IPC_FEATURE_EVENT_BINDING | - IPC_FEATURE_EVENT_INPUT, - - IPC_FEATURE_ALL = IPC_FEATURE_ALL_COMMANDS | IPC_FEATURE_ALL_EVENTS, -}; - -struct ipc_policy { - char *program; - uint32_t features; -}; - enum focus_follows_mouse_mode { FOLLOWS_NO, FOLLOWS_YES, @@ -584,11 +529,6 @@ struct sway_config { int32_t floating_minimum_width; int32_t floating_minimum_height; - // Security - list_t *command_policies; - list_t *feature_policies; - list_t *ipc_policies; - // The keysym to keycode translation struct xkb_state *keysym_translation_state; diff --git a/include/sway/security.h b/include/sway/security.h deleted file mode 100644 index 0edffdfa..00000000 --- a/include/sway/security.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef _SWAY_SECURITY_H -#define _SWAY_SECURITY_H -#include -#include "sway/config.h" - -uint32_t get_feature_policy_mask(pid_t pid); -uint32_t get_ipc_policy_mask(pid_t pid); -uint32_t get_command_policy_mask(const char *cmd); - -struct feature_policy *get_feature_policy(const char *name); - -const char *command_policy_str(enum command_context context); - -struct feature_policy *alloc_feature_policy(const char *program); -struct ipc_policy *alloc_ipc_policy(const char *program); -struct command_policy *alloc_command_policy(const char *command); - -#endif -- cgit v1.2.3-54-g00ecf