message,
NULL))
return TRUE; /* silently don't send it */
+
+ if (dbus_message_contains_unix_fds(message) &&
+ !dbus_connection_can_send_type(connection, DBUS_TYPE_UNIX_FD))
+ return TRUE; /* silently don't send it */
if (!bus_transaction_send (transaction,
connection,
addressed_recipient,
message, &error))
goto out;
+
+ if (dbus_message_contains_unix_fds(message) &&
+ !dbus_connection_can_send_type(addressed_recipient, DBUS_TYPE_UNIX_FD))
+ {
+ dbus_set_error(&error,
+ DBUS_ERROR_NOT_SUPPORTED,
+ "Tried to send message with Unix file descriptors"
+ "to a client that doesn't support that.");
+ goto out;
+ }
/* Dispatch the message */
if (!bus_transaction_send (transaction, addressed_recipient, message))
void _dbus_message_get_network_data (DBusMessage *message,
const DBusString **header,
const DBusString **body);
-void _dbus_message_get_unix_fds (DBusMessage *messgage,
+void _dbus_message_get_unix_fds (DBusMessage *message,
const int **fds,
unsigned *n_fds);
return TRUE;
}
+/**
+ * Checks whether a message contains unix fds
+ *
+ * @param message the message
+ * @returns #TRUE if the message contains unix fds
+ */
+dbus_bool_t
+dbus_message_contains_unix_fds(DBusMessage *message)
+{
+ _dbus_assert(message);
+
+ return message->n_unix_fds > 0;
+}
+
/** @} */
/**