1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-10-30 23:21:08 +03:00

bus: if we recieve fds but fd passing is off, consider this an error

This commit is contained in:
Lennart Poettering 2013-03-30 15:19:22 +01:00
parent 0f4b73c8d3
commit 5384d4b3d7

View File

@ -542,6 +542,15 @@ int bus_socket_read_message(sd_bus *bus, sd_bus_message **m) {
n = (cmsg->cmsg_len - CMSG_LEN(0)) / sizeof(int);
if (!bus->can_fds) {
/* Whut? We received fds but this
* isn't actually enabled? Close them,
* and fail */
close_many((int*) CMSG_DATA(cmsg), n);
return -EIO;
}
f = realloc(bus->fds, sizeof(int) + (bus->n_fds + n));
if (!f) {
close_many((int*) CMSG_DATA(cmsg), n);