openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/dbus/1.12.16-r0/dbus-1.12.16/bus/bus.c
dbus_bool_t bus_context_check_security_policy(
    BusContext* context, BusTransaction* transaction, DBusConnection* sender,
    DBusConnection* addressed_recipient, DBusConnection* proposed_recipient,
    DBusMessage* message, BusActivationEntry* activation_entry,
    DBusError* error)
{
    const char *src, *dest;
    BusClientPolicy* sender_policy;
    BusClientPolicy* recipient_policy;
    dbus_int32_t toggles;
    dbus_bool_t log;
    int type;
    dbus_bool_t requested_reply;

    type = dbus_message_get_type(message);
    src = dbus_message_get_sender(message);
    dest = dbus_message_get_destination(message);

    /* dispatch.c was supposed to ensure these invariants */
    _dbus_assert(
        dest != NULL || type == DBUS_MESSAGE_TYPE_SIGNAL ||
        (sender == NULL && !bus_connection_is_active(proposed_recipient)));
    _dbus_assert(type == DBUS_MESSAGE_TYPE_SIGNAL ||
                 addressed_recipient != NULL || activation_entry != NULL ||
                 strcmp(dest, DBUS_SERVICE_DBUS) == 0);

    switch (type)
    {
        case DBUS_MESSAGE_TYPE_METHOD_CALL:
        case DBUS_MESSAGE_TYPE_SIGNAL:
        case DBUS_MESSAGE_TYPE_METHOD_RETURN:
        case DBUS_MESSAGE_TYPE_ERROR:
            break;

        default:
            _dbus_verbose(
                "security check disallowing message of unknown type %d\n",
                type);

            dbus_set_error(
                error, DBUS_ERROR_ACCESS_DENIED,
                "Message bus will not accept messages of unknown type\n");

            return FALSE;
    }

    requested_reply = FALSE;

    if (sender != NULL)
    {
        if (bus_connection_is_active(sender))
        {
            sender_policy = bus_connection_get_policy(sender);
            _dbus_assert(sender_policy != NULL);

            /* Fill in requested_reply variable with TRUE if this is a
             * reply and the reply was pending.
             */
            if (dbus_message_get_reply_serial(message) != 0)
            {
                if (proposed_recipient != NULL /* not to the bus driver */ &&
                    addressed_recipient ==
                        proposed_recipient /* not eavesdropping */)
                {
                    DBusError error2;

                    dbus_error_init(&error2);
                    requested_reply = bus_connections_check_reply(
                        bus_connection_get_connections(sender), transaction,
                        sender, addressed_recipient, message, &error2);
                    if (dbus_error_is_set(&error2))
                    {
                        dbus_move_error(&error2, error);
                        return FALSE;
                    }
                }
            }
        }
        else
        {
            sender_policy = NULL;
        }

        /* First verify the SELinux access controls.  If allowed then
         * go on with the standard checks.
         */
        if (!bus_selinux_allows_send(
                sender, proposed_recipient,
                dbus_message_type_to_string(dbus_message_get_type(message)),
                dbus_message_get_interface(message),
                dbus_message_get_member(message),
                dbus_message_get_error_name(message),
                dest ? dest : DBUS_SERVICE_DBUS, activation_entry, error))
        {
            if (error != NULL && !dbus_error_is_set(error))
            {
                /* don't syslog this, just set the error: avc_has_perm should
                 * have already written to either the audit log or syslog */
                complain_about_message(
                    context, DBUS_ERROR_ACCESS_DENIED,
                    "An SELinux policy prevents this sender from sending this "
                    "message to this recipient",
                    0, message, sender, proposed_recipient, FALSE, FALSE,
                    error);
                _dbus_verbose(
                    "SELinux security check denying send to service\n");
            }

            return FALSE;
        }

        /* next verify AppArmor access controls.  If allowed then
         * go on with the standard checks.
         */
        if (!bus_apparmor_allows_send(
                sender, proposed_recipient, requested_reply,
                bus_context_get_type(context), dbus_message_get_type(message),
                dbus_message_get_path(message),
                dbus_message_get_interface(message),
                dbus_message_get_member(message),
                dbus_message_get_error_name(message),
                dest ? dest : DBUS_SERVICE_DBUS, src ? src : DBUS_SERVICE_DBUS,
                activation_entry, error))
            return FALSE;

        if (!bus_connection_is_active(sender))
        {
            /* Policy for inactive connections is that they can only send
             * the hello message to the bus driver
             */
            if (proposed_recipient == NULL &&
                dbus_message_is_method_call(message, DBUS_INTERFACE_DBUS,
                                            "Hello"))
            {
                _dbus_verbose("security check allowing %s message\n", "Hello");
                return TRUE;
            }
            else
            {
                _dbus_verbose("security check disallowing non-%s message\n",
                              "Hello");

                dbus_set_error(error, DBUS_ERROR_ACCESS_DENIED,
                               "Client tried to send a message other than %s "
                               "without being registered",
                               "Hello");

                return FALSE;
            }
        }
    }
    else
    {
        sender_policy = NULL;

        /* If the sender is the bus driver, we assume any reply was a
         * requested reply as bus driver won't send bogus ones
         */
        if (addressed_recipient == proposed_recipient /* not eavesdropping */ &&
            dbus_message_get_reply_serial(message) != 0)
            requested_reply = TRUE;
    }

    _dbus_assert((sender != NULL && sender_policy != NULL) ||
                 (sender == NULL && sender_policy == NULL));

    if (proposed_recipient != NULL)
    {
        /* only the bus driver can send to an inactive recipient (as it
         * owns no services, so other apps can't address it). Inactive
         * recipients can receive any message.
         */
        if (bus_connection_is_active(proposed_recipient))
        {
            recipient_policy = bus_connection_get_policy(proposed_recipient);
            _dbus_assert(recipient_policy != NULL);
        }
        else if (sender == NULL)
        {
            _dbus_verbose("security check using NULL recipient policy for "
                          "message from bus\n");
            recipient_policy = NULL;
        }
        else
        {
            _dbus_assert_not_reached(
                "a message was somehow sent to an inactive recipient from a "
                "source other than the message bus");
            recipient_policy = NULL;
        }
    }
    else
        recipient_policy = NULL;

    _dbus_assert((proposed_recipient != NULL && recipient_policy != NULL) ||
                 (proposed_recipient != NULL && sender == NULL &&
                  recipient_policy == NULL) ||
                 (proposed_recipient == NULL && recipient_policy == NULL));

    log = FALSE;
    if (sender_policy && !bus_client_policy_check_can_send(
                             sender_policy, context->registry, requested_reply,
                             proposed_recipient, message, &toggles, &log))
    {
        complain_about_message(
            context, DBUS_ERROR_ACCESS_DENIED, "Rejected send message", toggles,
            message, sender, proposed_recipient, requested_reply,
            (addressed_recipient == proposed_recipient), error);
        _dbus_verbose(
            "security policy disallowing message due to sender policy\n");
        return FALSE;
    }

    if (log)
    {
        /* We want to drop this message, and are only not doing so for backwards
         * compatibility. */
        complain_about_message(context, DBUS_ERROR_ACCESS_DENIED,
                               "Would reject message", toggles, message, sender,
                               proposed_recipient, requested_reply, TRUE, NULL);
    }

    if (recipient_policy &&
        !bus_client_policy_check_can_receive(
            recipient_policy, context->registry, requested_reply, sender,
            addressed_recipient, proposed_recipient, message, &toggles))
    {
        complain_about_message(
            context, DBUS_ERROR_ACCESS_DENIED, "Rejected receive message",
            toggles, message, sender, proposed_recipient, requested_reply,
            (addressed_recipient == proposed_recipient), error);
        _dbus_verbose(
            "security policy disallowing message due to recipient policy\n");
        return FALSE;
    }

    /* See if limits on size have been exceeded */
    if (proposed_recipient &&
        ((dbus_connection_get_outgoing_size(proposed_recipient) >
          context->limits.max_outgoing_bytes) ||
         (dbus_connection_get_outgoing_unix_fds(proposed_recipient) >
          context->limits.max_outgoing_unix_fds)))
    {
        complain_about_message(context, DBUS_ERROR_LIMITS_EXCEEDED,
                               "Rejected: destination has a full message queue",
                               0, message, sender, proposed_recipient,
                               requested_reply, TRUE, error);
        _dbus_verbose(
            "security policy disallowing message due to full message queue\n");
        return FALSE;
    }

    /* Record that we will allow a reply here in the future (don't
     * bother if the recipient is the bus or this is an eavesdropping
     * connection). Only the addressed recipient may reply.
     *
     * This isn't done for activation attempts because they have no addressed
     * or proposed recipient; when we check whether to actually deliver the
     * message, later, we'll record the reply expectation at that point.
     */
    if (type == DBUS_MESSAGE_TYPE_METHOD_CALL && sender &&
        addressed_recipient &&
        addressed_recipient == proposed_recipient && /* not eavesdropping */
        !bus_connections_expect_reply(bus_connection_get_connections(sender),
                                      transaction, sender, addressed_recipient,
                                      message, error))
    {
        _dbus_verbose("Failed to record reply expectation or problem with the "
                      "message expecting a reply\n");
        return FALSE;
    }

    _dbus_verbose("security policy allowing message\n");
    return TRUE;
}
/*
 * addressed_recipient is the recipient specified in the message.
 *
 * proposed_recipient is the recipient we're considering sending
 * to right this second, and may be an eavesdropper.
 *
 * sender is the sender of the message.
 *
 * NULL for sender definitely means the bus driver.
 *
 * NULL for proposed_recipient may mean the bus driver, or may mean
 * we are checking whether service-activation is allowed as a first
 * pass before all details of the activated service are known.
 *
 * NULL for addressed_recipient may mean the bus driver, or may mean
 * no destination was specified in the message (e.g. a signal).
 */
