Details
Description
Passing QDBusUnixFileDescriptor over peer-to-peer connections does not work. This is for two reasons:
QDBusConnectionPrivate::setPeer does not set this->capabilities, unlike QDBusConnectionPrivate::setConnection which is executed for bus connections, which contains the line:
capabilities = connectionCapabilies(connection);
When this line is added to QDBusConnectionPrivate::setPeer, the second issue is that QDBusConnectionPrivate::setPeer is called before the authentication is finished, and therefore dbus_connection_can_send_type will always return 0. The solution is probably to wait in QDBusConnectionManager::executeConnectionRequest and qDBusNewConnection until the authentication is done (this is already done for bus connections implicitly by calling dbus_bus_register.
I've attached a patch which should fix this issue.