connection: block only normal fds allwo sending memfds
authorDjalal Harouni <tixxdz@opendz.org>
Tue, 28 Oct 2014 12:07:50 +0000 (13:07 +0100)
committerDjalal Harouni <tixxdz@opendz.org>
Tue, 28 Oct 2014 12:07:50 +0000 (13:07 +0100)
Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
connection.c
test/test-fd.c

index da6be4e8d48c76035c18935c1e2d1c0a0d0aee94..5b1f3ed516117e88c2ddbeb4336ad5466e8b024e 100644 (file)
@@ -492,8 +492,7 @@ static int kdbus_conn_entry_insert(struct kdbus_conn *conn,
        }
 
        /* The connection does not accept file descriptors */
-       if (!(conn->flags & KDBUS_HELLO_ACCEPT_FD) &&
-           (kmsg->fds_count > 0 || kmsg->memfds_count > 0)) {
+       if (!(conn->flags & KDBUS_HELLO_ACCEPT_FD) && kmsg->fds_count > 0) {
                ret = -ECOMM;
                goto exit_unlock;
        }
index 98d0f2c637378d8864b59b85f779b499cce71a36..7e59ff88cec7d112d1c4f15a41c8808e27138b88 100644 (file)
@@ -387,7 +387,7 @@ int kdbus_test_fd_passing(struct kdbus_test_env *env)
        ASSERT_RETURN(ret == -ECOMM);
 
        ret = send_memfds(conn_src, conn_dummy->id, (int *)&memfd, 1);
-       ASSERT_RETURN(ret == -ECOMM);
+       ASSERT_RETURN(ret == 0);
 
        /* Try to broadcast file descriptors. This must fail. */
        ret = send_fds(conn_src, KDBUS_DST_ID_BROADCAST, fds, 1);