summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-login/sd-login.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-08-23 14:33:50 +0200
committerLennart Poettering <lennart@poettering.net>2015-08-24 22:46:45 +0200
commitb9a8d250810d4803bc9bf6b36932b528cb991d1e (patch)
tree6843e538235d3c6c79a951984ff8d3f4bb5e1930 /src/libsystemd/sd-login/sd-login.c
parent25300b5a1fcf54674a69d0f4ab08925be00b0227 (diff)
machined: validate machine names at more places
When enumerating machines from /run, and when accepting machine names for operations, be more strict and always validate. Note that these checks are strictly speaking unnecessary, since enumeration happens only on the trusted /run...
Diffstat (limited to 'src/libsystemd/sd-login/sd-login.c')
-rw-r--r--src/libsystemd/sd-login/sd-login.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsystemd/sd-login/sd-login.c b/src/libsystemd/sd-login/sd-login.c
index 5f290573cb..0eadc8c747 100644
--- a/src/libsystemd/sd-login/sd-login.c
+++ b/src/libsystemd/sd-login/sd-login.c
@@ -791,7 +791,7 @@ _public_ int sd_get_machine_names(char ***machines) {
/* Filter out the unit: symlinks */
for (a = l, b = l; *a; a++) {
- if (startswith(*a, "unit:"))
+ if (startswith(*a, "unit:") || !machine_name_is_valid(*a))
free(*a);
else {
*b = *a;