aboutsummaryrefslogtreecommitdiff
path: root/include/sway
diff options
context:
space:
mode:
Diffstat (limited to 'include/sway')
-rw-r--r--include/sway/config.h17
-rw-r--r--include/sway/security.h6
2 files changed, 18 insertions, 5 deletions
diff --git a/include/sway/config.h b/include/sway/config.h
index febde63d..d77fbd51 100644
--- a/include/sway/config.h
+++ b/include/sway/config.h
@@ -203,7 +203,6 @@ enum secure_feature {
FEATURE_FULLSCREEN = 16,
FEATURE_KEYBOARD = 32,
FEATURE_MOUSE = 64,
- FEATURE_IPC = 128,
};
struct feature_policy {
@@ -225,7 +224,17 @@ enum ipc_feature {
IPC_FEATURE_EVENT_MODE = 1024,
IPC_FEATURE_EVENT_WINDOW = 2048,
IPC_FEATURE_EVENT_BINDING = 4096,
- IPC_FEATURE_EVENT_INPUT = 8192
+ IPC_FEATURE_EVENT_INPUT = 8192,
+
+ IPC_FEATURE_ALL_COMMANDS = 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128,
+ IPC_FEATURE_ALL_EVENTS = 256 | 512 | 1024 | 2048 | 4096 | 8192,
+
+ IPC_FEATURE_ALL = IPC_FEATURE_ALL_COMMANDS | IPC_FEATURE_ALL_EVENTS,
+};
+
+struct ipc_policy {
+ char *program;
+ uint32_t features;
};
/**
@@ -300,7 +309,7 @@ struct sway_config {
// Security
list_t *command_policies;
list_t *feature_policies;
- uint32_t ipc_policy;
+ list_t *ipc_policies;
};
void pid_workspace_add(struct pid_workspace *pw);
@@ -331,6 +340,8 @@ void free_config(struct sway_config *config);
*/
char *do_var_replacement(char *str);
+struct cmd_results *check_security_config();
+
int input_identifier_cmp(const void *item, const void *data);
void merge_input_config(struct input_config *dst, struct input_config *src);
void apply_input_config(struct input_config *ic, struct libinput_device *dev);
diff --git a/include/sway/security.h b/include/sway/security.h
index 1cc85bee..c3a5cfd4 100644
--- a/include/sway/security.h
+++ b/include/sway/security.h
@@ -3,12 +3,14 @@
#include <unistd.h>
#include "sway/config.h"
-enum secure_feature get_feature_policy(pid_t pid);
-enum command_context get_command_policy(const char *cmd);
+uint32_t get_feature_policy(pid_t pid);
+uint32_t get_ipc_policy(pid_t pid);
+uint32_t get_command_policy(const char *cmd);
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