summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDjalal Harouni <tixxdz@opendz.org>2014-10-28 10:44:21 +0100
committerDjalal Harouni <tixxdz@opendz.org>2014-10-28 10:44:21 +0100
commit5d7d9fada2cecbb0a5911c05bab2fbaadc25272c (patch)
treed6d9618cfb176c683f768c5b14089d5fe081c677
parent847a7a01adac2ef209660a52ecfab6bcf2356845 (diff)
downloadkdbus-bus-5d7d9fada2cecbb0a5911c05bab2fbaadc25272c.tar.gz
kdbus-bus-5d7d9fada2cecbb0a5911c05bab2fbaadc25272c.tar.bz2
kdbus-bus-5d7d9fada2cecbb0a5911c05bab2fbaadc25272c.zip
connection: improve the connection do not accept fd passing check
Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
-rw-r--r--connection.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/connection.c b/connection.c
index 898db9cbeba..cca14a49d4c 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;
}