aboutsummaryrefslogtreecommitdiffstats
path: root/sway/security.c
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2016-12-01 21:36:43 -0500
committerLibravatar Drew DeVault <sir@cmpwn.com>2016-12-01 21:36:43 -0500
commit76cab04b4d7828f3c4f607c49e1e6ad78aa6e3da (patch)
tree53a871af54a91c689c5db597ab21b3c97c4506cd /sway/security.c
parentMemory leak (diff)
downloadsway-76cab04b4d7828f3c4f607c49e1e6ad78aa6e3da.tar.gz
sway-76cab04b4d7828f3c4f607c49e1e6ad78aa6e3da.tar.zst
sway-76cab04b4d7828f3c4f607c49e1e6ad78aa6e3da.zip
Implement permit and reject commands
Diffstat (limited to 'sway/security.c')
-rw-r--r--sway/security.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sway/security.c b/sway/security.c
index 00e5e8d7..776bd527 100644
--- a/sway/security.c
+++ b/sway/security.c
@@ -4,6 +4,13 @@
4#include "sway/security.h" 4#include "sway/security.h"
5#include "log.h" 5#include "log.h"
6 6
7struct feature_policy *alloc_feature_policy(const char *program) {
8 struct feature_policy *policy = malloc(sizeof(struct feature_policy));
9 policy->program = strdup(program);
10 policy->features = FEATURE_FULLSCREEN | FEATURE_KEYBOARD | FEATURE_MOUSE;
11 return policy;
12}
13
7enum secure_feature get_feature_policy(pid_t pid) { 14enum secure_feature get_feature_policy(pid_t pid) {
8 const char *fmt = "/proc/%d/exe"; 15 const char *fmt = "/proc/%d/exe";
9 int pathlen = snprintf(NULL, 0, fmt, pid); 16 int pathlen = snprintf(NULL, 0, fmt, pid);