summaryrefslogtreecommitdiff
path: root/src/shared/login-shared.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-04-30 00:47:41 +0200
committerLennart Poettering <lennart@poettering.net>2015-04-30 00:49:41 +0200
commit8b0849e9710d721c5d0b775aaf0fd662eefa1449 (patch)
treec185b5676d440e4ca30d0a1226fdbf49683a009a /src/shared/login-shared.c
parent5cc0748e19490c4275aa66796679e3e67b649795 (diff)
core: rework cgroup path parse logic
Various cleanups, be stricter when parsing unit paths. Most importantly: return the root slice "-.slice" when asked for slice of paths that contain no slice component.
Diffstat (limited to 'src/shared/login-shared.c')
-rw-r--r--src/shared/login-shared.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/shared/login-shared.c b/src/shared/login-shared.c
index 054c77503b..64650a9134 100644
--- a/src/shared/login-shared.c
+++ b/src/shared/login-shared.c
@@ -23,7 +23,9 @@
#include "def.h"
bool session_id_valid(const char *id) {
- assert(id);
- return id[0] && id[strspn(id, LETTERS DIGITS)] == '\0';
+ if (isempty(id))
+ return false;
+
+ return id[strspn(id, LETTERS DIGITS)] == '\0';
}