summaryrefslogtreecommitdiff
path: root/src/machine
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-11-15 22:00:47 +0100
committerLennart Poettering <lennart@poettering.net>2015-11-15 22:00:47 +0100
commit06820eafdbc3dd89cb1f7563564c7d91426709ca (patch)
tree35ee848283d31ccdfb7b99deb2a93cf4488f9258 /src/machine
parent7ad8eb8d84a53a1dc55411ae1087bd9a2f3b58bf (diff)
machined,logind: be more careful when accepting PIDs and UIDs from clients
Always validate first before we start processing the data.
Diffstat (limited to 'src/machine')
-rw-r--r--src/machine/machined-dbus.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/machine/machined-dbus.c b/src/machine/machined-dbus.c
index 7827f063c1..4ec6baaa1f 100644
--- a/src/machine/machined-dbus.c
+++ b/src/machine/machined-dbus.c
@@ -199,6 +199,9 @@ static int method_get_machine_by_pid(sd_bus_message *message, void *userdata, sd
if (r < 0)
return r;
+ if (pid < 0)
+ return -EINVAL;
+
if (pid == 0) {
_cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL;