diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-03-14 01:38:19 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-03-14 01:49:44 +0100 |
commit | 66cdd0f2d0670b054bd27dad16fcb5838b11dde3 (patch) | |
tree | aacbe786c7403a6f4f0782b4d6403d0f961b1d9c /src/login | |
parent | bcdbbd7ee1b7dc6ec19261c957ed11e5e1ed1aaf (diff) |
logind: automatically remove SysV + POSIX IPC objects when the users owning them fully log out
Diffstat (limited to 'src/login')
-rw-r--r-- | src/login/logind-gperf.gperf | 1 | ||||
-rw-r--r-- | src/login/logind-user.c | 8 | ||||
-rw-r--r-- | src/login/logind.c | 1 | ||||
-rw-r--r-- | src/login/logind.conf | 1 | ||||
-rw-r--r-- | src/login/logind.h | 2 |
5 files changed, 13 insertions, 0 deletions
diff --git a/src/login/logind-gperf.gperf b/src/login/logind-gperf.gperf index d870f88cd8..006f7286c5 100644 --- a/src/login/logind-gperf.gperf +++ b/src/login/logind-gperf.gperf @@ -31,3 +31,4 @@ Login.LidSwitchIgnoreInhibited, config_parse_bool, 0, offsetof(Manag Login.IdleAction, config_parse_handle_action, 0, offsetof(Manager, idle_action) Login.IdleActionSec, config_parse_sec, 0, offsetof(Manager, idle_action_usec) Login.RuntimeDirectorySize, config_parse_tmpfs_size, 0, offsetof(Manager, runtime_dir_size) +Login.RemoveIPC, config_parse_bool, 0, offsetof(Manager, remove_ipc) diff --git a/src/login/logind-user.c b/src/login/logind-user.c index 9bbe879571..961cbcb27b 100644 --- a/src/login/logind-user.c +++ b/src/login/logind-user.c @@ -35,6 +35,7 @@ #include "bus-util.h" #include "bus-error.h" #include "conf-parser.h" +#include "clean-ipc.h" #include "logind-user.h" User* user_new(Manager *m, uid_t uid, gid_t gid, const char *name) { @@ -572,6 +573,13 @@ int user_finalize(User *u) { if (k < 0) r = k; + /* Clean SysV + POSIX IPC objects */ + if (u->manager->remove_ipc) { + k = clean_ipc(u->uid); + if (k < 0) + r = k; + } + unlink(u->state_file); user_add_to_gc_queue(u); diff --git a/src/login/logind.c b/src/login/logind.c index 2d734ff26f..8ba8a9155b 100644 --- a/src/login/logind.c +++ b/src/login/logind.c @@ -49,6 +49,7 @@ Manager *manager_new(void) { m->n_autovts = 6; m->reserve_vt = 6; + m->remove_ipc = true; m->inhibit_delay_max = 5 * USEC_PER_SEC; m->handle_power_key = HANDLE_POWEROFF; m->handle_suspend_key = HANDLE_SUSPEND; diff --git a/src/login/logind.conf b/src/login/logind.conf index ddc23b8aca..79f96ec05b 100644 --- a/src/login/logind.conf +++ b/src/login/logind.conf @@ -25,3 +25,4 @@ #IdleAction=ignore #IdleActionSec=30min #RuntimeDirectorySize=10% +#RemoveIPC=yes diff --git a/src/login/logind.h b/src/login/logind.h index 533554d4bb..31353eff02 100644 --- a/src/login/logind.h +++ b/src/login/logind.h @@ -120,6 +120,8 @@ struct Manager { bool hibernate_key_ignore_inhibited; bool lid_switch_ignore_inhibited; + bool remove_ipc; + Hashmap *polkit_registry; sd_event_source *lid_switch_ignore_event_source; |