summaryrefslogtreecommitdiff
path: root/src/machine/machined-dbus.c
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@googlemail.com>2015-11-16 11:59:21 +0100
committerDavid Herrmann <dh.herrmann@googlemail.com>2015-11-16 11:59:21 +0100
commitd6ab08f6228cf8b28ef15ec8abbd1bb1154db21c (patch)
tree49ccfe9fed0484b35ef80687fbef20209cc8e128 /src/machine/machined-dbus.c
parentfb917b2103493d3e755c7c27e7bb28bcace4ce23 (diff)
parent06820eafdbc3dd89cb1f7563564c7d91426709ca (diff)
Merge pull request #1906 from poettering/pid-check
machined,logind: be more careful when accepting PIDs and UIDs from clients
Diffstat (limited to 'src/machine/machined-dbus.c')
-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;