src/basic/login-util.c
raw| 1 | /* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 2 | |
| 3 | #include <unistd.h> |
| 4 | |
| 5 | #include "login-util.h" |
| 6 | #include "string-util.h" |
| 7 | |
| 8 | bool session_id_valid(const char *id) { |
| 9 | |
| 10 | if (isempty(id)) |
| 11 | return false; |
| 12 | |
| 13 | return in_charset(id, ALPHANUMERICAL); |
| 14 | } |
| 15 | |
| 16 | bool logind_running(void) { |
| 17 | return access("/run/systemd/seats/", F_OK) >= 0; |
| 18 | } |