diff options
author | Drew DeVault <[email protected]> | 2017-02-22 00:45:51 -0500 |
---|---|---|
committer | GitHub <[email protected]> | 2017-02-22 00:45:51 -0500 |
commit | 692768230385d7d63938d7a40e9253c0f028d1cb (patch) | |
tree | 5b8222416cf425c2c2dee123a13dd774fd2a368c /sway/commands/permit.c | |
parent | 46bd2bb5df02bd155bf92af6483c5b553afa7b6e (diff) | |
parent | f68d2fb33c433d13def0921db561eb23d400683c (diff) |
Merge branch 'master' into swaylock_colors
Diffstat (limited to 'sway/commands/permit.c')
-rw-r--r-- | sway/commands/permit.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/sway/commands/permit.c b/sway/commands/permit.c index 1b2a30bf..e2bec2e2 100644 --- a/sway/commands/permit.c +++ b/sway/commands/permit.c @@ -19,7 +19,6 @@ static enum secure_feature get_features(int argc, char **argv, { "fullscreen", FEATURE_FULLSCREEN }, { "keyboard", FEATURE_KEYBOARD }, { "mouse", FEATURE_MOUSE }, - { "ipc", FEATURE_IPC }, }; for (int i = 1; i < argc; ++i) { @@ -63,19 +62,13 @@ struct cmd_results *cmd_permit(int argc, char **argv) { if ((error = checkarg(argc, "permit", EXPECTED_MORE_THAN, 1))) { return error; } - - if (!current_config_path || strcmp(SYSCONFDIR "/sway/security", current_config_path) != 0) { - return cmd_results_new(CMD_INVALID, "permit", - "This command is only permitted to run from " SYSCONFDIR "/sway/security"); + if ((error = check_security_config())) { + return error; } struct feature_policy *policy = get_policy(argv[0]); policy->features |= get_features(argc, argv, &error); - if (error) { - return error; - } - sway_log(L_DEBUG, "Permissions granted to %s for features %d", policy->program, policy->features); @@ -87,19 +80,13 @@ struct cmd_results *cmd_reject(int argc, char **argv) { if ((error = checkarg(argc, "reject", EXPECTED_MORE_THAN, 1))) { return error; } - - if (!current_config_path || strcmp(SYSCONFDIR "/sway/security", current_config_path) != 0) { - return cmd_results_new(CMD_INVALID, "permit", - "This command is only permitted to run from " SYSCONFDIR "/sway/security"); + if ((error = check_security_config())) { + return error; } struct feature_policy *policy = get_policy(argv[0]); policy->features &= ~get_features(argc, argv, &error); - if (error) { - return error; - } - sway_log(L_DEBUG, "Permissions granted to %s for features %d", policy->program, policy->features); |