From 5d7d9fada2cecbb0a5911c05bab2fbaadc25272c Mon Sep 17 00:00:00 2001 From: Djalal Harouni Date: Tue, 28 Oct 2014 10:44:21 +0100 Subject: [PATCH] connection: improve the connection do not accept fd passing check Signed-off-by: Djalal Harouni --- connection.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/connection.c b/connection.c index 898db9c..cca14a4 100644 --- a/connection.c +++ b/connection.c @@ -470,8 +470,9 @@ static int kdbus_conn_entry_insert(struct kdbus_conn *conn, goto exit_unlock; } - if ((kmsg->fds && !(conn->flags & KDBUS_HELLO_ACCEPT_FD)) || - (kmsg->memfds_count && !(conn->flags & KDBUS_HELLO_ACCEPT_FD))) { + /* The connection does not accept file descriptors */ + if (!(conn->flags & KDBUS_HELLO_ACCEPT_FD) && + (kmsg->fds_count > 0 || kmsg->memfds_count > 0)) { ret = -ECOMM; goto exit_unlock; } -- 2.34.1