diff options
Diffstat (limited to 'bus')
-rw-r--r-- | bus/activation.c | 12 | ||||
-rw-r--r-- | bus/config-parser.c | 11 | ||||
-rw-r--r-- | bus/dbus-daemon-1.1.in | 55 | ||||
-rw-r--r-- | bus/dispatch.c | 106 | ||||
-rw-r--r-- | bus/driver.c | 35 | ||||
-rw-r--r-- | bus/services.c | 16 | ||||
-rw-r--r-- | bus/signals.c | 8 |
7 files changed, 122 insertions, 121 deletions
diff --git a/bus/activation.c b/bus/activation.c index 7461720a..10839b9f 100644 --- a/bus/activation.c +++ b/bus/activation.c @@ -789,13 +789,13 @@ child_setup (void *data) /* If no memory, we simply have the child exit, so it won't try * to connect to the wrong thing. */ - if (!_dbus_setenv ("DBUS_ACTIVATION_ADDRESS", activation->server_address)) + if (!_dbus_setenv ("DBUS_STARTER_ADDRESS", activation->server_address)) _dbus_exit (1); type = bus_context_get_type (activation->context); if (type != NULL) { - if (!_dbus_setenv ("DBUS_BUS_TYPE", type)) + if (!_dbus_setenv ("DBUS_STARTER_BUS_TYPE", type)) _dbus_exit (1); if (strcmp (type, "session") == 0) @@ -920,7 +920,7 @@ bus_activation_service_created (BusActivation *activation, goto error; } - result = DBUS_ACTIVATION_REPLY_ACTIVATED; + result = DBUS_START_REPLY_SUCCESS; if (!dbus_message_append_args (message, DBUS_TYPE_UINT32, &result, @@ -1280,8 +1280,8 @@ activation_find_entry (BusActivation *activation, if (!entry) { - dbus_set_error (error, DBUS_ERROR_ACTIVATE_SERVICE_NOT_FOUND, - "The service %s was not found in the activation entry list", + dbus_set_error (error, DBUS_ERROR_SERVICE_UNKNOWN, + "The name %s was not provided by any .service files", service_name); return NULL; } @@ -1347,7 +1347,7 @@ bus_activation_activate_service (BusActivation *activation, return FALSE; } - result = DBUS_ACTIVATION_REPLY_ALREADY_ACTIVE; + result = DBUS_START_REPLY_ALREADY_RUNNING; if (!dbus_message_append_args (message, DBUS_TYPE_UINT32, &result, diff --git a/bus/config-parser.c b/bus/config-parser.c index 074c6218..d105cb0e 100644 --- a/bus/config-parser.c +++ b/bus/config-parser.c @@ -1677,7 +1677,7 @@ set_limit (BusConfigParser *parser, must_be_positive = TRUE; parser->limits.max_message_size = value; } - else if (strcmp (name, "activation_timeout") == 0) + else if (strcmp (name, "service_start_timeout") == 0) { must_be_positive = TRUE; must_be_int = TRUE; @@ -1713,13 +1713,13 @@ set_limit (BusConfigParser *parser, must_be_int = TRUE; parser->limits.max_connections_per_user = value; } - else if (strcmp (name, "max_pending_activations") == 0) + else if (strcmp (name, "max_pending_service_starts") == 0) { must_be_positive = TRUE; must_be_int = TRUE; parser->limits.max_pending_activations = value; } - else if (strcmp (name, "max_services_per_connection") == 0) + else if (strcmp (name, "max_names_per_connection") == 0) { must_be_positive = TRUE; must_be_int = TRUE; @@ -2814,28 +2814,29 @@ all_are_equiv (const DBusString *target_directory) printf (" %s\n", _dbus_string_get_const_data (&filename)); parser = bus_config_load (&full_path, TRUE, NULL, &error); - _dbus_string_free (&full_path); if (parser == NULL) { _dbus_warn ("Could not load file %s: %s\n", _dbus_string_get_const_data (&full_path), error.message); + _dbus_string_free (&full_path); dbus_error_free (&error); goto finished; } else if (first_parser == NULL) { + _dbus_string_free (&full_path); first_parser = parser; } else { + _dbus_string_free (&full_path); equal = config_parsers_equal (first_parser, parser); bus_config_parser_unref (parser); if (! equal) goto finished; } - } retval = TRUE; diff --git a/bus/dbus-daemon-1.1.in b/bus/dbus-daemon-1.1.in index 2498c55b..c38ca68a 100644 --- a/bus/dbus-daemon-1.1.in +++ b/bus/dbus-daemon-1.1.in @@ -23,7 +23,7 @@ exchange messages with one another. .PP There are two standard message bus instances: the systemwide message bus -(installed on many systems as the "messagebus" service) and the +(installed on many systems as the "messagebus" init service) and the per-user-login-session message bus (started each time a user logs in). \fIdbus-daemon-1\fP is used for both of these instances, but with a different configuration file. @@ -212,7 +212,7 @@ Example: <listen>unix:path=/tmp/foo</listen> .PP If there are multiple <listen> elements, then the bus listens on multiple addresses. The bus will pass its address to -activated services or other interested parties with +started services or other interested parties with the last address given in <listen> first. That is, apps will try to connect to the last <listen> address first. @@ -241,8 +241,8 @@ scanned starting with the last to appear in the config file service will be used). .PP -Service files tell the bus how to automatically start a particular -service. They are primarily used with the per-user-session bus, +Service files tell the bus how to automatically start a program. +They are primarily used with the per-user-session bus, not the systemwide bus. .TP @@ -265,8 +265,8 @@ Available limit names are: queued up for a single connection "max_message_size" : max size of a single message in bytes - "activation_timeout" : milliseconds (thousandths) until - an activated service has to connect + "service_start_timeout" : milliseconds (thousandths) until + a started service has to connect "auth_timeout" : milliseconds (thousandths) a connection is given to authenticate @@ -275,9 +275,9 @@ Available limit names are: connections "max_connections_per_user" : max number of completed connections from the same user - "max_pending_activations" : max number of activations in + "max_pending_service_starts" : max number of service launches in progress at the same time - "max_services_per_connection": max number of services a single + "max_names_per_connection" : max number of names a single connection can own "max_match_rules_per_connection": max number of match rules for a single connection @@ -347,14 +347,14 @@ The possible attributes of these elements are: send_interface="interface_name" send_member="method_or_signal_name" send_error="error_name" - send_destination="service_name" + send_destination="name" send_type="method_call" | "method_return" | "signal" | "error" send_path="/path/name" receive_interface="interface_name" receive_member="method_or_signal_name" receive_error="error_name" - receive_sender="service_name" + receive_sender="name" receive_type="method_call" | "method_return" | "signal" | "error" receive_path="/path/name" @@ -363,7 +363,7 @@ The possible attributes of these elements are: eavesdrop="true" | "false" - own="servicename" + own="name" user="username" group="groupname" .fi @@ -387,8 +387,8 @@ rules in the config file allow it). .PP send_destination and receive_sender rules mean that messages may not be -sent to or received from the *owner* of the given service, not that -they may not be sent *to that service name*. That is, if a connection +sent to or received from the *owner* of the given name, not that +they may not be sent *to that name*. That is, if a connection owns services A, B, C, and sending to A is denied, sending to B or C will not work either. @@ -398,7 +398,7 @@ matches against the given field in the message header. .PP "Eavesdropping" occurs when an application receives a message that -was explicitly addressed to a service the application does not own. +was explicitly addressed to a name the application does not own. Eavesdropping thus only applies to messages that are addressed to services (i.e. it does not apply to signals). @@ -437,7 +437,7 @@ user and group denials mean that the given user or group may not connect to the message bus. .PP -For "service_name", "username", "groupname", etc. +For "name", "username", "groupname", etc. the character "*" can be substituted, meaning "any." Complex globs like "foo.bar.*" aren't allowed for now because they'd be work to implement and maybe encourage sloppy security anyway. @@ -449,10 +449,10 @@ context="default" or context="mandatory" policies. .PP A single <deny> rule may specify combinations of attributes such as -send_service and send_interface and send_type. In this case, the +send_destination and send_interface and send_type. In this case, the denial applies only if both attributes match the message being denied. -e.g. <deny send_interface="foo.bar" send_service="foo.blah"/> would -deny messages of the given interface AND to the given service. +e.g. <deny send_interface="foo.bar" send_destination="foo.blah"/> would +deny messages with the given interface AND the given bus name. To get an OR effect you specify multiple <deny> rules. .PP @@ -482,17 +482,17 @@ creates a mapping. Right now only one kind of association is possible: .fi .PP -This means that if a connection asks to own the service +This means that if a connection asks to own the name "org.freedesktop.Foobar" then the source context will be the context of the connection and the target context will be "foo_t" - see the short discussion of SELinux below. .PP -Note, the context here is the target context when acquiring a service, -NOT the context of the connection owning the service. +Note, the context here is the target context when requesting a name, +NOT the context of the connection owning the name. .PP -There's currently no way to set a default for owning any service, if +There's currently no way to set a default for owning any name, if we add this syntax it will look like: .nf <associate own="*" context="foo_t"/> @@ -501,9 +501,8 @@ If you find a reason this is useful, let the developers know. Right now the default will be the security context of the bus itself. .PP -If two <associate> elements specify the same service name, -the element appearing later in the configuration file will -be used. +If two <associate> elements specify the same name, the element +appearing later in the configuration file will be used. .SH SELinux @@ -557,14 +556,14 @@ connect to the systemwide bus. If this changes, we'll probably add a way to set the default connection context. .PP -Second, any time a connection asks to own a service, +Second, any time a connection asks to own a name, the bus daemon will check permissions with the security context of the connection as source, the security context specified -for the service name with an <associate> element as target, object +for the name with an <associate> element as target, object class "dbus" and requested permission "acquire_svc". .PP -If the service name has no security context associated in the +If the name has no security context associated in the configuration file, the security context of the bus daemon itself will be used. diff --git a/bus/dispatch.c b/bus/dispatch.c index 4f7620b1..120c9037 100644 --- a/bus/dispatch.c +++ b/bus/dispatch.c @@ -258,7 +258,7 @@ bus_dispatch (DBusConnection *connection, _dbus_string_init_const (&service_string, service_name); service = bus_registry_lookup (registry, &service_string); - if (service == NULL && dbus_message_get_auto_activation (message)) + if (service == NULL && dbus_message_get_auto_start (message)) { BusActivation *activation; @@ -281,8 +281,8 @@ bus_dispatch (DBusConnection *connection, else if (service == NULL) { dbus_set_error (&error, - DBUS_ERROR_SERVICE_DOES_NOT_EXIST, - "Service \"%s\" does not exist", + DBUS_ERROR_NAME_HAS_NO_OWNER, + "Name \"%s\" does not exist", service_name); goto out; } @@ -539,14 +539,14 @@ check_service_owner_changed_foreach (DBusConnection *connection, if (message == NULL) { _dbus_warn ("Did not receive a message on %p, expecting %s\n", - connection, "ServiceOwnerChanged"); + connection, "NameOwnerChanged"); goto out; } else if (!dbus_message_is_signal (message, DBUS_INTERFACE_ORG_FREEDESKTOP_DBUS, - "ServiceOwnerChanged")) + "NameOwnerChanged")) { - warn_unexpected (connection, message, "ServiceOwnerChanged"); + warn_unexpected (connection, message, "NameOwnerChanged"); goto out; } @@ -582,7 +582,7 @@ check_service_owner_changed_foreach (DBusConnection *connection, || (d->expected_kind == OWNER_CHANGED && (!old_owner[0] || !new_owner[0])) || (d->expected_kind == SERVICE_DELETED && (!old_owner[0] || new_owner[0]))) { - _dbus_warn ("inconsistent ServiceOwnerChanged arguments"); + _dbus_warn ("inconsistent NameOwnerChanged arguments"); goto out; } @@ -625,7 +625,7 @@ kill_client_connection (BusContext *context, _dbus_verbose ("killing connection %p\n", connection); - s = dbus_bus_get_base_service (connection); + s = dbus_bus_get_unique_name (connection); _dbus_assert (s != NULL); while ((base_service = _dbus_strdup (s)) == NULL) @@ -660,7 +660,7 @@ kill_client_connection (BusContext *context, dbus_free (base_service); if (socd.failed) - _dbus_assert_not_reached ("didn't get the expected ServiceOwnerChanged (deletion) messages"); + _dbus_assert_not_reached ("didn't get the expected NameOwnerChanged (deletion) messages"); if (!check_no_leftovers (context)) _dbus_assert_not_reached ("stuff left in message queues after disconnecting a client"); @@ -877,7 +877,7 @@ check_hello_message (BusContext *context, _dbus_verbose ("Got hello name: %s\n", name); - while (!dbus_bus_set_base_service (connection, name)) + while (!dbus_bus_set_unique_name (connection, name)) _dbus_wait_for_memory (); socd.expected_kind = SERVICE_CREATED; @@ -897,14 +897,14 @@ check_hello_message (BusContext *context, if (message == NULL) { _dbus_warn ("Expecting %s, got nothing\n", - "ServiceAcquired"); + "NameAcquired"); goto out; } if (! dbus_message_is_signal (message, DBUS_INTERFACE_ORG_FREEDESKTOP_DBUS, - "ServiceAcquired")) + "NameAcquired")) { _dbus_warn ("Expecting %s, got smthg else\n", - "ServiceAcquired"); + "NameAcquired"); goto out; } @@ -1076,7 +1076,7 @@ check_get_connection_unix_user (BusContext *context, if (message == NULL) return TRUE; - base_service_name = dbus_bus_get_base_service (connection); + base_service_name = dbus_bus_get_unique_name (connection); if (!dbus_message_append_args (message, DBUS_TYPE_STRING, &base_service_name, @@ -1213,7 +1213,7 @@ check_get_connection_unix_process_id (BusContext *context, if (message == NULL) return TRUE; - base_service_name = dbus_bus_get_base_service (connection); + base_service_name = dbus_bus_get_unique_name (connection); if (!dbus_message_append_args (message, DBUS_TYPE_STRING, &base_service_name, @@ -1500,7 +1500,7 @@ check_hello_connection (BusContext *context) if (!check_hello_message (context, connection)) return FALSE; - if (dbus_bus_get_base_service (connection) == NULL) + if (dbus_bus_get_unique_name (connection) == NULL) { /* We didn't successfully register, so we can't * do the usual kill_client_connection() checks @@ -1536,8 +1536,8 @@ check_nonexistent_service_activation (BusContext *context, message = dbus_message_new_method_call (DBUS_SERVICE_ORG_FREEDESKTOP_DBUS, DBUS_PATH_ORG_FREEDESKTOP_DBUS, DBUS_INTERFACE_ORG_FREEDESKTOP_DBUS, - "ActivateService"); - + "StartServiceByName"); + if (message == NULL) return TRUE; @@ -1576,7 +1576,7 @@ check_nonexistent_service_activation (BusContext *context, if (message == NULL) { _dbus_warn ("Did not receive a reply to %s %d on %p\n", - "ActivateService", serial, connection); + "StartServiceByName", serial, connection); goto out; } @@ -1598,7 +1598,7 @@ check_nonexistent_service_activation (BusContext *context, ; /* good, this is a valid response */ } else if (dbus_message_is_error (message, - DBUS_ERROR_ACTIVATE_SERVICE_NOT_FOUND)) + DBUS_ERROR_SERVICE_UNKNOWN)) { ; /* good, this is expected also */ } @@ -1643,7 +1643,7 @@ check_nonexistent_service_auto_activation (BusContext *context, if (message == NULL) return TRUE; - dbus_message_set_auto_activation (message, TRUE); + dbus_message_set_auto_start (message, TRUE); if (!dbus_connection_send (connection, message, &serial)) { @@ -1693,7 +1693,7 @@ check_nonexistent_service_auto_activation (BusContext *context, ; /* good, this is a valid response */ } else if (dbus_message_is_error (message, - DBUS_ERROR_ACTIVATE_SERVICE_NOT_FOUND)) + DBUS_ERROR_SERVICE_UNKNOWN)) { ; /* good, this is expected also */ } @@ -1742,7 +1742,7 @@ check_base_service_activated (BusContext *context, if (dbus_message_is_signal (message, DBUS_INTERFACE_ORG_FREEDESKTOP_DBUS, - "ServiceOwnerChanged")) + "NameOwnerChanged")) { CheckServiceOwnerChangedData socd; @@ -1766,7 +1766,7 @@ check_base_service_activated (BusContext *context, else { _dbus_warn ("Message %s doesn't have a service name: %s\n", - "ServiceOwnerChanged (creation)", + "NameOwnerChanged (creation)", error.message); goto out; } @@ -1805,7 +1805,7 @@ check_base_service_activated (BusContext *context, } else { - warn_unexpected (connection, message, "ServiceOwnerChanged (creation) for base service"); + warn_unexpected (connection, message, "NameOwnerChanged (creation) for base service"); goto out; } @@ -1844,7 +1844,7 @@ check_service_activated (BusContext *context, if (dbus_message_is_signal (message, DBUS_INTERFACE_ORG_FREEDESKTOP_DBUS, - "ServiceOwnerChanged")) + "NameOwnerChanged")) { CheckServiceOwnerChangedData socd; const char *service_name, *base_service_from_bus, *old_owner; @@ -1869,7 +1869,7 @@ check_service_activated (BusContext *context, else { _dbus_warn ("Message %s doesn't have a service name: %s\n", - "ServiceOwnerChanged (creation)", + "NameOwnerChanged (creation)", error.message); goto out; } @@ -1884,7 +1884,7 @@ check_service_activated (BusContext *context, if (strcmp (base_service_name, base_service_from_bus) != 0) { - _dbus_warn ("ServiceOwnerChanged reports wrong base service: %s owner, expected %s instead\n", + _dbus_warn ("NameOwnerChanged reports wrong base service: %s owner, expected %s instead\n", base_service_from_bus, base_service_name); goto out; } @@ -1892,8 +1892,8 @@ check_service_activated (BusContext *context, if (old_owner[0]) { _dbus_warn ("expected a %s, got a %s\n", - "ServiceOwnerChanged (creation)", - "ServiceOwnerChanged (change)"); + "NameOwnerChanged (creation)", + "NameOwnerChanged (change)"); goto out; } @@ -1916,20 +1916,20 @@ check_service_activated (BusContext *context, if (message == NULL) { _dbus_warn ("Expected a reply to %s, got nothing\n", - "ActivateService"); + "StartServiceByName"); goto out; } } else { - warn_unexpected (connection, message, "ServiceOwnerChanged for the activated name"); + warn_unexpected (connection, message, "NameOwnerChanged for the activated name"); goto out; } if (dbus_message_get_type (message) != DBUS_MESSAGE_TYPE_METHOD_RETURN) { - warn_unexpected (connection, message, "reply to ActivateService"); + warn_unexpected (connection, message, "reply to StartServiceByName"); goto out; } @@ -1942,7 +1942,7 @@ check_service_activated (BusContext *context, if (!dbus_error_has_name (&error, DBUS_ERROR_NO_MEMORY)) { _dbus_warn ("Did not have activation result first argument to %s: %s\n", - "ActivateService", error.message); + "StartServiceByName", error.message); goto out; } @@ -1950,13 +1950,13 @@ check_service_activated (BusContext *context, } else { - if (activation_result == DBUS_ACTIVATION_REPLY_ACTIVATED) + if (activation_result == DBUS_START_REPLY_SUCCESS) ; /* Good */ - else if (activation_result == DBUS_ACTIVATION_REPLY_ALREADY_ACTIVE) + else if (activation_result == DBUS_START_REPLY_ALREADY_RUNNING) ; /* Good also */ else { - _dbus_warn ("Activation result was 0x%x, no good.\n", + _dbus_warn ("Activation result was %u, no good.\n", activation_result); goto out; } @@ -2001,7 +2001,7 @@ check_service_auto_activated (BusContext *context, if (dbus_message_is_signal (message, DBUS_INTERFACE_ORG_FREEDESKTOP_DBUS, - "ServiceOwnerChanged")) + "NameOwnerChanged")) { const char *service_name; CheckServiceOwnerChangedData socd; @@ -2020,7 +2020,7 @@ check_service_auto_activated (BusContext *context, else { _dbus_warn ("Message %s doesn't have a service name: %s\n", - "ServiceOwnerChanged", + "NameOwnerChanged", error.message); dbus_error_free (&error); goto out; @@ -2054,7 +2054,7 @@ check_service_auto_activated (BusContext *context, } else { - warn_unexpected (connection, message, "ServiceOwnerChanged for the activated name"); + warn_unexpected (connection, message, "NameOwnerChanged for the activated name"); goto out; } @@ -2335,7 +2335,7 @@ check_got_service_info (DBusMessage *message) if (dbus_message_is_signal (message, DBUS_INTERFACE_ORG_FREEDESKTOP_DBUS, - "ServiceOwnerChanged")) + "NameOwnerChanged")) { DBusError error; const char *service_name, *old_owner, *new_owner; @@ -2360,7 +2360,7 @@ check_got_service_info (DBusMessage *message) } else { - _dbus_warn ("unexpected arguments for ServiceOwnerChanged message"); + _dbus_warn ("unexpected arguments for NameOwnerChanged message"); message_kind = GOT_SOMETHING_ELSE; } } @@ -2403,7 +2403,7 @@ check_existent_service_activation (BusContext *context, message = dbus_message_new_method_call (DBUS_SERVICE_ORG_FREEDESKTOP_DBUS, DBUS_PATH_ORG_FREEDESKTOP_DBUS, DBUS_INTERFACE_ORG_FREEDESKTOP_DBUS, - "ActivateService"); + "StartServiceByName"); if (message == NULL) return TRUE; @@ -2448,12 +2448,12 @@ check_existent_service_activation (BusContext *context, if (message == NULL) { _dbus_warn ("Did not receive any messages after %s %d on %p\n", - "ActivateService", serial, connection); + "StartServiceByName", serial, connection); goto out; } verbose_message_received (connection, message); - _dbus_verbose (" (after sending %s)\n", "ActivateService"); + _dbus_verbose (" (after sending %s)\n", "StartServiceByName"); if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_ERROR) { @@ -2570,7 +2570,7 @@ check_existent_service_activation (BusContext *context, if (message == NULL) { _dbus_warn ("Failed to pop message we just put back! " - "should have been a ServiceOwnerChanged (creation)\n"); + "should have been a NameOwnerChanged (creation)\n"); goto out; } @@ -2623,7 +2623,7 @@ check_segfault_service_activation (BusContext *context, message = dbus_message_new_method_call (DBUS_SERVICE_ORG_FREEDESKTOP_DBUS, DBUS_PATH_ORG_FREEDESKTOP_DBUS, DBUS_INTERFACE_ORG_FREEDESKTOP_DBUS, - "ActivateService"); + "StartServiceByName"); if (message == NULL) return TRUE; @@ -2664,7 +2664,7 @@ check_segfault_service_activation (BusContext *context, if (message == NULL) { _dbus_warn ("Did not receive a reply to %s %d on %p\n", - "ActivateService", serial, connection); + "StartServiceByName", serial, connection); goto out; } @@ -2732,7 +2732,7 @@ check_segfault_service_auto_activation (BusContext *context, if (message == NULL) return TRUE; - dbus_message_set_auto_activation (message, TRUE); + dbus_message_set_auto_start (message, TRUE); if (!dbus_connection_send (connection, message, &serial)) { @@ -2833,7 +2833,7 @@ check_existent_service_auto_activation (BusContext *context, if (message == NULL) return TRUE; - dbus_message_set_auto_activation (message, TRUE); + dbus_message_set_auto_start (message, TRUE); text = TEST_ECHO_MESSAGE; if (!dbus_message_append_args (message, @@ -2872,13 +2872,13 @@ check_existent_service_auto_activation (BusContext *context, message = pop_message_waiting_for_memory (connection); if (message == NULL) { - _dbus_warn ("Did not receive any messages after auto activation %d on %p\n", + _dbus_warn ("Did not receive any messages after auto start %d on %p\n", serial, connection); goto out; } verbose_message_received (connection, message); - _dbus_verbose (" (after sending %s)\n", "auto activation"); + _dbus_verbose (" (after sending %s)\n", "auto start"); /* we should get zero or two ServiceOwnerChanged signals */ if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_SIGNAL) @@ -2920,7 +2920,7 @@ check_existent_service_auto_activation (BusContext *context, if (message == NULL) { _dbus_warn ("Failed to pop message we just put back! " - "should have been a ServiceOwnerChanged (creation)\n"); + "should have been a NameOwnerChanged (creation)\n"); goto out; } diff --git a/bus/driver.c b/bus/driver.c index 0eef59e1..3a9e555d 100644 --- a/bus/driver.c +++ b/bus/driver.c @@ -52,14 +52,14 @@ bus_driver_send_service_owner_changed (const char *service_name, _DBUS_ASSERT_ERROR_IS_CLEAR (error); null_service = ""; - _dbus_verbose ("sending service owner changed: %s [%s -> %s]\n", + _dbus_verbose ("sending name owner changed: %s [%s -> %s]\n", service_name, old_owner ? old_owner : null_service, new_owner ? new_owner : null_service); message = dbus_message_new_signal (DBUS_PATH_ORG_FREEDESKTOP_DBUS, DBUS_INTERFACE_ORG_FREEDESKTOP_DBUS, - "ServiceOwnerChanged"); + "NameOwnerChanged"); if (message == NULL) { @@ -102,7 +102,7 @@ bus_driver_send_service_lost (DBusConnection *connection, message = dbus_message_new_signal (DBUS_PATH_ORG_FREEDESKTOP_DBUS, DBUS_INTERFACE_ORG_FREEDESKTOP_DBUS, - "ServiceLost"); + "NameLost"); if (message == NULL) { @@ -145,7 +145,7 @@ bus_driver_send_service_acquired (DBusConnection *connection, message = dbus_message_new_signal (DBUS_PATH_ORG_FREEDESKTOP_DBUS, DBUS_INTERFACE_ORG_FREEDESKTOP_DBUS, - "ServiceAcquired"); + "NameAcquired"); if (message == NULL) { @@ -597,7 +597,7 @@ bus_driver_handle_activate_service (DBusConnection *connection, DBUS_TYPE_INVALID)) { _DBUS_ASSERT_ERROR_IS_SET (error); - _dbus_verbose ("No memory to get arguments to ActivateService\n"); + _dbus_verbose ("No memory to get arguments to StartServiceByName\n"); return FALSE; } @@ -795,17 +795,18 @@ bus_driver_handle_get_service_owner (DBusConnection *connection, if (service == NULL) { dbus_set_error (error, - DBUS_ERROR_SERVICE_HAS_NO_OWNER, - "Could not get owner of service '%s': no such service", text); + DBUS_ERROR_NAME_HAS_NO_OWNER, + "Could not get owner of name '%s': no such name", text); goto failed; } base_name = bus_connection_get_name (bus_service_get_primary_owner (service)); if (base_name == NULL) { + /* FIXME - how is this error possible? */ dbus_set_error (error, DBUS_ERROR_FAILED, - "Could not determine base service for '%s'", text); + "Could not determine unique name for '%s'", text); goto failed; } _dbus_assert (*base_name == ':'); @@ -870,8 +871,8 @@ bus_driver_handle_get_connection_unix_user (DBusConnection *connection, if (serv == NULL) { dbus_set_error (error, - DBUS_ERROR_SERVICE_HAS_NO_OWNER, - "Could not get owner of service '%s': no such service", service); + DBUS_ERROR_NAME_HAS_NO_OWNER, + "Could not get UID of name '%s': no such name", service); goto failed; } @@ -946,8 +947,8 @@ bus_driver_handle_get_connection_unix_process_id (DBusConnection *connection, if (serv == NULL) { dbus_set_error (error, - DBUS_ERROR_SERVICE_HAS_NO_OWNER, - "Could not get owner of service '%s': no such service", service); + DBUS_ERROR_NAME_HAS_NO_OWNER, + "Could not get PID of name '%s': no such name", service); goto failed; } @@ -1026,14 +1027,14 @@ struct DBusMessage *message, DBusError *error); } message_handlers[] = { - { "AcquireService", bus_driver_handle_acquire_service }, - { "ActivateService", bus_driver_handle_activate_service }, + { "RequestName", bus_driver_handle_acquire_service }, + { "StartServiceByName", bus_driver_handle_activate_service }, { "Hello", bus_driver_handle_hello }, - { "ServiceExists", bus_driver_handle_service_exists }, - { "ListServices", bus_driver_handle_list_services }, + { "NameHasOwner", bus_driver_handle_service_exists }, + { "ListNames", bus_driver_handle_list_services }, { "AddMatch", bus_driver_handle_add_match }, { "RemoveMatch", bus_driver_handle_remove_match }, - { "GetServiceOwner", bus_driver_handle_get_service_owner }, + { "GetNameOwner", bus_driver_handle_get_service_owner }, { "GetConnectionUnixUser", bus_driver_handle_get_connection_unix_user }, { "GetConnectionUnixProcessID", bus_driver_handle_get_connection_unix_process_id }, { "ReloadConfig", bus_driver_handle_reload_config } diff --git a/bus/services.c b/bus/services.c index 8f223f4e..90c8d1d8 100644 --- a/bus/services.c +++ b/bus/services.c @@ -375,14 +375,14 @@ bus_registry_acquire_service (BusRegistry *registry, _dbus_assert (current_owner == connection); bus_service_set_prohibit_replacement (service, - (flags & DBUS_SERVICE_FLAG_PROHIBIT_REPLACEMENT)); + (flags & DBUS_NAME_FLAG_PROHIBIT_REPLACEMENT)); - *result = DBUS_SERVICE_REPLY_PRIMARY_OWNER; + *result = DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER; } else if (old_owner == connection) - *result = DBUS_SERVICE_REPLY_ALREADY_OWNER; - else if (!((flags & DBUS_SERVICE_FLAG_REPLACE_EXISTING))) - *result = DBUS_SERVICE_REPLY_SERVICE_EXISTS; + *result = DBUS_REQUEST_NAME_REPLY_ALREADY_OWNER; + else if (!((flags & DBUS_NAME_FLAG_REPLACE_EXISTING))) + *result = DBUS_REQUEST_NAME_REPLY_EXISTS; else if (bus_service_get_prohibit_replacement (service)) { /* Queue the connection */ @@ -390,14 +390,14 @@ bus_registry_acquire_service (BusRegistry *registry, transaction, error)) goto out; - *result = DBUS_SERVICE_REPLY_IN_QUEUE; + *result = DBUS_REQUEST_NAME_REPLY_IN_QUEUE; } else { /* Replace the current owner */ /* We enqueue the new owner and remove the first one because - * that will cause ServiceAcquired and ServiceLost messages to + * that will cause NameAcquired and NameLost messages to * be sent. */ @@ -410,7 +410,7 @@ bus_registry_acquire_service (BusRegistry *registry, goto out; _dbus_assert (connection == bus_service_get_primary_owner (service)); - *result = DBUS_SERVICE_REPLY_PRIMARY_OWNER; + *result = DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER; } activation = bus_context_get_activation (registry->context); diff --git a/bus/signals.c b/bus/signals.c index 2b5aa13f..eedeff6f 100644 --- a/bus/signals.c +++ b/bus/signals.c @@ -657,10 +657,10 @@ bus_match_rule_parse (DBusConnection *matches_go_to, goto failed; } - if (!_dbus_validate_service (&tmp_str, 0, len)) + if (!_dbus_validate_bus_name (&tmp_str, 0, len)) { dbus_set_error (error, DBUS_ERROR_MATCH_RULE_INVALID, - "Sender service name '%s' is invalid\n", value); + "Sender name '%s' is invalid\n", value); goto failed; } @@ -745,10 +745,10 @@ bus_match_rule_parse (DBusConnection *matches_go_to, goto failed; } - if (!_dbus_validate_service (&tmp_str, 0, len)) + if (!_dbus_validate_bus_name (&tmp_str, 0, len)) { dbus_set_error (error, DBUS_ERROR_MATCH_RULE_INVALID, - "Destination service name '%s' is invalid\n", value); + "Destination name '%s' is invalid\n", value); goto failed; } |