summaryrefslogtreecommitdiff
path: root/src/login/logind.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/login/logind.c')
-rw-r--r--src/login/logind.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/login/logind.c b/src/login/logind.c
index 9094567b8d..4ef92b8253 100644
--- a/src/login/logind.c
+++ b/src/login/logind.c
@@ -684,6 +684,12 @@ int manager_enumerate_sessions(Manager *m) {
if (!dirent_is_file(de))
continue;
+ if (!session_id_valid(de->d_name)) {
+ log_warning("Invalid session file name '%s', ignoring.", de->d_name);
+ r = -EINVAL;
+ continue;
+ }
+
k = manager_add_session(m, de->d_name, &s);
if (k < 0) {
log_error("Failed to add session by file name %s: %s", de->d_name, strerror(-k));