addressed_recipient is the recipient specified in the message.
proposed_recipient is the recipient we're considering sending
to right this second, and may be an eavesdropper.

sender is the sender of the message.

NULL for sender definitely means the bus driver.

NULL for proposed_recipient may mean the bus driver, or may mean
we are checking whether service-activation is allowed as a first
pass before all details of the activated service are known.

NULL for addressed_recipient may mean the bus driver, or may mean
no destination was specified in the message .
addressed_recipient is the recipient specified in the message . proposed_recipient is the recipient we ' re considering sending to right this second and may be an eavesdropper . sender is the sender of the message . NULL for sender definitely means the bus driver . NULL for proposed_recipient may mean the bus driver or may mean we are checking whether service - activation is allowed as a first pass before all details of the activated service are known . NULL for addressed_recipient may mean the bus driver or may mean no destination was specified in the message .
dbus_bool_t bus_context_check_security_policy(
    BusContext* context, BusTransaction* transaction, DBusConnection* sender,
    DBusConnection* addressed_recipient, DBusConnection* proposed_recipient,
    DBusMessage* message, BusActivationEntry* activation_entry,
    DBusError* error)
{
    const char *src, *dest;
    BusClientPolicy* sender_policy;
    BusClientPolicy* recipient_policy;
    dbus_int32_t toggles;
    dbus_bool_t log;
    int type;
    dbus_bool_t requested_reply;
    type = dbus_message_get_type(message);
    src = dbus_message_get_sender(message);
    dest = dbus_message_get_destination(message);
    _dbus_assert(
        dest != NULL || type == DBUS_MESSAGE_TYPE_SIGNAL ||
        (sender == NULL && !bus_connection_is_active(proposed_recipient)));
    _dbus_assert(type == DBUS_MESSAGE_TYPE_SIGNAL ||
                 addressed_recipient != NULL || activation_entry != NULL ||
                 strcmp(dest, DBUS_SERVICE_DBUS) == 0);
    switch (type)
    {
        case DBUS_MESSAGE_TYPE_METHOD_CALL:
        case DBUS_MESSAGE_TYPE_SIGNAL:
        case DBUS_MESSAGE_TYPE_METHOD_RETURN:
        case DBUS_MESSAGE_TYPE_ERROR:
            break;
        default:
            _dbus_verbose(
                "security check disallowing message of unknown type %d\n",
                type);
            dbus_set_error(
                error, DBUS_ERROR_ACCESS_DENIED,
                "Message bus will not accept messages of unknown type\n");
            return FALSE;
    }
    requested_reply = FALSE;
    if (sender != NULL)
    {
        if (bus_connection_is_active(sender))
        {
            sender_policy = bus_connection_get_policy(sender);
            _dbus_assert(sender_policy != NULL);
            if (dbus_message_get_reply_serial(message) != 0)
            {
                if (proposed_recipient != NULL  &&
                    addressed_recipient ==
                        proposed_recipient )
                {
                    DBusError error2;
                    dbus_error_init(&error2);
                    requested_reply = bus_connections_check_reply(
                        bus_connection_get_connections(sender), transaction,
                        sender, addressed_recipient, message, &error2);
                    if (dbus_error_is_set(&error2))
                    {
                        dbus_move_error(&error2, error);
                        return FALSE;
                    }
                }
            }
        }
        else
        {
            sender_policy = NULL;
        }
        if (!bus_selinux_allows_send(
                sender, proposed_recipient,
                dbus_message_type_to_string(dbus_message_get_type(message)),
                dbus_message_get_interface(message),
                dbus_message_get_member(message),
                dbus_message_get_error_name(message),
                dest ? dest : DBUS_SERVICE_DBUS, activation_entry, error))
        {
            if (error != NULL && !dbus_error_is_set(error))
            {
                complain_about_message(
                    context, DBUS_ERROR_ACCESS_DENIED,
                    "An SELinux policy prevents this sender from sending this "
                    "message to this recipient",
                    0, message, sender, proposed_recipient, FALSE, FALSE,
                    error);
                _dbus_verbose(
                    "SELinux security check denying send to service\n");
            }
            return FALSE;
        }
        if (!bus_apparmor_allows_send(
                sender, proposed_recipient, requested_reply,
                bus_context_get_type(context), dbus_message_get_type(message),
                dbus_message_get_path(message),
                dbus_message_get_interface(message),
                dbus_message_get_member(message),
                dbus_message_get_error_name(message),
                dest ? dest : DBUS_SERVICE_DBUS, src ? src : DBUS_SERVICE_DBUS,
                activation_entry, error))
            return FALSE;
        if (!bus_connection_is_active(sender))
        {
            if (proposed_recipient == NULL &&
                dbus_message_is_method_call(message, DBUS_INTERFACE_DBUS,
                                            "Hello"))
            {
                _dbus_verbose("security check allowing %s message\n", "Hello");
                return TRUE;
            }
            else
            {
                _dbus_verbose("security check disallowing non-%s message\n",
                              "Hello");
                dbus_set_error(error, DBUS_ERROR_ACCESS_DENIED,
                               "Client tried to send a message other than %s "
                               "without being registered",
                               "Hello");
                return FALSE;
            }
        }
    }
    else
    {
        sender_policy = NULL;
        if (addressed_recipient == proposed_recipient  &&
            dbus_message_get_reply_serial(message) != 0)
            requested_reply = TRUE;
    }
    _dbus_assert((sender != NULL && sender_policy != NULL) ||
                 (sender == NULL && sender_policy == NULL));
    if (proposed_recipient != NULL)
    {
        if (bus_connection_is_active(proposed_recipient))
        {
            recipient_policy = bus_connection_get_policy(proposed_recipient);
            _dbus_assert(recipient_policy != NULL);
        }
        else if (sender == NULL)
        {
            _dbus_verbose("security check using NULL recipient policy for "
                          "message from bus\n");
            recipient_policy = NULL;
        }
        else
        {
            _dbus_assert_not_reached(
                "a message was somehow sent to an inactive recipient from a "
                "source other than the message bus");
            recipient_policy = NULL;
        }
    }
    else
        recipient_policy = NULL;
    _dbus_assert((proposed_recipient != NULL && recipient_policy != NULL) ||
                 (proposed_recipient != NULL && sender == NULL &&
                  recipient_policy == NULL) ||
                 (proposed_recipient == NULL && recipient_policy == NULL));
    log = FALSE;
    if (sender_policy && !bus_client_policy_check_can_send(
                             sender_policy, context->registry, requested_reply,
                             proposed_recipient, message, &toggles, &log))
    {
        complain_about_message(
            context, DBUS_ERROR_ACCESS_DENIED, "Rejected send message", toggles,
            message, sender, proposed_recipient, requested_reply,
            (addressed_recipient == proposed_recipient), error);
        _dbus_verbose(
            "security policy disallowing message due to sender policy\n");
        return FALSE;
    }
    if (log)
    {
        complain_about_message(context, DBUS_ERROR_ACCESS_DENIED,
                               "Would reject message", toggles, message, sender,
                               proposed_recipient, requested_reply, TRUE, NULL);
    }
    if (recipient_policy &&
        !bus_client_policy_check_can_receive(
            recipient_policy, context->registry, requested_reply, sender,
            addressed_recipient, proposed_recipient, message, &toggles))
    {
        complain_about_message(
            context, DBUS_ERROR_ACCESS_DENIED, "Rejected receive message",
            toggles, message, sender, proposed_recipient, requested_reply,
            (addressed_recipient == proposed_recipient), error);
        _dbus_verbose(
            "security policy disallowing message due to recipient policy\n");
        return FALSE;
    }
    if (proposed_recipient &&
        ((dbus_connection_get_outgoing_size(proposed_recipient) >
          context->limits.max_outgoing_bytes) ||
         (dbus_connection_get_outgoing_unix_fds(proposed_recipient) >
          context->limits.max_outgoing_unix_fds)))
    {
        complain_about_message(context, DBUS_ERROR_LIMITS_EXCEEDED,
                               "Rejected: destination has a full message queue",
                               0, message, sender, proposed_recipient,
                               requested_reply, TRUE, error);
        _dbus_verbose(
            "security policy disallowing message due to full message queue\n");
        return FALSE;
    }
    if (type == DBUS_MESSAGE_TYPE_METHOD_CALL && sender &&
        addressed_recipient &&
        addressed_recipient == proposed_recipient && 
        !bus_connections_expect_reply(bus_connection_get_connections(sender),
                                      transaction, sender, addressed_recipient,
                                      message, error))
    {
        _dbus_verbose("Failed to record reply expectation or problem with the "
                      "message expecting a reply\n");
        return FALSE;
    }
    _dbus_verbose("security policy allowing message\n");
    return TRUE;
}
dbus_bool_t bus_context_check_security_policy ( BusContext * context , BusTransaction * transaction , DBusConnection * sender , DBusConnection * addressed_recipient , DBusConnection * proposed_recipient , DBusMessage * message , BusActivationEntry * activation_entry , DBusError * error ) { const char * src , * dest ; BusClientPolicy * sender_policy ; BusClientPolicy * recipient_policy ; dbus_int32_t toggles ; dbus_bool_t log ; int type ; dbus_bool_t requested_reply ; type = dbus_message_get_type ( message ) ; src = dbus_message_get_sender ( message ) ; dest = dbus_message_get_destination ( message ) ; _dbus_assert ( dest != NULL || type == DBUS_MESSAGE_TYPE_SIGNAL || ( sender == NULL && ! bus_connection_is_active ( proposed_recipient ) ) ) ; _dbus_assert ( type == DBUS_MESSAGE_TYPE_SIGNAL || addressed_recipient != NULL || activation_entry != NULL || strcmp ( dest , DBUS_SERVICE_DBUS ) == 0 ) ; switch ( type ) { case DBUS_MESSAGE_TYPE_METHOD_CALL : case DBUS_MESSAGE_TYPE_SIGNAL : case DBUS_MESSAGE_TYPE_METHOD_RETURN : case DBUS_MESSAGE_TYPE_ERROR : break ; default : _dbus_verbose ( " \n " , type ) ; dbus_set_error ( error , DBUS_ERROR_ACCESS_DENIED , " \n " ) ; return FALSE ; } requested_reply = FALSE ; if ( sender != NULL ) { if ( bus_connection_is_active ( sender ) ) { sender_policy = bus_connection_get_policy ( sender ) ; _dbus_assert ( sender_policy != NULL ) ; if ( dbus_message_get_reply_serial ( message ) != 0 ) { if ( proposed_recipient != NULL && addressed_recipient == proposed_recipient ) { DBusError error2 ; dbus_error_init ( & error2 ) ; requested_reply = bus_connections_check_reply ( bus_connection_get_connections ( sender ) , transaction , sender , addressed_recipient , message , & error2 ) ; if ( dbus_error_is_set ( & error2 ) ) { dbus_move_error ( & error2 , error ) ; return FALSE ; } } } } else { sender_policy = NULL ; } if ( ! bus_selinux_allows_send ( sender , proposed_recipient , dbus_message_type_to_string ( dbus_message_get_type ( message ) ) , dbus_message_get_interface ( message ) , dbus_message_get_member ( message ) , dbus_message_get_error_name ( message ) , dest ? dest : DBUS_SERVICE_DBUS , activation_entry , error ) ) { if ( error != NULL && ! dbus_error_is_set ( error ) ) { complain_about_message ( context , DBUS_ERROR_ACCESS_DENIED , " " " " , 0 , message , sender , proposed_recipient , FALSE , FALSE , error ) ; _dbus_verbose ( " \n " ) ; } return FALSE ; } if ( ! bus_apparmor_allows_send ( sender , proposed_recipient , requested_reply , bus_context_get_type ( context ) , dbus_message_get_type ( message ) , dbus_message_get_path ( message ) , dbus_message_get_interface ( message ) , dbus_message_get_member ( message ) , dbus_message_get_error_name ( message ) , dest ? dest : DBUS_SERVICE_DBUS , src ? src : DBUS_SERVICE_DBUS , activation_entry , error ) ) return FALSE ; if ( ! bus_connection_is_active ( sender ) ) { if ( proposed_recipient == NULL && dbus_message_is_method_call ( message , DBUS_INTERFACE_DBUS , " " ) ) { _dbus_verbose ( " \n " , " " ) ; return TRUE ; } else { _dbus_verbose ( " \n " , " " ) ; dbus_set_error ( error , DBUS_ERROR_ACCESS_DENIED , " " " " , " " ) ; return FALSE ; } } } else { sender_policy = NULL ; if ( addressed_recipient == proposed_recipient && dbus_message_get_reply_serial ( message ) != 0 ) requested_reply = TRUE ; } _dbus_assert ( ( sender != NULL && sender_policy != NULL ) || ( sender == NULL && sender_policy == NULL ) ) ; if ( proposed_recipient != NULL ) { if ( bus_connection_is_active ( proposed_recipient ) ) { recipient_policy = bus_connection_get_policy ( proposed_recipient ) ; _dbus_assert ( recipient_policy != NULL ) ; } else if ( sender == NULL ) { _dbus_verbose ( " " " \n " ) ; recipient_policy = NULL ; } else { _dbus_assert_not_reached ( " " " " ) ; recipient_policy = NULL ; } } else recipient_policy = NULL ; _dbus_assert ( ( proposed_recipient != NULL && recipient_policy != NULL ) || ( proposed_recipient != NULL && sender == NULL && recipient_policy == NULL ) || ( proposed_recipient == NULL && recipient_policy == NULL ) ) ; log = FALSE ; if ( sender_policy && ! bus_client_policy_check_can_send ( sender_policy , context -> registry , requested_reply , proposed_recipient , message , & toggles , & log ) ) { complain_about_message ( context , DBUS_ERROR_ACCESS_DENIED , " " , toggles , message , sender , proposed_recipient , requested_reply , ( addressed_recipient == proposed_recipient ) , error ) ; _dbus_verbose ( " \n " ) ; return FALSE ; } if ( log ) { complain_about_message ( context , DBUS_ERROR_ACCESS_DENIED , " " , toggles , message , sender , proposed_recipient , requested_reply , TRUE , NULL ) ; } if ( recipient_policy && ! bus_client_policy_check_can_receive ( recipient_policy , context -> registry , requested_reply , sender , addressed_recipient , proposed_recipient , message , & toggles ) ) { complain_about_message ( context , DBUS_ERROR_ACCESS_DENIED , " " , toggles , message , sender , proposed_recipient , requested_reply , ( addressed_recipient == proposed_recipient ) , error ) ; _dbus_verbose ( " \n " ) ; return FALSE ; } if ( proposed_recipient && ( ( dbus_connection_get_outgoing_size ( proposed_recipient ) > context -> limits . max_outgoing_bytes ) || ( dbus_connection_get_outgoing_unix_fds ( proposed_recipient ) > context -> limits . max_outgoing_unix_fds ) ) ) { complain_about_message ( context , DBUS_ERROR_LIMITS_EXCEEDED , " " , 0 , message , sender , proposed_recipient , requested_reply , TRUE , error ) ; _dbus_verbose ( " \n " ) ; return FALSE ; } if ( type == DBUS_MESSAGE_TYPE_METHOD_CALL && sender && addressed_recipient && addressed_recipient == proposed_recipient && ! bus_connections_expect_reply ( bus_connection_get_connections ( sender ) , transaction , sender , addressed_recipient , message , error ) ) { _dbus_verbose ( " " " \n " ) ; return FALSE ; } _dbus_verbose ( " \n " ) ; return TRUE ; }
addressed_recipient is the recipient specified in the message.
addressed_recipient is the recipient specified in the message .
/* dispatch.c was supposed to ensure these invariants */ /* Fill in requested_reply variable with TRUE if this is a
             * reply and the reply was pending.
             */ /* not to the bus driver */ /* not eavesdropping */ /* First verify the SELinux access controls.  If allowed then
         * go on with the standard checks.
         */ /* don't syslog this, just set the error: avc_has_perm should
                 * have already written to either the audit log or syslog */ /* next verify AppArmor access controls.  If allowed then
         * go on with the standard checks.
         */ /* Policy for inactive connections is that they can only send
             * the hello message to the bus driver
             */ /* If the sender is the bus driver, we assume any reply was a
         * requested reply as bus driver won't send bogus ones
         */ /* not eavesdropping */ /* only the bus driver can send to an inactive recipient (as it
         * owns no services, so other apps can't address it). Inactive
         * recipients can receive any message.
         */ /* We want to drop this message, and are only not doing so for backwards
         * compatibility. */ /* See if limits on size have been exceeded */ /* Record that we will allow a reply here in the future (don't
     * bother if the recipient is the bus or this is an eavesdropping
     * connection). Only the addressed recipient may reply.
     *
     * This isn't done for activation attempts because they have no addressed
     * or proposed recipient; when we check whether to actually deliver the
     * message, later, we'll record the reply expectation at that point.
     */ /* not eavesdropping */