diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-03-01 14:11:30 -0500 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2015-03-01 14:11:30 -0500 |
commit | d80d6e858f7e308f0144c5d01e3eca21b09292d9 (patch) | |
tree | 904930d7113eae1cbe541fd17fbe00f6e242b18c /src/udev | |
parent | 1d1660eb1c3721fc6e1061a8d17d89c76e56fcdc (diff) |
shared: introduce cmsg_close_all() call
The call iterates through cmsg list and closes all fds passed via
SCM_RIGHTS.
This patch also ensures the call is used wherever appropriate, where we
might get spurious fds sent and we should better close them, then leave
them lying around.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/udev')
-rw-r--r-- | src/udev/udev-ctrl.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/udev/udev-ctrl.c b/src/udev/udev-ctrl.c index 2d8149e820..a4cc306491 100644 --- a/src/udev/udev-ctrl.c +++ b/src/udev/udev-ctrl.c @@ -399,6 +399,9 @@ struct udev_ctrl_msg *udev_ctrl_receive_msg(struct udev_ctrl_connection *conn) { log_error_errno(errno, "unable to receive ctrl message: %m"); goto err; } + + cmsg_close_all(&smsg); + cmsg = CMSG_FIRSTHDR(&smsg); cred = (struct ucred *) CMSG_DATA(cmsg); |