History log of /external/dbus/bus/services.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
dbecdeabb20e0ce11121819c63373f0afba57c58 19-Mar-2010 Marcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de> Consistently include <config.h> in all C source files and never in header files.
/external/dbus/bus/services.c
5baf2f856a9c6625993234855b07680da1c8916f 11-Jul-2009 Tobias Mueller <fdo-bugs@cryptobitch.de> Bug 21161 - Update the FSF address

No comment.

Signed-off-by: Colin Walters <walters@verbum.org>
/external/dbus/bus/services.c
d012387afef0ba02185ebe27bc6bb15551912e92 14-Jul-2007 Havoc Pennington <hp@redhat.com> 2007-07-13 Havoc Pennington <hp@redhat.com>

* Add indent-tabs-mode: nil to all file headers.
/external/dbus/bus/services.c
7cd52919443f190fa1601a3d1bac5c8ce8d9ecc1 18-Aug-2006 John (J5) Palmieri <johnp@redhat.com> Patch provided by Ralf Habacker (ralf dot habacker at freenet dot de)

* dbus/dbus-sysdeps.c, dbus/dbus-threads.c, dbus/dbus-internals.h:
Add two more global locks for use on windows platforms. These are
unused on non-windows platforms but are not ifdefed out to avoid
potential bugs (i.e. the few bytes lost does not warrent the extra
maintanence and complexity that having seperate sets of locks would
cause)
/external/dbus/bus/services.c
c1091cbbd2477699dc16f8c8e3d15fea2f68d603 14-Aug-2006 John (J5) Palmieri <johnp@redhat.com> Patches by Kjartan Maraas <kmaraas at gnome dot org>

* bus/services.c (bus_service_list_queued_owners):
Add a pointer cast to fix compiler warning

* dbus/dbus-dataslot.c (_dbus_data_slot_list_get):
return a NULL instead of FALSE since the return type
is not expecting a boolean

* dbus/dbus-marshal-basic.c (_dbus_marshal_test):
Remove unused variable

* dbus/dbus-marshal-recursive-util.c (node_new):
return a NULL instead of FALSE since the return type
is not expecting a boolean

* dbus/dbus-server-debug-pipe.c (_dbus_transport_debug_pipe_new):
Send a NULL into _dbus_transport_new_for_fd instead of a FALSE
because we are expecting a pointer not a boolean

* dbus/dbus-sysdeps-util.c (_dbus_get_tmpdir):
add void as the parameter so some compilers
don't complain

* dbus/dbus-transport-unix.c (_dbus_transport_new_for_domain_socket,
_dbus_transport_new_for_tcp_socket):
Send a NULL into _dbus_transport_new_for_fd instead of a FALSE
because we are expecting a pointer not a boolean

* test/shell-test.c (test_command_line):
cast the second argument to _dbus_list_append to avoid compiler
warnings

* test/test-names.c (main): remove unused variable

* test/test-service.c (check_hello_from_self_reply):
Initialize echo_message and echo_reply to NULL

* test/test-shell-service.c (handle_echo):
Remove unused variable and cast the third parameter passed to
dbus_connection_get_object_path_data to avoid compiler warrnings

* test/name-test/test-names.c (clear_message_queue):
Remove unused function

* test/name-test/test-pending-call-dispatch.c:
Fix format string in printf
/external/dbus/bus/services.c
1a163e765c0d6a86d2aa2ffb18a1d7e29a052e7a 22-Nov-2005 John (J5) Palmieri <johnp@redhat.com> * configure.in: Add test/name-test/Makefile to the generated
Makefile list

* dbus/dbus-shared.h (#define DBUS_NAME_FLAG_ALLOW_REPLACEMENT):
New flag which replaces DBUS_NAME_FLAG_PROHIBIT_REPLACEMENT
(#define DBUS_NAME_FLAG_DO_NOT_QUEUE): New flag for specifying
not to queue an ower if it can't be the primary owner

* bus/bus.h: Add new internal BusOwner struct

* bus/driver.c (bus_driver_handle_hello): Send flags (0 for default)
to bus_registry_ensure and don't set the prohibit_replacement flag
since they are now set per BusOwner and not per name.
(bus_driver_handle_list_queued_owners): bus method (ListQueuedOwners)
that returns the list of connections in a name's connection queue

* bus/services.c (struct BusService): remove prohibit_replacement field
(struct BusOwner): new struct for keeping track of queued connections
and their associated flags for the queue
(struct BusRegistry): add a BusOwner memory pool
(bus_registry_new): initialize the BusOwner memory pool
(bus_registry_unref): free the BusOwner memory pool
(_bus_service_find_owner_link): new internal method for
searching the queue for a specific connection
(bus_owner_set_flags): new method for adding setting the flags on a
bus owner
(bus_owner_new): new method that creates a BusOwner object from the
pool and sets its flags
(bus_owner_ref, bus_owner_unref): ref counting for BusOwner objects
(bus_registry_ensure): Add the flags parameter
(bus_registry_acquire_service): Switch from using raw connections to
using the BusOwner struct
Add new state machine for dealing with the new set of flags
(bus_registry_set_service_context_table, struct OwnershipCancelData,
cancel_ownership, free_ownership_cancel_data,
add_cancel_ownership_to_transaction, struct OwnershipRestoreData,
restore_ownership, free_ownership_restore_data,
add_restore_ownership_to_transaction): Switch to using BusOwner
instead of raw connections
(bus_service_add_owner): Add flags parameter
Switch to using BusOwner instead of raw connections
Add state machine for dealing with the new set of flags
(bus_service_swap_owner): Swaps the first and second owners in the
queue. Used to make sure proper signals are sent when a service looses
or gains primary ownership. We never insert an owner at the top of the
queue. Instead we insert it in the second position and then swap.
(bus_service_remove_owner): Remove the owner from the queue sending
out the NameLost and NameOwnerChanged signals if the we were the
primary owner
(bus_service_get_primary_owners_connection): New method that extracts
the connection from the primary owner
(bus_service_get_primary_owner): Returns the BusOwner instead of the
connection
(bus_service_get_allow_replacement): Changed from the old
bus_service_get_prohibit_replacement method. Checks the flags of the
primary owner and returns if it can be replaced or not
(bus_service_set_prohibit_replacement): removed
(bus_service_has_owner): returns TRUE if and owner with
the specified connection exists in the queue

* dbus/dbus-bus.c (dbus_bus_connection_get_unique_name): New helper
method that only compiles if tests are enabled. Allows us to get the
unique name of a connection so we can check it against the queue when
doing regression tests

* bus/activation.c (bus_activation_send_pending_auto_activate),
bus/dispatch.c (bus_dispatch),
bus/driver.c (bus_driver_handle_get_service_owner,
bus_driver_handle_get_connection_unix_user,
bus_driver_handle_get_connection_unix_process_id,
bus_driver_handle_get_connection_selinux_security_context),
bus/signals.c (connection_is_primary_owner):
use bus_service_get_primary_owners_connection instead of
bus_service_get_primary_owner

* dbus/dbus-sysdeps.c (_dbus_connect_unix_socket,
_dbus_listen_unix_socket): Calculate the length of the socket
path and use that instead of using a fixed length which was
causing socket names to contain many trailing Nul bytes.

* dbus/dbus-glib-lowlevel.h, glib/dbus-gobject.c
(dbus_g_method_get_sender): New method for extracting the sender
from a DBusGMethodInvocation
(dbus_g_method_return_get_reply): changed name to
dbus_g_method_get_reply
(dbus_g_method_return_send_reply): changed name to
dbus_g_method_send reply

* doc/dbus-specification.xml: New docs that describe how the new
queueing system works and talks about the changes to the how
we specify socket names

* glib/examples/example-service.c,
glib/examples/example-signal-emitter.c,
glib/examples/statemachine/statemachine-server.c:
Changed the RequestName flags to the new system

* test/name-test/ (test-names.c, run-test.sh, Makefile.am): New
regression test suite for testing various states of the new
queueing system
/external/dbus/bus/services.c
b5e4d26adec0a9ec37a1bae7aeb5a68344b78ebf 15-Nov-2005 Robert McQueen <robot101@debian.org> 2005-11-15 Robert McQueen <robot101@debian.org>

* bus/driver.c, bus/services.c, bus/services.h: Add a ReleaseName
method to org.freedesktop.DBus to release a bus name or give up
waiting in the queue for it.

* dbus/dbus-bus.c, dbus/dbus-bus.h, dbus/dbus-shared.h: Add a
dbus_bus_release_name method to send the ReleaseName method calls.
Add constants for the return values to dbus/dbus-shared.h.

* doc/dbus-specification.xml: Document the new ReleaseName method
in the specification.

* python/dbus_bindings.pyx: Add a low-level python binding for the
release name method.

* python/exceptions.py, python/service.py: Make freeing BusName
objects release the name. Add a NameExistsException, and fix a
bug with creating UnknownMethodException.

* test/python/test-client.py: Add tests for freeing BusName
objects causing names to be released.
/external/dbus/bus/services.c
44656f538f69e8f8709ddb6ab285db29f65f62dd 13-Apr-2005 David Zeuthen <davidz@redhat.com> 2005-04-13 David Zeuthen <davidz@redhat.com>

* bus/selinux.c: Add c-file-style to top of file
(log_audit_callback): Don't free the data here anymore
(bus_selinux_check): Don't take spid and tpid since appending
that to auxdata may OOM.
(bus_selinux_allows_acquire_service): Handle OOM and signal back
to the caller if we are OOM by taking an error object.
(bus_selinux_allows_send): -do-

* bus/selinux.h: Fix prototypes for bus_selinux_allows_acquire_service
and bus_selinux_allows_send

* bus/bus.c (bus_context_check_security_policy): Pass error and
pass on OOM thrown by bus_selinux_allows_send()

* bus/services.c (bus_registry_acquire_service): Pass error and
pass on OOM thrown by bus_selinux_allows_acquire_service()
/external/dbus/bus/services.c
f5cf675641e63cefc36c8a9a7a5872cc8600abcd 21-Jan-2005 Havoc Pennington <hp@redhat.com> 2005-01-20 Havoc Pennington <hp@redhat.com>

* doc/dbus-tutorial.xml: replace > with &gt;

* bus/services.c (bus_registry_acquire_service): validate the name
and return a better error if it's no good.

* doc/dbus-specification.xml: note NO_AUTO_START change

* dbus/dbus-protocol.h (DBUS_HEADER_FLAG_NO_AUTO_START): change
from AUTO_START, we're toggling the default

* bus/dispatch.c: adapt the tests to change of auto-start default
/external/dbus/bus/services.c
8873c90f99303f9cc308f15f8d03e637911f5b9e 18-Jan-2005 Havoc Pennington <hp@redhat.com> 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
/external/dbus/bus/services.c
9c3d566e95c9080f6040c64531b0ccae22bd5d74 15-Jan-2005 Havoc Pennington <hp@redhat.com> 2005-01-15 Havoc Pennington <hp@redhat.com>

* Land the new message args API and type system.

This patch is huge, but the public API change is not
really large. The set of D-BUS types has changed somewhat,
and the arg "getters" are more geared toward language bindings;
they don't make a copy, etc.

There are also some known issues. See these emails for details
on this huge patch:
http://lists.freedesktop.org/archives/dbus/2004-December/001836.html
http://lists.freedesktop.org/archives/dbus/2005-January/001922.html

* dbus/dbus-marshal-*: all the new stuff

* dbus/dbus-message.c: basically rewritten

* dbus/dbus-memory.c (check_guards): with "guards" enabled, init
freed blocks to be all non-nul bytes so using freed memory is less
likely to work right

* dbus/dbus-internals.c (_dbus_test_oom_handling): add
DBUS_FAIL_MALLOC=N environment variable, so you can do
DBUS_FAIL_MALLOC=0 to skip the out-of-memory checking, or
DBUS_FAIL_MALLOC=10 to make it really, really, really slow and
thorough.

* qt/message.cpp: port to the new message args API
(operator<<): use str.utf8() rather than str.unicode()
(pretty sure this is right from the Qt docs?)

* glib/dbus-gvalue.c: port to the new message args API

* bus/dispatch.c, bus/driver.c: port to the new message args API

* dbus/dbus-string.c (_dbus_string_init_const_len): initialize the
"locked" flag to TRUE and align_offset to 0; I guess we never
looked at these anyhow, but seems cleaner.

* dbus/dbus-string.h (_DBUS_STRING_ALLOCATION_PADDING):
move allocation padding macro to this header; use it to implement
(_DBUS_STRING_STATIC): ability to declare a static string.

* dbus/dbus-message.c (_dbus_message_has_type_interface_member):
change to return TRUE if the interface is not set.

* dbus/dbus-string.[hc]: move the D-BUS specific validation stuff
to dbus-marshal-validate.[hc]

* dbus/dbus-marshal-basic.c (_dbus_type_to_string): move here from
dbus-internals.c

* dbus/Makefile.am: cut over from dbus-marshal.[hc]
to dbus-marshal-*.[hc]

* dbus/dbus-object-tree.c (_dbus_decompose_path): move this
function here from dbus-marshal.c
/external/dbus/bus/services.c
935a41a04c3f638134fa905503fc41ddbd18902f 09-Nov-2004 Colin Walters <walters@verbum.org> 2004-11-09 Colin Walters <walters@verbum.org>

* dbus/dbus-string.c (_dbus_string_get_length): New
function, writes DBusString to C buffer.

* dbus/dbus-string.h: Prototype it.

* dbus/dbus-message.c (dbus_message_type_to_string): New
function, converts message type into C string.

* dbus/dbus-message.h: Prototype it.

* bus/selinux.c (bus_selinux_check): Take source pid,
target pid, and audit data. Pass audit data to
avc_has_perm.
(log_audit_callback): New function, appends extra
audit information.
(bus_selinux_allows_acquire_service): Also take
service name, add it to audit data.
(bus_selinux_allows_send): Also take message
type, interface, method member, error name,
and destination, and add them to audit data.
(log_cb): Initialize func_audit.

* bus/selinux.h (bus_selinux_allows_acquire_service)
(bus_selinux_allows_send): Update prototypes

* bus/services.c (bus_registry_acquire_service): Pass
service name to bus_selinux_allows_acquire_service.

* bus/bus.c (bus_context_check_security_policy): Pass
additional audit data. Move assignment of dest
to its own line.
/external/dbus/bus/services.c
cdac3e058b922431f387351fd8ebf60a764485d1 07-Nov-2004 Colin Walters <walters@verbum.org> 2004-11-07 Colin Walters <walters@verbum.org>

* bus/bus.c (load_config): Break into three
separate functions: process_config_first_time_only,
process_config_every_time, and process_config_postinit.
(process_config_every_time): Move call of
bus_registry_set_service_context_table into
process_config_postinit.
(process_config_postinit): New function, does
any processing that needs to happen late
in initialization (and also on reload).
(bus_context_new): Instead of calling load_config,
open config parser here and call process_config_first_time_only
and process_config_every_time directly. Later, after
we have forked but before changing UID,
invoke bus_selinux_full_init, and then call
process_config_postinit.
(bus_context_reload_config): As in bus_context_new,
load parse file inside here, and call process_config_every_time
and process_config_postinit.

* bus/services.h, bus/services.c
(bus_registry_set_service_context_table): Rename
from bus_registry_set_sid_table. Take string hash from config
parser, and convert them here into SIDs.

* bus/config-parser.c (struct BusConfigParser): Have
config parser only store a mapping of service->context
string.
(merge_service_context_hash): New function.
(merge_included): Merge context string hashes instead
of using bus_selinux_id_table_union.
(bus_config_parser_new): Don't use bus_selinux_id_table_new;
simply create a new string hash.
(bus_config_parser_unref): Unref it.
(start_selinux_child): Simply insert strings into hash,
don't call bus_selinux_id_table_copy_over.

* bus/selinux.h, bus/selinux.c (bus_selinux_id_table_union)
(bus_selinux_id_table_copy_over): Delete.
/external/dbus/bus/services.c
e11c966b556e2410d3e7247e44b1079e08574d03 29-Oct-2004 Colin Walters <walters@verbum.org> 2004-10-29 Colin Walters <walters@redhat.com>

Patch from Matthew Rickard <mjricka@epoch.ncsc.mil>

* bus/services.c (bus_registry_acquire_service):
Correctly retrieve service name from DBusString
for printing.
/external/dbus/bus/services.c
85f8f62da6bb26d7033310af9d3260b073efe4bf 24-Sep-2004 Olivier Andrieu <oliv__a@users.sourceforge.net> * doc/dbus-specification.xml: document ServiceOwnerChanged signal.

* bus/driver.c, bus/driver.h, bus/services.c: Use ServiceOwnerChanged
signal instead of ServiceCreated and ServiceDeleted.

* bus/dispatch.c: update testcase for the new signal.
/external/dbus/bus/services.c
43605a6f4e78a8c28afb4b1e924dff0301e0e95c 10-Aug-2004 Havoc Pennington <hp@redhat.com> 2004-08-09 Havoc Pennington <hp@redhat.com>

* COPYING: switch to Academic Free License version 2.1 instead of
2.0, to resolve complaints about patent termination clause.
/external/dbus/bus/services.c
1e9b185b0c274ef0d684b1e43418388225321e72 30-Jul-2004 Havoc Pennington <hp@redhat.com> 2004-07-24 Havoc Pennington <hp@redhat.com>

SELinux support from Matthew Rickard <mjricka@epoch.ncsc.mil>

* bus/selinux.c, bus/selinux.h: new file encapsulating selinux
functionality

* configure.in: add --enable-selinux

* bus/policy.c (bus_policy_merge): add FIXME to a comment

* bus/main.c (main): initialize and shut down selinux

* bus/connection.c: store SELinux ID on each connection, to avoid
repeated getting of the string context and converting it into
an ID

* bus/bus.c (bus_context_get_policy): new accessor, though it
isn't used
(bus_context_check_security_policy): check whether the security
context of sender connection can send to the security context of
recipient connection

* bus/config-parser.c: add parsing for <selinux> and <associate>

* dbus/dbus-transport.c (_dbus_transport_get_unix_fd): to
implement dbus_connection_get_unix_fd()

* dbus/dbus-connection.c (dbus_connection_get_unix_fd): new
function, used by the selinux stuff
/external/dbus/bus/services.c
7eb304c54ee8ea6dfa3775cf89d63c39295747a8 22-Jul-2004 Olivier Andrieu <oliv__a@users.sourceforge.net> 2004-07-22 Olivier Andrieu <oliv__a@users.sourceforge.net>

* dbus/dbus-sysdeps.c (fill_user_info): fix inexistent label name,
breaking build on Solaris, reported by Farhad Saberi on the ML.

* dbus/dbus-message.c (dbus_message_append_args_valist): fix the
va_arg invocation to account for integer promotion in the case of
DBUS_TYPE_BYTE (unsigned char is promoted to int). (bug #901)

* bus/services.c (bus_service_remove_owner): fix bug #902, use
_dbus_list_get_first_link, not _dbus_list_get_first.

* dbus/dbus-bus.c (dbus_bus_service_exists): plug a memory leak.

* dbus/dbus-object-tree.c (free_subtree_recurse): always null
handler functions so that the asserts in _dbus_object_subtree_unref
do not fail.

* dbus/dbus-transport-unix.c (do_reading):
_dbus_transport_queue_messages return value is of type
dbus_bool_t, not DBusDispatchStatus.
/external/dbus/bus/services.c
93f433a17a0aabff91a0384bf9c4f99c9cf30ae1 16-Mar-2004 Richard Hult <richard@imendio.com> 2004-03-16 Richard Hult <richard@imendio.com>

* bus/activation.c: (bus_activation_service_created),
(bus_activation_send_pending_auto_activation_messages),
(bus_activation_activate_service):
* bus/activation.h:
* bus/dispatch.c: (bus_dispatch),
(check_nonexistent_service_auto_activation),
(check_service_auto_activated),
(check_segfault_service_auto_activation),
(check_existent_service_auto_activation), (bus_dispatch_test):
* bus/driver.c: (bus_driver_handle_activate_service):
* bus/services.c: (bus_registry_acquire_service):
* dbus/dbus-message.c: (dbus_message_set_auto_activation),
(dbus_message_get_auto_activation):
* dbus/dbus-message.h:
* dbus/dbus-protocol.h: Implement auto-activation.
/external/dbus/bus/services.c
47d8e53bfeccc6f90475408bfbef9c0132a4122f 24-Feb-2004 Joe Shaw <joeshaw@novell.com> 2004-02-24 Joe Shaw <joe@ximian.com>

* bus/services.c (bus_registry_acquire_service): We need to pass
in the service name to dbus_set_error() to prevent a crash.
/external/dbus/bus/services.c
a1df3040f29223eddaa3ace0fe018fcb28cddcd9 02-Dec-2003 Richard Hult <richard@imendio.com> 2003-12-02 Richard Hult <richard@imendio.com>

* Update AFL version to 2.0 throughout the source files to reflect
the update that was done a while ago.
/external/dbus/bus/services.c
9f1a60dbba69844c0a04b3dd86280352736187ce 27-Nov-2003 Mikael Hallendal <micke@imendio.com> 2003-11-26 Mikael Hallendal <micke@imendio.com>

* bus/*.[ch]:
* dbus/*.[ch]:
* glib/*.[ch]: Made ref functions return the pointer
/external/dbus/bus/services.c
85ab0327d82e4945ad16630e583d8cc68df25a90 08-Sep-2003 Havoc Pennington <hp@redhat.com> 2003-09-07 Havoc Pennington <hp@pobox.com>

* Make Doxygen contented.
/external/dbus/bus/services.c
e8d396efef695b9868b0112c4a6266c97678fa8a 27-Apr-2003 Havoc Pennington <hp@redhat.com> 2003-04-27 Havoc Pennington <hp@pobox.com>

Unbreak my code...

* dbus/dbus-transport.c (_dbus_transport_get_dispatch_status):
report correct status if we finish processing authentication
inside this function.

* bus/activation.c (try_send_activation_failure): use
bus_transaction_send_error_reply

* bus/connection.c (bus_connection_get_groups): return an error
explaining the problem

* bus/bus.c (bus_context_check_security_policy): implement
restriction here that inactive connections can only send the
hello message. Also, allow bus driver to send anything to
any recipient.

* bus/connection.c (bus_connection_complete): create the
BusClientPolicy here instead of on-demand.
(bus_connection_get_policy): don't return an error

* dbus/dbus-message.c (dbus_message_new_error_reply): allow NULL
sender field in message being replied to

* bus/bus.c (bus_context_check_security_policy): fix silly typo
causing it to return FALSE always

* bus/policy.c (bus_client_policy_check_can_send): fix bug where
we checked sender rather than destination
/external/dbus/bus/services.c
b3bd48edfc1aab0a9dc64bfa4c380d845d218e73 26-Apr-2003 Havoc Pennington <hp@redhat.com> 2003-04-25 Havoc Pennington <hp@redhat.com>

test suite is slightly hosed at the moment, will fix soon

* bus/connection.c (bus_connections_expire_incomplete): fix to
properly disable the timeout when required
(bus_connection_set_name): check whether we can remove incomplete
connections timeout after we complete each connection.

* dbus/dbus-mainloop.c (check_timeout): fix this up a bit,
probably still broken.

* bus/services.c (bus_registry_acquire_service): implement max
number of services owned, and honor allow/deny rules on which
services a connection can own.

* bus/connection.c (bus_connection_get_policy): report errors here

* bus/activation.c: implement limit on number of pending
activations
/external/dbus/bus/services.c
6be547d32f018c23ba56426a0bccd08baa2cf440 11-Apr-2003 Havoc Pennington <hp@redhat.com> 2003-04-10 Havoc Pennington <hp@redhat.com>

* dbus/dbus-connection.c (dbus_connection_flush): don't spin on
the connection if it's disconnected

* bus/activation.c (bus_activation_service_created): use new
transaction features to roll back removal of pending activation if
we don't successfully create the service after all. Don't remove
pending activation if the function fails.

* dbus/dbus-list.c (_dbus_list_insert_before_link)
(_dbus_list_insert_after_link): new code to facilitate
services.c fixes

* dbus/dbus-hash.c (_dbus_hash_table_insert_string_preallocated):
new functionality, so we can preallocate the ability to insert
into a hash table.

* bus/connection.c (bus_transaction_add_cancel_hook): new function
allowing us to put custom hooks in a transaction to be used for
cancelling said transaction

* doc/dbus-specification.sgml: add some discussion of secondary
service owners, and disallow zero-length service names

* bus/services.c (bus_registry_acquire_service): new function,
splits out part of bus_driver_handle_acquire_service() and fixes
a bug where we didn't remove the service doing the acquiring
from the secondary queue if we failed to remove the current owner
from the front of the queue.
/external/dbus/bus/services.c
e55fd2c6706e41f6933e1656ac3da7527ee2514f 02-Apr-2003 Havoc Pennington <hp@redhat.com> 2003-04-02 Havoc Pennington <hp@redhat.com>

* bus/connection.c (bus_transaction_send_error_reply): set sender
service for the error, and unref the reply on success

* bus/activation.c: convert to use BusTransaction so OOM can be
handled correctly
(bus_activation_service_created): set sender of the message
/external/dbus/bus/services.c
fa05de9230d62e7c427b5313796fc6ccd4d0ff60 31-Mar-2003 Havoc Pennington <hp@redhat.com> 2003-03-31 Havoc Pennington <hp@redhat.com>

Fix some annoying DBusString API and fix all affected code.

* dbus/dbus-string.c (_dbus_string_init): get rid of annoying
max_length argument
(_dbus_string_get_data): change to return string instead of using
an out param
(_dbus_string_get_const_data): ditto
(_dbus_string_get_data_len): ditto
(_dbus_string_get_const_data_len): ditto
/external/dbus/bus/services.c
90ed1d84588a84697051e643175452c50d682ece 26-Mar-2003 Havoc Pennington <hp@redhat.com> 2003-03-25 Havoc Pennington <hp@redhat.com>

* throughout - add more _DBUS_ASSERT_ERROR_IS_CLEAR

* configure.in: add --with-xml option to specify XML library,
right now only libxml is supported.

* bus/config-loader-libxml.c, config-parser.c: sync some minor
nonworking code between home and work, still just stubs
/external/dbus/bus/services.c
3f4086f0fdd1cc7fc03585ec9f750897fb3c1d55 16-Mar-2003 Anders Carlsson <andersca@codefactory.se> 2003-03-16 Anders Carlsson <andersca@codefactory.se>

* bus/activation.c: (bus_pending_activation_entry_free),
(bus_pending_activation_free), (bus_activation_new),
(bus_activation_unref), (bus_activation_service_created),
(bus_activation_activate_service):
* bus/activation.h:
* bus/bus.c: (bus_context_new):
* bus/desktop-file.c: (new_section):
* bus/driver.c: (bus_driver_send_service_deleted),
(bus_driver_handle_activate_service):
* bus/services.c: (bus_registry_new), (bus_registry_ensure):
* bus/services.h:
* dbus/dbus-connection.c:
(dbus_connection_send_with_reply_and_block):
* dbus/dbus-message.c: (dbus_message_append_args_valist):
* dbus/dbus-protocol.h:
Make activation work better. Now pending activations will be queued
and the daemon won't try to activate services that are already registered.
/external/dbus/bus/services.c
f587ce7845edb0eb01451368d01b5bc86b5904cd 15-Mar-2003 Havoc Pennington <hp@redhat.com> 2003-03-15 Havoc Pennington <hp@pobox.com>

Make it pass the Hello handling test including all OOM codepaths.
Now to do other messages...

* bus/services.c (bus_service_remove_owner): fix crash when
removing owner from an empty list of owners
(bus_registry_ensure): don't leave service in the list of
a connection's owned services if we fail to put the service
in the hash table.

* bus/connection.c (bus_connection_preallocate_oom_error): set
error flag on the OOM error.

* dbus/dbus-connection.c (_dbus_connection_new_for_transport):
handle _dbus_transport_set_connection failure

* dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd): modify
to create watches up front and simply enable/disable them as
needed.
(unix_connection_set): this can now fail on OOM

* dbus/dbus-timeout.c, dbus/dbus-watch.c: add concept
of enabling/disabling a watch or timeout.

* bus/loop.c (bus_loop_iterate): don't touch disabled
watches/timeouts

* glib/dbus-gmain.c: adapt to enable/disable watches and timeouts
/external/dbus/bus/services.c
6ecc14ffabcffb69aa938a67940db48272e05046 13-Mar-2003 Havoc Pennington <hp@redhat.com> 2003-03-12 Havoc Pennington <hp@pobox.com>

Throughout: purge global variables, introduce BusActivation,
BusConnections, BusRegistry, etc. objects instead.

* bus/bus.h, bus/bus.c: introduce BusContext as a global
message bus object

* test/Makefile.am (TEST_BINARIES): disable bus-test for now,
going to redo this a bit differently I think
/external/dbus/bus/services.c
29560adcc79a259a0be3511c056ee7453aa26c04 13-Mar-2003 Havoc Pennington <hp@redhat.com> 2003-03-12 Havoc Pennington <hp@redhat.com>

Mega-patch that gets the message bus daemon initially handling
out-of-memory. Work still needed. Also lots of random
moving stuff to DBusError instead of ResultCode.

* dbus/dbus-list.c (_dbus_list_length_is_one): new function

* dbus/dbus-connection.c
(dbus_connection_send_with_reply_and_block): use DBusError

* dbus/dbus-bus.c: adapt to API changes, make it use DBusError not
DBusResultCode

* dbus/dbus-connection.c (dbus_connection_send): drop the result
code here, as the only failure possible is OOM.

* bus/connection.c (bus_connection_disconnect):
rename bus_connection_disconnected as it's a notification only

* bus/driver.c (bus_driver_handle_acquire_service): don't free
"name" on get_args failure, should be done by get_args;
don't disconnect client for bad args, just return an error.
(bus_driver_handle_service_exists): ditto

* bus/services.c (bus_services_list): NULL-terminate returned array

* bus/driver.c (bus_driver_send_service_lost)
(bus_driver_send_service_acquired): send messages from driver to a
specific client to the client's unique name, not to the broadcast
service.

* dbus/dbus-message.c (decode_header_data): reject messages that
contain no name field
(_dbus_message_get_client_serial): rename to
dbus_message_get_serial and make public
(_dbus_message_set_serial): rename from set_client_serial
(_dbus_message_set_reply_serial): make public
(_dbus_message_get_reply_serial): make public

* bus/connection.c (bus_connection_foreach): allow stopping
iteration by returning FALSE from foreach function.

* dbus/dbus-connection.c (dbus_connection_send_preallocated)
(dbus_connection_free_preallocated_send)
(dbus_connection_preallocate_send): new API for sending a message
without possibility of malloc failure.
(dbus_connection_send_message): rename to just
dbus_connection_send (and same for whole function family)

* dbus/dbus-errors.c (dbus_error_free): make this reinit the error

* dbus/dbus-sysdeps.c (_dbus_exit): new function

* bus/activation.c: handle/return errors

* dbus/dbus-errors.h: add more DBUS_ERROR #define

* dbus/dbus-sysdeps.c (_dbus_directory_open) (_dbus_file_get_contents)
(_dbus_directory_get_next_file): use DBusError instead of DBusResultCode
(_dbus_result_from_errno): move to this file
/external/dbus/bus/services.c
97ee8d189948c9f2c86464ca33f82e6daeaedc72 13-Feb-2003 Anders Carlsson <andersca@codefactory.se> 2003-02-13 Anders Carlsson <andersca@codefactory.se>

* bus/driver.c: (bus_driver_handle_hello):
* bus/driver.h:
* bus/services.c: (bus_service_lookup):
Reorder message sending so we get a more sane order.

* test/bus-test.c: (message_handler):
Fix tyop.
/external/dbus/bus/services.c
ee1133de4dc5e181be5d09f084d8823388d5f693 27-Jan-2003 Anders Carlsson <andersca@codefactory.se> 2003-01-27 Anders Carlsson <andersca@codefactory.se>

* bus/dispatch.c: (bus_dispatch_message_handler):
Dispatch messages sent to services.

* bus/driver.c: (bus_driver_send_service_deleted),
(bus_driver_send_service_created), (bus_driver_send_service_lost),
(bus_driver_send_service_acquired):
Add helper functions for sending service related messages.

(bus_driver_send_welcome_message):
Send HELLO_REPLY instead of WELCOME.

(bus_driver_handle_list_services):
Send LIST_SERVICES_REPLY instead of SERVICES.

(bus_driver_handle_own_service),
(bus_driver_handle_service_exists):
New message handlers.

(bus_driver_handle_message):
Invoke new message handlers.

(bus_driver_remove_connection):
Don't remove any services here since that's done automatically
by bus_service_remove_owner now.

* bus/driver.h:
New function signatures.

* bus/services.c: (bus_service_add_owner):
Send ServiceAcquired message if we're the only primary owner.

(bus_service_remove_owner):
Send ServiceAcquired/ServiceLost messages.

(bus_service_set_prohibit_replacement),
(bus_service_get_prohibit_replacement):
Functions for setting prohibit replacement.

(bus_service_has_owner):
New function that checks if a connection is in the owner queue of
a certain service.

* bus/services.h:
Add new function signatures.

* dbus/dbus-list.c: (_dbus_list_test):
Add tests for _dbus_list_remove_last and traversing the list backwards.

* dbus/dbus-list.h:
Fix a typo in _dbus_list_get_prev_link, if we're at the first element we can't
go any further, so return NULL then.

* dbus/dbus-protocol.h:
Add new messages, service flags and service replies.
/external/dbus/bus/services.c
a16e83f45d33ae5f3bd5966416c57c8ad4448ae8 25-Jan-2003 Anders Carlsson <andersca@codefactory.se> 2003-01-25 Anders Carlsson <andersca@codefactory.se>

* bus/connection.c: (bus_connection_foreach):
* bus/connection.h:
Add new bus_connection_foreach function.

* bus/driver.c: (send_one_message), (bus_driver_broadcast_message):
Add function that broadcasts a message to all clients.

(bus_driver_send_service_created), (bus_driver_handle_hello),
(bus_driver_send_welcome_message),
(bus_driver_handle_list_services), (bus_driver_message_handler):
Implement functions that take care of listing services, and notifying
clients when new services are created.

* bus/services.c: (bus_services_list):
* bus/services.h:
Add new function that returns an array of strings with the currently
registered services.

* glib/dbus-glib.h:
* glib/dbus-gmain.c:
Update copyright year.
/external/dbus/bus/services.c
aff24a72c18a43dbb6f2d85e6d2226a3c2ea8f10 21-Jan-2003 Anders Carlsson <andersca@codefactory.se> 2003-01-21 Anders Carlsson <andersca@codefactory.se>

* bus/Makefile.am:
Add driver.[ch]

* bus/connection.c: (connection_disconnect_handler):
Remove the connection from the bus driver's list.

(connection_watch_callback): Dispatch messages.

(free_connection_data): Free connection name.

(bus_connection_setup): Add connection to the bus driver's list.
(bus_connection_remove_owned_service):
(bus_connection_set_name), (bus_connection_get_name):
Add functions for setting and getting the connection's name.

* bus/connection.h:
Add function headers.

* bus/driver.c: (create_unique_client_name),
(bus_driver_handle_hello_message),
(bus_driver_send_welcome_message), (bus_driver_message_handler),
(bus_driver_add_connection), (bus_driver_remove_connection):
* bus/driver.h:
* bus/main.c:
* bus/services.c: (bus_service_free):
* bus/services.h:
New file that handles communication and registreation with the bus
itself.
/external/dbus/bus/services.c
96a9f80300b7794475a5451a60a07555ea3526be 06-Jan-2003 Havoc Pennington <hp@redhat.com> 2003-01-05 Havoc Pennington <hp@pobox.com>

* bus/connection.c: implement routines for handling connections,
first thing is keeping a list of owned services on each connection
and setting up watches etc.

* bus/services.c: implement a mapping from service names to lists
of connections

* dbus/dbus-hash.c: add DBUS_HASH_POINTER

* dbus/dbus-threads.c (dbus_static_mutex_lock): add functions
to use static mutexes for global data

* dbus/dbus-connection.c (dbus_connection_set_data): add new
collection of functions to set/get application-specific data
on the DBusConnection.
/external/dbus/bus/services.c