summaryrefslogtreecommitdiff
path: root/src/udev
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-02-18 19:20:47 +0100
committerLennart Poettering <lennart@poettering.net>2015-02-18 19:42:24 +0100
commit1c8da044469acabcfc479ba3276954da53210830 (patch)
treea9252d87c59570ebec4f3004526e6f52637bb917 /src/udev
parent6e646d22f6f9215de5ccb5e5edf450558c59fed1 (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.
Diffstat (limited to 'src/udev')
-rw-r--r--src/udev/udev-ctrl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/udev/udev-ctrl.c b/src/udev/udev-ctrl.c
index 7b5ef6b2a8..59a3eceaad 100644
--- a/src/udev/udev-ctrl.c
+++ b/src/udev/udev-ctrl.c
@@ -377,6 +377,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);