Commit 8873c90f authored by Havoc Pennington's avatar Havoc Pennington

2005-01-18 Havoc Pennington <hp@redhat.com>

        * Throughout, grand renaming to strip out the use of "service",
	just say "name" instead (or "bus name" when ambiguous).  Did not
	change the internal code of the message bus itself, only the
	programmer-facing API and messages.

	* doc/dbus-specification.xml: further update the message bus section

	* bus/config-parser.c (all_are_equiv): fix bug using freed string
	in error case
parent 4fce2850
2005-01-18 Havoc Pennington <hp@redhat.com>
* Throughout, grand renaming to strip out the use of "service",
just say "name" instead (or "bus name" when ambiguous). Did not
change the internal code of the message bus itself, only the
programmer-facing API and messages.
* doc/dbus-specification.xml: further update the message bus section
* bus/config-parser.c (all_are_equiv): fix bug using freed string
in error case
2005-01-17 Havoc Pennington <hp@redhat.com> 2005-01-17 Havoc Pennington <hp@redhat.com>
* dbus/dbus-types.h: remove 16-bit types since we don't use them * dbus/dbus-types.h: remove 16-bit types since we don't use them
......
...@@ -789,13 +789,13 @@ child_setup (void *data) ...@@ -789,13 +789,13 @@ child_setup (void *data)
/* If no memory, we simply have the child exit, so it won't try /* If no memory, we simply have the child exit, so it won't try
* to connect to the wrong thing. * 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); _dbus_exit (1);
type = bus_context_get_type (activation->context); type = bus_context_get_type (activation->context);
if (type != NULL) if (type != NULL)
{ {
if (!_dbus_setenv ("DBUS_BUS_TYPE", type)) if (!_dbus_setenv ("DBUS_STARTER_BUS_TYPE", type))
_dbus_exit (1); _dbus_exit (1);
if (strcmp (type, "session") == 0) if (strcmp (type, "session") == 0)
...@@ -920,7 +920,7 @@ bus_activation_service_created (BusActivation *activation, ...@@ -920,7 +920,7 @@ bus_activation_service_created (BusActivation *activation,
goto error; goto error;
} }
result = DBUS_ACTIVATION_REPLY_ACTIVATED; result = DBUS_START_REPLY_SUCCESS;
if (!dbus_message_append_args (message, if (!dbus_message_append_args (message,
DBUS_TYPE_UINT32, &result, DBUS_TYPE_UINT32, &result,
...@@ -1280,8 +1280,8 @@ activation_find_entry (BusActivation *activation, ...@@ -1280,8 +1280,8 @@ activation_find_entry (BusActivation *activation,
if (!entry) if (!entry)
{ {
dbus_set_error (error, DBUS_ERROR_ACTIVATE_SERVICE_NOT_FOUND, dbus_set_error (error, DBUS_ERROR_SERVICE_UNKNOWN,
"The service %s was not found in the activation entry list", "The name %s was not provided by any .service files",
service_name); service_name);
return NULL; return NULL;
} }
...@@ -1347,7 +1347,7 @@ bus_activation_activate_service (BusActivation *activation, ...@@ -1347,7 +1347,7 @@ bus_activation_activate_service (BusActivation *activation,
return FALSE; return FALSE;
} }
result = DBUS_ACTIVATION_REPLY_ALREADY_ACTIVE; result = DBUS_START_REPLY_ALREADY_RUNNING;
if (!dbus_message_append_args (message, if (!dbus_message_append_args (message,
DBUS_TYPE_UINT32, &result, DBUS_TYPE_UINT32, &result,
......
...@@ -1677,7 +1677,7 @@ set_limit (BusConfigParser *parser, ...@@ -1677,7 +1677,7 @@ set_limit (BusConfigParser *parser,
must_be_positive = TRUE; must_be_positive = TRUE;
parser->limits.max_message_size = value; 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_positive = TRUE;
must_be_int = TRUE; must_be_int = TRUE;
...@@ -1713,13 +1713,13 @@ set_limit (BusConfigParser *parser, ...@@ -1713,13 +1713,13 @@ set_limit (BusConfigParser *parser,
must_be_int = TRUE; must_be_int = TRUE;
parser->limits.max_connections_per_user = value; 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_positive = TRUE;
must_be_int = TRUE; must_be_int = TRUE;
parser->limits.max_pending_activations = value; 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_positive = TRUE;
must_be_int = TRUE; must_be_int = TRUE;
...@@ -2814,28 +2814,29 @@ all_are_equiv (const DBusString *target_directory) ...@@ -2814,28 +2814,29 @@ all_are_equiv (const DBusString *target_directory)
printf (" %s\n", _dbus_string_get_const_data (&filename)); printf (" %s\n", _dbus_string_get_const_data (&filename));
parser = bus_config_load (&full_path, TRUE, NULL, &error); parser = bus_config_load (&full_path, TRUE, NULL, &error);
_dbus_string_free (&full_path);
if (parser == NULL) if (parser == NULL)
{ {
_dbus_warn ("Could not load file %s: %s\n", _dbus_warn ("Could not load file %s: %s\n",
_dbus_string_get_const_data (&full_path), _dbus_string_get_const_data (&full_path),
error.message); error.message);
_dbus_string_free (&full_path);
dbus_error_free (&error); dbus_error_free (&error);
goto finished; goto finished;
} }
else if (first_parser == NULL) else if (first_parser == NULL)
{ {
_dbus_string_free (&full_path);
first_parser = parser; first_parser = parser;
} }
else else
{ {
_dbus_string_free (&full_path);
equal = config_parsers_equal (first_parser, parser); equal = config_parsers_equal (first_parser, parser);
bus_config_parser_unref (parser); bus_config_parser_unref (parser);
if (! equal) if (! equal)
goto finished; goto finished;
} }
} }
retval = TRUE; retval = TRUE;
......
...@@ -23,7 +23,7 @@ exchange messages with one another. ...@@ -23,7 +23,7 @@ exchange messages with one another.
.PP .PP
There are two standard message bus instances: the systemwide message bus 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). 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 \fIdbus-daemon-1\fP is used for both of these instances, but with
a different configuration file. a different configuration file.
...@@ -212,7 +212,7 @@ Example: <listen>unix:path=/tmp/foo</listen> ...@@ -212,7 +212,7 @@ Example: <listen>unix:path=/tmp/foo</listen>
.PP .PP
If there are multiple <listen> elements, then the bus listens If there are multiple <listen> elements, then the bus listens
on multiple addresses. The bus will pass its address to 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, the last address given in <listen> first. That is,
apps will try to connect to the last <listen> address first. 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 ...@@ -241,8 +241,8 @@ scanned starting with the last to appear in the config file
service will be used). service will be used).
.PP .PP
Service files tell the bus how to automatically start a particular Service files tell the bus how to automatically start a program.
service. They are primarily used with the per-user-session bus, They are primarily used with the per-user-session bus,
not the systemwide bus. not the systemwide bus.
.TP .TP
...@@ -265,8 +265,8 @@ Available limit names are: ...@@ -265,8 +265,8 @@ Available limit names are:
queued up for a single connection queued up for a single connection
"max_message_size" : max size of a single message in "max_message_size" : max size of a single message in
bytes bytes
"activation_timeout" : milliseconds (thousandths) until "service_start_timeout" : milliseconds (thousandths) until
an activated service has to connect a started service has to connect
"auth_timeout" : milliseconds (thousandths) a "auth_timeout" : milliseconds (thousandths) a
connection is given to connection is given to
authenticate authenticate
...@@ -275,9 +275,9 @@ Available limit names are: ...@@ -275,9 +275,9 @@ Available limit names are:
connections connections
"max_connections_per_user" : max number of completed connections from "max_connections_per_user" : max number of completed connections from
the same user 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 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 connection can own
"max_match_rules_per_connection": max number of match rules for a single "max_match_rules_per_connection": max number of match rules for a single
connection connection
...@@ -347,14 +347,14 @@ The possible attributes of these elements are: ...@@ -347,14 +347,14 @@ The possible attributes of these elements are:
send_interface="interface_name" send_interface="interface_name"
send_member="method_or_signal_name" send_member="method_or_signal_name"
send_error="error_name" send_error="error_name"
send_destination="service_name" send_destination="name"
send_type="method_call" | "method_return" | "signal" | "error" send_type="method_call" | "method_return" | "signal" | "error"
send_path="/path/name" send_path="/path/name"
receive_interface="interface_name" receive_interface="interface_name"
receive_member="method_or_signal_name" receive_member="method_or_signal_name"
receive_error="error_name" receive_error="error_name"
receive_sender="service_name" receive_sender="name"
receive_type="method_call" | "method_return" | "signal" | "error" receive_type="method_call" | "method_return" | "signal" | "error"
receive_path="/path/name" receive_path="/path/name"
...@@ -363,7 +363,7 @@ The possible attributes of these elements are: ...@@ -363,7 +363,7 @@ The possible attributes of these elements are:
eavesdrop="true" | "false" eavesdrop="true" | "false"
own="servicename" own="name"
user="username" user="username"
group="groupname" group="groupname"
.fi .fi
...@@ -387,8 +387,8 @@ rules in the config file allow it). ...@@ -387,8 +387,8 @@ rules in the config file allow it).
.PP .PP
send_destination and receive_sender rules mean that messages may not be 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 sent to or received from the *owner* of the given name, not that
they may not be sent *to that service name*. That is, if a connection 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 owns services A, B, C, and sending to A is denied, sending to B or C
will not work either. will not work either.
...@@ -398,7 +398,7 @@ matches against the given field in the message header. ...@@ -398,7 +398,7 @@ matches against the given field in the message header.
.PP .PP
"Eavesdropping" occurs when an application receives a message that "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 Eavesdropping thus only applies to messages that are addressed to
services (i.e. it does not apply to signals). 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 ...@@ -437,7 +437,7 @@ user and group denials mean that the given user or group may
not connect to the message bus. not connect to the message bus.
.PP .PP
For "service_name", "username", "groupname", etc. For "name", "username", "groupname", etc.
the character "*" can be substituted, meaning "any." Complex globs the character "*" can be substituted, meaning "any." Complex globs
like "foo.bar.*" aren't allowed for now because they'd be work to like "foo.bar.*" aren't allowed for now because they'd be work to
implement and maybe encourage sloppy security anyway. implement and maybe encourage sloppy security anyway.
...@@ -449,10 +449,10 @@ context="default" or context="mandatory" policies. ...@@ -449,10 +449,10 @@ context="default" or context="mandatory" policies.
.PP .PP
A single <deny> rule may specify combinations of attributes such as 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. denial applies only if both attributes match the message being denied.
e.g. <deny send_interface="foo.bar" send_service="foo.blah"/> would e.g. <deny send_interface="foo.bar" send_destination="foo.blah"/> would
deny messages of the given interface AND to the given service. deny messages with the given interface AND the given bus name.
To get an OR effect you specify multiple <deny> rules. To get an OR effect you specify multiple <deny> rules.
.PP .PP
...@@ -482,17 +482,17 @@ creates a mapping. Right now only one kind of association is possible: ...@@ -482,17 +482,17 @@ creates a mapping. Right now only one kind of association is possible:
.fi .fi
.PP .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 "org.freedesktop.Foobar" then the source context will be the context
of the connection and the target context will be "foo_t" - see the of the connection and the target context will be "foo_t" - see the
short discussion of SELinux below. short discussion of SELinux below.
.PP .PP
Note, the context here is the target context when acquiring a service, Note, the context here is the target context when requesting a name,
NOT the context of the connection owning the service. NOT the context of the connection owning the name.
.PP .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: we add this syntax it will look like:
.nf .nf
<associate own="*" context="foo_t"/> <associate own="*" context="foo_t"/>
...@@ -501,9 +501,8 @@ If you find a reason this is useful, let the developers know. ...@@ -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. Right now the default will be the security context of the bus itself.
.PP .PP
If two <associate> elements specify the same service name, If two <associate> elements specify the same name, the element
the element appearing later in the configuration file will appearing later in the configuration file will be used.
be used.
.SH SELinux .SH SELinux
...@@ -557,14 +556,14 @@ connect to the systemwide bus. If this changes, we'll ...@@ -557,14 +556,14 @@ connect to the systemwide bus. If this changes, we'll
probably add a way to set the default connection context. probably add a way to set the default connection context.
.PP .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 the bus daemon will check permissions with the security
context of the connection as source, the security context specified 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". class "dbus" and requested permission "acquire_svc".
.PP .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 configuration file, the security context of the bus daemon
itself will be used. itself will be used.
......
This diff is collapsed.
...@@ -52,14 +52,14 @@ bus_driver_send_service_owner_changed (const char *service_name, ...@@ -52,14 +52,14 @@ bus_driver_send_service_owner_changed (const char *service_name,
_DBUS_ASSERT_ERROR_IS_CLEAR (error); _DBUS_ASSERT_ERROR_IS_CLEAR (error);
null_service = ""; null_service = "";
_dbus_verbose ("sending service owner changed: %s [%s -> %s]\n", _dbus_verbose ("sending name owner changed: %s [%s -> %s]\n",
service_name, service_name,
old_owner ? old_owner : null_service, old_owner ? old_owner : null_service,
new_owner ? new_owner : null_service); new_owner ? new_owner : null_service);
message = dbus_message_new_signal (DBUS_PATH_ORG_FREEDESKTOP_DBUS, message = dbus_message_new_signal (DBUS_PATH_ORG_FREEDESKTOP_DBUS,
DBUS_INTERFACE_ORG_FREEDESKTOP_DBUS, DBUS_INTERFACE_ORG_FREEDESKTOP_DBUS,
"ServiceOwnerChanged"); "NameOwnerChanged");
if (message == NULL) if (message == NULL)
{ {
...@@ -102,7 +102,7 @@ bus_driver_send_service_lost (DBusConnection *connection, ...@@ -102,7 +102,7 @@ bus_driver_send_service_lost (DBusConnection *connection,
message = dbus_message_new_signal (DBUS_PATH_ORG_FREEDESKTOP_DBUS, message = dbus_message_new_signal (DBUS_PATH_ORG_FREEDESKTOP_DBUS,
DBUS_INTERFACE_ORG_FREEDESKTOP_DBUS, DBUS_INTERFACE_ORG_FREEDESKTOP_DBUS,
"ServiceLost"); "NameLost");
if (message == NULL) if (message == NULL)
{ {
...@@ -145,7 +145,7 @@ bus_driver_send_service_acquired (DBusConnection *connection, ...@@ -145,7 +145,7 @@ bus_driver_send_service_acquired (DBusConnection *connection,
message = dbus_message_new_signal (DBUS_PATH_ORG_FREEDESKTOP_DBUS, message = dbus_message_new_signal (DBUS_PATH_ORG_FREEDESKTOP_DBUS,
DBUS_INTERFACE_ORG_FREEDESKTOP_DBUS, DBUS_INTERFACE_ORG_FREEDESKTOP_DBUS,
"ServiceAcquired"); "NameAcquired");
if (message == NULL) if (message == NULL)
{ {
...@@ -597,7 +597,7 @@ bus_driver_handle_activate_service (DBusConnection *connection, ...@@ -597,7 +597,7 @@ bus_driver_handle_activate_service (DBusConnection *connection,
DBUS_TYPE_INVALID)) DBUS_TYPE_INVALID))
{ {
_DBUS_ASSERT_ERROR_IS_SET (error); _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; return FALSE;
} }
...@@ -795,17 +795,18 @@ bus_driver_handle_get_service_owner (DBusConnection *connection, ...@@ -795,17 +795,18 @@ bus_driver_handle_get_service_owner (DBusConnection *connection,
if (service == NULL) if (service == NULL)
{ {
dbus_set_error (error, dbus_set_error (error,
DBUS_ERROR_SERVICE_HAS_NO_OWNER, DBUS_ERROR_NAME_HAS_NO_OWNER,
"Could not get owner of service '%s': no such service", text); "Could not get owner of name '%s': no such name", text);
goto failed; goto failed;
} }
base_name = bus_connection_get_name (bus_service_get_primary_owner (service)); base_name = bus_connection_get_name (bus_service_get_primary_owner (service));
if (base_name == NULL) if (base_name == NULL)
{ {
/* FIXME - how is this error possible? */
dbus_set_error (error, dbus_set_error (error,
DBUS_ERROR_FAILED, DBUS_ERROR_FAILED,
"Could not determine base service for '%s'", text); "Could not determine unique name for '%s'", text);
goto failed; goto failed;
} }
_dbus_assert (*base_name == ':'); _dbus_assert (*base_name == ':');
...@@ -870,8 +871,8 @@ bus_driver_handle_get_connection_unix_user (DBusConnection *connection, ...@@ -870,8 +871,8 @@ bus_driver_handle_get_connection_unix_user (DBusConnection *connection,
if (serv == NULL) if (serv == NULL)
{ {
dbus_set_error (error, dbus_set_error (error,
DBUS_ERROR_SERVICE_HAS_NO_OWNER, DBUS_ERROR_NAME_HAS_NO_OWNER,
"Could not get owner of service '%s': no such service", service); "Could not get UID of name '%s': no such name", service);
goto failed; goto failed;
} }
...@@ -946,8 +947,8 @@ bus_driver_handle_get_connection_unix_process_id (DBusConnection *connection, ...@@ -946,8 +947,8 @@ bus_driver_handle_get_connection_unix_process_id (DBusConnection *connection,
if (serv == NULL) if (serv == NULL)
{ {
dbus_set_error (error, dbus_set_error (error,
DBUS_ERROR_SERVICE_HAS_NO_OWNER, DBUS_ERROR_NAME_HAS_NO_OWNER,
"Could not get owner of service '%s': no such service", service); "Could not get PID of name '%s': no such name", service);
goto failed; goto failed;
} }
...@@ -1026,14 +1027,14 @@ struct ...@@ -1026,14 +1027,14 @@ struct
DBusMessage *message, DBusMessage *message,
DBusError *error); DBusError *error);
} message_handlers[] = { } message_handlers[] = {
{ "AcquireService", bus_driver_handle_acquire_service }, { "RequestName", bus_driver_handle_acquire_service },
{ "ActivateService", bus_driver_handle_activate_service }, { "StartServiceByName", bus_driver_handle_activate_service },
{ "Hello", bus_driver_handle_hello }, { "Hello", bus_driver_handle_hello },
{ "ServiceExists", bus_driver_handle_service_exists }, { "NameHasOwner", bus_driver_handle_service_exists },
{ "ListServices", bus_driver_handle_list_services }, { "ListNames", bus_driver_handle_list_services },
{ "AddMatch", bus_driver_handle_add_match }, { "AddMatch", bus_driver_handle_add_match },
{ "RemoveMatch", bus_driver_handle_remove_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 }, { "GetConnectionUnixUser", bus_driver_handle_get_connection_unix_user },
{ "GetConnectionUnixProcessID", bus_driver_handle_get_connection_unix_process_id }, { "GetConnectionUnixProcessID", bus_driver_handle_get_connection_unix_process_id },
{ "ReloadConfig", bus_driver_handle_reload_config } { "ReloadConfig", bus_driver_handle_reload_config }
......
...@@ -375,14 +375,14 @@ bus_registry_acquire_service (BusRegistry *registry, ...@@ -375,14 +375,14 @@ bus_registry_acquire_service (BusRegistry *registry,
_dbus_assert (current_owner == connection); _dbus_assert (current_owner == connection);
bus_service_set_prohibit_replacement (service, 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) else if (old_owner == connection)
*result = DBUS_SERVICE_REPLY_ALREADY_OWNER; *result = DBUS_REQUEST_NAME_REPLY_ALREADY_OWNER;
else if (!((flags & DBUS_SERVICE_FLAG_REPLACE_EXISTING))) else if (!((flags & DBUS_NAME_FLAG_REPLACE_EXISTING)))
*result = DBUS_SERVICE_REPLY_SERVICE_EXISTS; *result = DBUS_REQUEST_NAME_REPLY_EXISTS;
else if (bus_service_get_prohibit_replacement (service)) else if (bus_service_get_prohibit_replacement (service))
{ {
/* Queue the connection */ /* Queue the connection */
...@@ -390,14 +390,14 @@ bus_registry_acquire_service (BusRegistry *registry, ...@@ -390,14 +390,14 @@ bus_registry_acquire_service (BusRegistry *registry,
transaction, error)) transaction, error))
goto out; goto out;
*result = DBUS_SERVICE_REPLY_IN_QUEUE; *result = DBUS_REQUEST_NAME_REPLY_IN_QUEUE;
} }
else else
{ {
/* Replace the current owner */ /* Replace the current owner */
/* We enqueue the new owner and remove the first one because /* 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. * be sent.
*/ */
...@@ -410,7 +410,7 @@ bus_registry_acquire_service (BusRegistry *registry, ...@@ -410,7 +410,7 @@ bus_registry_acquire_service (BusRegistry *registry,
goto out; goto out;
_dbus_assert (connection == bus_service_get_primary_owner (service)); _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); activation = bus_context_get_activation (registry->context);
......
...@@ -657,10 +657,10 @@ bus_match_rule_parse (DBusConnection *matches_go_to, ...@@ -657,10 +657,10 @@ bus_match_rule_parse (DBusConnection *matches_go_to,
goto failed; 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, 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; goto failed;
} }
...@@ -745,10 +745,10 @@ bus_match_rule_parse (DBusConnection *matches_go_to, ...@@ -745,10 +745,10 @@ bus_match_rule_parse (DBusConnection *matches_go_to,
goto failed; 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, 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; goto failed;
} }
......
This diff is collapsed.
...@@ -35,25 +35,25 @@ DBusConnection *dbus_bus_get (DBusBusType type, ...@@ -35,25 +35,25 @@ DBusConnection *dbus_bus_get (DBusBusType type,
DBusError *error); DBusError *error);
dbus_bool_t dbus_bus_register (DBusConnection *connection, dbus_bool_t dbus_bus_register (DBusConnection *connection,
DBusError *error); DBusError *error);
dbus_bool_t dbus_bus_set_base_service (DBusConnection *connection, dbus_bool_t dbus_bus_set_unique_name (DBusConnection *connection,
const char *base_service); const char *unique_name);
const char* dbus_bus_get_base_service (DBusConnection *connection); const char* dbus_bus_get_unique_name (DBusConnection *connection);
unsigned long dbus_bus_get_unix_user (DBusConnection *connection, unsigned long dbus_bus_get_unix_user (DBusConnection *connection,
const char *service, const char *name,
DBusError *error); DBusError *error);
int dbus_bus_acquire_service (DBusConnection *connection, int dbus_bus_request_name (DBusConnection *connection,
const char *service_name, const char *name,
unsigned int flags, unsigned int flags,
DBusError *error); DBusError *error);
dbus_bool_t dbus_bus_service_exists (DBusConnection *connection, dbus_bool_t dbus_bus_name_has_owner (DBusConnection *connection,
const char *service_name, const char *name,
DBusError *error); DBusError *error);
dbus_bool_t dbus_bus_activate_service (DBusConnection *connection, dbus_bool_t dbus_bus_start_service_by_name (DBusConnection *connection,
const char *service_name, const char *name,
dbus_uint32_t flags, dbus_uint32_t flags,
dbus_uint32_t *reply, dbus_uint32_t *reply,
DBusError *error); DBusError *error);
void dbus_bus_add_match (DBusConnection *connection, void dbus_bus_add_match (DBusConnection *connection,
const char *rule, const char *rule,
......
...@@ -111,14 +111,14 @@ typedef struct DBusGProxyClass DBusGProxyClass; ...@@ -111,14 +111,14 @@ typedef struct DBusGProxyClass DBusGProxyClass;
GType dbus_g_proxy_get_type (void) G_GNUC_CONST; GType dbus_g_proxy_get_type (void) G_GNUC_CONST;
DBusGProxy* dbus_g_proxy_new_for_service (DBusGConnection *connection, DBusGProxy* dbus_g_proxy_new_for_name (DBusGConnection *connection,
const char *service_name, const char *name,
const char *path_name, const char *path,
const char *interface_name); const char *interface);
DBusGProxy* dbus_g_proxy_new_for_service_owner (DBusGConnection *connection, DBusGProxy* dbus_g_proxy_new_for_name_owner (DBusGConnection *connection,
const char *service_name, const char *name,
const char *path_name, const char *path,
const char *interface_name, const char *interface,
GError **error); GError **error);
DBusGProxy* dbus_g_proxy_new_for_peer (DBusGConnection *connection, DBusGProxy* dbus_g_proxy_new_for_peer (DBusGConnection *connection,
const char *path_name, const char *path_name,
......