mirror of
https://github.com/swaywm/sway.git
synced 2026-04-29 06:46:22 -04:00
Destroy security config on shutdown
This commit is contained in:
parent
50d84b8512
commit
6b200ca7e3
3 changed files with 15 additions and 0 deletions
|
|
@ -6,6 +6,7 @@
|
||||||
#include "sway/config.h"
|
#include "sway/config.h"
|
||||||
|
|
||||||
bool load_security(struct wl_display *display);
|
bool load_security(struct wl_display *display);
|
||||||
|
void finish_security(void);
|
||||||
bool check_security_rule(const char *cmd, const char *global);
|
bool check_security_rule(const char *cmd, const char *global);
|
||||||
|
|
||||||
struct command_policy *alloc_command_policy(const char *command);
|
struct command_policy *alloc_command_policy(const char *command);
|
||||||
|
|
|
||||||
|
|
@ -422,6 +422,8 @@ int main(int argc, char **argv) {
|
||||||
root_destroy(root);
|
root_destroy(root);
|
||||||
root = NULL;
|
root = NULL;
|
||||||
|
|
||||||
|
finish_security();
|
||||||
|
|
||||||
if (config) {
|
if (config) {
|
||||||
free_config(config);
|
free_config(config);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -123,6 +123,18 @@ bool load_security(struct wl_display *display) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void finish_security(void) {
|
||||||
|
struct sway_security_rule *rule, *tmp;
|
||||||
|
wl_list_for_each_safe(rule, tmp, &rules, link) {
|
||||||
|
free(rule->command);
|
||||||
|
free(rule->global);
|
||||||
|
wl_list_remove(&rule->link);
|
||||||
|
free(rule);
|
||||||
|
}
|
||||||
|
|
||||||
|
wl_list_remove(&rules);
|
||||||
|
}
|
||||||
|
|
||||||
bool check_security_rule(const char *cmd, const char *global) {
|
bool check_security_rule(const char *cmd, const char *global) {
|
||||||
struct sway_security_rule *rule;
|
struct sway_security_rule *rule;
|
||||||
wl_list_for_each(rule, &rules, link) {
|
wl_list_for_each(rule, &rules, link) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue