From 1c8da044469acabcfc479ba3276954da53210830 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 18 Feb 2015 19:20:47 +0100 Subject: 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. --- src/shared/ask-password-api.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/shared/ask-password-api.c') diff --git a/src/shared/ask-password-api.c b/src/shared/ask-password-api.c index 0a61dafc59..44ebc58491 100644 --- a/src/shared/ask-password-api.c +++ b/src/shared/ask-password-api.c @@ -475,6 +475,8 @@ int ask_password_agent( goto finish; } + cmsg_close_all(&msghdr); + if (n <= 0) { log_error("Message too short"); continue; -- cgit v1.2.3-54-g00ecf