1. 21 Sep, 2003 1 commit
    • Havoc Pennington's avatar
      2003-09-21 Havoc Pennington <hp@pobox.com> · a683a80c
      Havoc Pennington authored
      	Get matching rules mostly working in the bus; only actually
      	parsing the rule text remains. However, the client side of
      	"signal connections" hasn't been started, this patch is only the
      	bus side.
      
      	* dbus/dispatch.c: fix for the matching rules changes
      
      	* bus/driver.c (bus_driver_handle_remove_match)
      	(bus_driver_handle_add_match): send an ack reply from these
      	method calls
      
      	* glib/dbus-gproxy.c (dbus_gproxy_begin_call): fix order of
      	arguments, reported by Seth Nickell
      
      	* bus/config-parser.c (append_rule_from_element): support
      	eavesdrop=true|false attribute on policies so match rules
      	can be prevented from snooping on the system bus.
      
      	* bus/dbus-daemon-1.1.in: consistently use terminology "sender"
      	and "destination" in attribute names; fix some docs bugs;
      	add eavesdrop=true|false attribute
      
      	* bus/driver.c (bus_driver_handle_add_match)
      	(bus_driver_handle_remove_match): handle AddMatch, RemoveMatch
      	messages
      
      	* dbus/dbus-protocol.h (DBUS_SERVICE_ORG_FREEDESKTOP_BROADCAST): get
      	rid of broadcast service concept, signals are just always broadcast
      
      	* bus/signals.c, bus/dispatch.c, bus/connection.c, bus/bus.c:
      	mostly implement matching rules stuff (currently only exposed as signal
      	connections)
      a683a80c
  2. 18 Aug, 2003 2 commits
    • Havoc Pennington's avatar
      2003-08-18 Havoc Pennington <hp@redhat.com> · 68a3c593
      Havoc Pennington authored
      	* dbus/dbus-hash.c (_dbus_hash_table_insert_two_strings): fix
      
      	* dbus/dbus-message.c (_dbus_message_loader_queue_messages): fix
      	dumb bug created earlier (wrong order of args to
      	decode_header_data())
      
      	* tools/dbus-send.c: port
      
      	* tools/dbus-print-message.c (print_message): port
      
              * test/data/*messages: port all messages over
      
              * dbus/dbus-message-builder.c: support including
      	message type
      
              * bus/driver.c: port over
      
      	* bus/dispatch.c: port over to new stuff
      
      	* dbus/dbus-connection.c (_dbus_connection_new_for_transport):
      	rename disconnect signal to "Disconnected"
      68a3c593
    • Havoc Pennington's avatar
      2003-08-17 Havoc Pennington <hp@pobox.com> · 95717a93
      Havoc Pennington authored
      	This doesn't compile yet, but syncing up so I can hack on it from
      	work. What are branches for if not broken code? ;-)
      
      	* dbus/dbus-protocol.h: remove DBUS_HEADER_FIELD_NAME, add
      	DBUS_HEADER_FIELD_INTERFACE, DBUS_HEADER_FIELD_MEMBER,
      	DBUS_HEADER_FIELD_ERROR_NAME
      
      	* dbus/dbus-hash.c: Introduce DBUS_HASH_TWO_STRINGS as hack to use
      	for the interface+member pairs
      	(string_hash): change to use g_str_hash algorithm
      	(find_direct_function, find_string_function): refactor these to
      	share most code.
      
      	* dbus/dbus-message.c: port all of this over to support
      	interface/member fields instead of name field
      
      	* dbus/dbus-object-registry.c: port over
      
      	* dbus/dbus-string.c (_dbus_string_validate_interface): rename
      	from _dbus_string_validate_name
      
      	* bus/dbus-daemon-1.1: change file format for the
      	<deny>/<allow> stuff to match new message naming scheme
      
      	* bus/policy.c: port over
      
      	* bus/config-parser.c: parse new format
      95717a93
  3. 22 Jun, 2003 1 commit
    • Havoc Pennington's avatar
      2003-06-22 Havoc Pennington <hp@pobox.com> · 6843ad31
      Havoc Pennington authored
      	* dbus/dbus-dataslot.c (_dbus_data_slot_allocator_unref)
      	(_dbus_data_slot_allocator_alloc): rework these to keep a
      	reference count on each slot and automatically manage a global
      	slot ID variable passed in by address
      
      	* bus/bus.c: convert to new dataslot API
      
      	* dbus/dbus-bus.c: convert to new dataslot API
      
      	* dbus/dbus-connection.c: convert to new dataslot API
      
      	* dbus/dbus-server.c: convert to new dataslot API
      
      	* glib/dbus-gmain.c: ditto
      
      	* bus/test.c: ditto
      
      	* bus/connection.c: ditto
      6843ad31
  4. 16 May, 2003 1 commit
    • Havoc Pennington's avatar
      2003-05-16 Havoc Pennington <hp@redhat.com> · 306eab3e
      Havoc Pennington authored
      	* dbus/dbus-connection.c: disable verbose lock spew
      
      	* tools/dbus-send.c: add --print-reply command line option
      
      	* tools/dbus-print-message.h (print_message): new util function
      	shared by dbus-send and dbus-monitor
      
      	* tools/dbus-monitor.c (handler_func): exit on disconnect
      
      	* dbus/dbus-transport-unix.c (do_reading): if the transport is
      	disconnected, don't try to use the read_watch
      
      	* dbus/dbus-watch.c (dbus_watch_get_enabled): assert watch != NULL
      	so we can find this bug more easily
      306eab3e
  5. 04 May, 2003 1 commit
  6. 28 Apr, 2003 1 commit
    • Havoc Pennington's avatar
      2003-04-28 Havoc Pennington <hp@redhat.com> · 893d859e
      Havoc Pennington authored
      	* configure.in: 0.10
      
      	* NEWS: update
      
      	* bus/system.conf.in: add <includedir>system.d</includedir>
      
      	* dbus/dbus-userdb.c (_dbus_user_database_lookup): fix bug when
      	username was provided but not uid
      
      	* bus/config-parser.c (struct BusConfigParser): keep track of
      	whether the parser is toplevel or was included; change some
      	of the error handling if it's included.
      893d859e
  7. 27 Apr, 2003 1 commit
    • Havoc Pennington's avatar
      2003-04-27 Havoc Pennington <hp@pobox.com> · e8d396ef
      Havoc Pennington authored
      	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
      e8d396ef
  8. 25 Apr, 2003 1 commit
    • Havoc Pennington's avatar
      2003-04-25 Havoc Pennington <hp@redhat.com> · b3bd48ed
      Havoc Pennington authored
              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
      b3bd48ed
  9. 24 Apr, 2003 2 commits
  10. 19 Apr, 2003 1 commit
    • Havoc Pennington's avatar
      2003-04-19 Havoc Pennington <hp@pobox.com> · 983200f9
      Havoc Pennington authored
      	* bus/driver.c (bus_driver_handle_hello): check limits and
      	return an error if they are exceeded.
      
      	* bus/connection.c: maintain separate lists of active and inactive
      	connections, and a count of each. Maintain count of completed
      	connections per user. Implement code to check connection limits.
      
      	* dbus/dbus-list.c (_dbus_list_unlink): export
      
      	* bus/bus.c (bus_context_check_security_policy): enforce a maximum
      	number of bytes in the message queue for a connection
      983200f9
  11. 18 Apr, 2003 1 commit
    • Havoc Pennington's avatar
      2003-04-18 Havoc Pennington <hp@pobox.com> · 3df260c0
      Havoc Pennington authored
      	* glib/dbus-gmain.c: adapt to watch changes
      
      	* bus/bus.c, bus/activation.c, etc.: adjust to watch changes
      
      	* dbus/dbus-server.h: remove dbus_server_handle_watch
      
      	* dbus/dbus-connection.h: remove dbus_connection_handle_watch
      
      	* dbus/dbus-watch.c (dbus_watch_handle): change DBusWatch to work
      	like DBusTimeout, so we don't need dbus_connection_handle_watch
      	etc.
      3df260c0
  12. 17 Apr, 2003 1 commit
    • Havoc Pennington's avatar
      2003-04-15 Havoc Pennington <hp@pobox.com> · 7c022a80
      Havoc Pennington authored
      	* bus/bus.c: create and keep around a shared DBusUserDatabase
      	object.
      
      	* bus/connection.c (bus_connection_get_groups): don't cache
      	groups for user in the connection object, since user database
      	object now does that.
      7c022a80
  13. 14 Apr, 2003 1 commit
    • Havoc Pennington's avatar
      2003-04-13 Havoc Pennington <hp@pobox.com> · 777707ed
      Havoc Pennington authored
      	* dbus/dbus-mainloop.c: fix some reentrancy issues by refcounting
      	callbacks
      
      	* test/data/valid-config-files/debug-allow-all.conf.in: allow all
      	users
      
      	* dbus/dbus-transport.c (_dbus_transport_get_dispatch_status):
      	fix to only recover unused bytes if we're already authenticated
      	(_dbus_transport_get_is_authenticated): fix to still mark us
      	authenticated if there are unused bytes.
      
      	* bus/dispatch.c: implement security policy checking
      
      	* bus/connection.c (bus_transaction_send_from_driver): new
      
      	* bus/bus.c (bus_context_check_security_policy): new
      
      	* bus/dispatch.c (send_service_nonexistent_error): delete this,
      	now we just set the DBusError and it gets converted to an error
      	reply.
      
      	* bus/connection.c (allow_user_function): enable code using actual
      	data from the config file
      
      	* bus/policy.c (list_allows_user): handle wildcard rules for
      	user/group connection perms
      777707ed
  14. 12 Apr, 2003 1 commit
    • Havoc Pennington's avatar
      2003-04-12 Havoc Pennington <hp@pobox.com> · bc983ecf
      Havoc Pennington authored
      	* bus/policy.h: change BusPolicy to be the thing from the config
      	file, and rename old BusPolicy to BusClientPolicy
      
      	* bus/bus.c, bus/connection.c, bus/config-parser.c: change to
      	match change in how policy works
      
      	* dbus/dbus-internals.h: mark assert_not_reached as
      	__attribute((noreturn))__
      bc983ecf
  15. 11 Apr, 2003 1 commit
  16. 09 Apr, 2003 1 commit
  17. 06 Apr, 2003 4 commits
    • Havoc Pennington's avatar
      2003-04-06 Havoc Pennington <hp@pobox.com> · df008ef9
      Havoc Pennington authored
      	* dbus/Makefile.am: split lists of sources into stuff that goes in
      	the library, util functions that go in the lib and are also used
      	elsewhere, and util functions that are used in tests/daemon but
      	don't go in the lib.
      
      	* dbus/dbus-mainloop.h, dbus/dbus-mainloop.c: move bus/loop.[hc]
      	here so it can be used in test binaries also
      df008ef9
    • Havoc Pennington's avatar
      2003-04-06 Havoc Pennington <hp@pobox.com> · 856361ff
      Havoc Pennington authored
      	* dbus/dbus-sysdeps.c (_dbus_become_daemon): write the pidfile
      	here in the parent process, so we can return an error if it
      	fails. Also, move some of the code into the child so the parent
      	is less hosed if we fail midway through.
      
      	* bus/bus.c (bus_context_new): move pidfile detection further up
      	in the function, before we start overwriting sockets and such.
      
      	* bus/messagebus.in: adjust this a bit, not sure if it will work.
      
      	* configure.in: add --with-system-pid-file and --with-system-socket
      
      2003-04-06  Colin Walters  <walters@verbum.org>
      
      	* configure.in (DBUS_SYSTEM_PID_FILE): New variable.
      
      	* bus/system.conf.in: Declare a pidfile.
      
      	* bus/bus.c (bus_context_new): Test for an existing pid file, and
      	create one (if appropriate).
      
      	* bus/config-parser.c (enum ElementType) [ELEMENT_PIDFILE]: New.
      	(struct BusConfigParser) [pidfile]: New.
      	(element_type_to_name, merge_included, start_busconfig_child)
      	(bus_config_parser_end_element, bus_config_parser_content): Handle it.
      	(bus_config_parser_unref): Free it.
      	(bus_config_parser_get_pidfile): New function.
      
      	* bus/config-parser.h (_dbus_write_pid_file): Prototype.
      
      	* dbus/dbus-errors.h (DBUS_ERROR_PIDFILE_EXISTS): New error.
      
      	* dbus/dbus-sysdeps.c (_dbus_write_pid_file): New function.
      
      	* dbus/dbus-sysdeps.h: Prototype it.
      856361ff
    • Havoc Pennington's avatar
      2003-04-06 Havoc Pennington <hp@pobox.com> · c8991b0f
      Havoc Pennington authored
      	* bus/bus.c (bus_context_new): print the address in here, rather
      	than in main(), because we need to do it before forking the daemon
      
      	* bus/dispatch.c (send_service_nonexistent_error): set the sender
      	on the service nonexistent error
      
      	* bus/driver.c (bus_driver_handle_acquire_service): set the
      	sender on the AcquireService reply
      
      	* test/data/valid-config-files/debug-allow-all.conf.in: Make test
      	server also listen on a UNIX socket so services can connect to it.
      c8991b0f
    • Havoc Pennington's avatar
      2003-04-06 Havoc Pennington <hp@pobox.com> · e45e4382
      Havoc Pennington authored
      	* bus/bus.c (bus_context_new): fix wrong handling of
      	server_data_slot_unref() in the error case.
      
      	* dbus/dbus-internals.h (_dbus_assert): change so it passes
      	"(condition) != 0" to _dbus_real_assert so that
      	"_dbus_assert (pointer)" doesn't cause a warning
      
      	* bus/main.c (main): accept --print-address option to print out
      	the message bus address
      
      	* dbus/dbus-sysdeps.c (_dbus_generate_random_ascii): export this
      
      	* dbus/dbus-transport.c (_dbus_transport_open): special error for
      	"tmpdir" option to unix: address on client side
      
      	* dbus/dbus-server.c (dbus_server_listen): handle "tmpdir" option
      	to unix: address
      
      	* configure.in (TEST_SOCKET_DIR): locate a temporary directory
      	we can use to create sockets in the test suite.
      
      	* bus/main.c (signal_handler): on SIGTERM, exit the daemon
      	cleanly. To be used for testing.
      
      	* dbus/dbus-spawn.c (babysit): use _dbus_set_signal_handler()
      
      	* dbus/dbus-sysdeps.c (_dbus_set_signal_handler): new
      
      	* dbus/dbus-server-debug-pipe.c (_dbus_transport_debug_pipe_new):
      	handle trying to call this when there's no servers active
      e45e4382
  18. 05 Apr, 2003 2 commits
    • Havoc Pennington's avatar
      2003-04-05 Havoc Pennington <hp@pobox.com> · 07e3f76f
      Havoc Pennington authored
      	* bus/bus.c (setup_server): fix this so dbus-daemon-1 doesn't
      	crash on startup. Need to get "try starting the daemon"
      	in the test suite I guess. ;-)
      
      	* dbus/dbus-server.h, dbus/dbus-server.c: remove the stuff that
      	tracked the number of open connections; it's better done in
      	application-specific code as you want it to span all servers etc.
      07e3f76f
    • Havoc Pennington's avatar
      2003-04-05 Havoc Pennington <hp@pobox.com> · 2250539a
      Havoc Pennington authored
      	* bus/loop.c (bus_loop_iterate): fix the timeout code, using
      	magic from GLib
      
      	* dbus/dbus-spawn.c (_dbus_babysitter_unref): set sitter_pid
      	to -1 once we've reaped the babysitter
      	(_dbus_babysitter_handle_watch): do as much work as we can, not
      	just one go of it
      
      	* bus/activation.c: add code using DBusBabysitter so that we
      	handle it when a service fails to start up properly.
      	(bus_activation_service_created): don't remove the activation
      	entries as we go, just let them get removed when we free the pending
      	activation. Unref reply messages after sending them.
      2250539a
  19. 04 Apr, 2003 1 commit
  20. 03 Apr, 2003 1 commit
    • Havoc Pennington's avatar
      2003-04-03 Havoc Pennington <hp@pobox.com> · eeb88949
      Havoc Pennington authored
      	* bus/config-parser.c (bus_config_parser_unref): free
      	list of mechanisms, bug discovered by test suite enhancements
      	(putting system.conf and session.conf into suite)
      
      	* test/Makefile.am, test/test-service.c: add placeholder for a
      	test service that we'll activate as part of test suite. Doesn't
      	do anything yet.
      
      	* dbus/dbus-sysdeps.c (_dbus_setenv): support unsetenv by
      	setting NULL value, and use system malloc not dbus_malloc()
      	when we have unavoidable memleakage.
      
      	* dbus/dbus-bus.c (dbus_bus_get): fix bug where bus type of 0
      	didn't work, and support DBUS_BUS_ACTIVATION.
      
      	* bus/activation.c (child_setup): pass our well-known bus type to
      	the child
      
      	* bus/config-parser.c: support <type> to specify well-known type
      
      	* doc/dbus-specification.sgml: document the env variables to
      	locate well-known buses and find service activator
      eeb88949
  21. 02 Apr, 2003 1 commit
  22. 01 Apr, 2003 1 commit
    • Havoc Pennington's avatar
      2003-04-01 Havoc Pennington <hp@pobox.com> · 44ed9332
      Havoc Pennington authored
      	* dbus/dbus-server.c (dbus_server_set_auth_mechanisms): new
      	function
      
      	* dbus/dbus-auth.c (_dbus_auth_set_mechanisms): new
      
      	* dbus/dbus-internals.c (_dbus_dup_string_array): new function
      
      	* dbus/dbus-sysdeps.c (_dbus_listen_unix_socket): chmod the
      	socket 0777, and unlink any existing socket.
      
      	* bus/bus.c (bus_context_new): change our UID/GID and fork if
      	the configuration file so specifies; set up auth mechanism
      	restrictions
      
      	* bus/config-parser.c (bus_config_parser_content): add support
      	for <fork> option and fill in code for <auth>
      
      	* bus/system.conf.in: add <fork/> to default configuration,
      	and limit auth mechanisms to EXTERNAL
      
      	* doc/config-file.txt (Elements): add <fork>
      
      	* dbus/dbus-sysdeps.c (_dbus_become_daemon): new function
      	(_dbus_change_identity): new function
      44ed9332
  23. 31 Mar, 2003 2 commits
    • Havoc Pennington's avatar
      2003-03-31 Havoc Pennington <hp@redhat.com> · fa05de92
      Havoc Pennington authored
              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
      fa05de92
    • Havoc Pennington's avatar
      2003-03-31 Havoc Pennington <hp@pobox.com> · 29c71168
      Havoc Pennington authored
      	* dbus/dbus-transport-unix.c (_dbus_transport_new_for_domain_socket)
      	(_dbus_transport_new_for_tcp_socket): these didn't need the "server"
      	argument since they are always client side
      
      	* dbus/dbus-server.c (dbus_server_get_address): new function
      
      	* bus/main.c (main): take the configuration file as an argument.
      
      	* test/data/valid-config-files/debug-allow-all.conf: new file to
      	use with dispatch.c tests for example
      
      	* bus/test-main.c (main): require test data dir
      
      	* bus/bus.c (bus_context_new): change this to take a
      	configuration file name as argument
      
      	* doc/config-file.txt (Elements): add <servicedir>
      
      	* bus/system.conf, bus/session.conf: new files
      
      	* dbus/dbus-bus.c (dbus_bus_get): look for system bus on
      	well-known socket if none set
      
      	* configure.in: create system.conf and session.conf
      29c71168
  24. 26 Mar, 2003 1 commit
    • Havoc Pennington's avatar
      2003-03-25 Havoc Pennington <hp@redhat.com> · 90ed1d84
      Havoc Pennington authored
              * 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
      90ed1d84
  25. 25 Mar, 2003 1 commit
    • Havoc Pennington's avatar
      2003-03-24 Havoc Pennington <hp@redhat.com> · ce4fd314
      Havoc Pennington authored
      	* dbus/dbus-sysdeps.c (_dbus_set_fd_nonblocking): move to this
      	file
      
      	* dbus/dbus-errors.c (dbus_set_error, dbus_set_error_const): allow
      	NULL argument for "message" if the error is a well-known one,
      	fill in a generic message in this case.
      
      	* dbus/dbus-errors.h (DBusResultCode): Kill DBusResultCode in
      	favor of DBusError
      
      	* bus/test.c (bus_test_flush_bus): add
      
      	* bus/policy.c (bus_policy_test): test code stub
      ce4fd314
  26. 23 Mar, 2003 1 commit
    • Havoc Pennington's avatar
      2003-03-23 Havoc Pennington <hp@pobox.com> · a26607ab
      Havoc Pennington authored
      	* bus/policy.c, bus/bus.c, bus/connection.c: implement allow/deny
      	policies code
      
      	* dbus/dbus-hash.h: add ULONG hash keys
      
      	* dbus/dbus-sysdeps.c (_dbus_get_groups): new
      	(_dbus_get_group_id): new function
      a26607ab
  27. 21 Mar, 2003 1 commit
  28. 17 Mar, 2003 1 commit
    • Havoc Pennington's avatar
      2003-03-16 Havoc Pennington <hp@pobox.com> · b4a1100f
      Havoc Pennington authored
      	* dbus/dbus-watch.c (_dbus_watch_new): handle failure to malloc
      	the watch
      
      	* dbus/dbus-server-debug-pipe.c (_dbus_transport_debug_pipe_new):
      	add some missing dbus_set_result
      
      	* bus/dispatch.c (bus_dispatch_add_connection): handle failure to
      	alloc the DBusMessageHandler
      
      	* dbus/dbus-transport.c (_dbus_transport_disconnect): don't ref
      	the transport here, since we call this from the finalizer; it
      	resulted in a double-finalize.
      
      	* dbus/dbus-transport.c (_dbus_transport_disconnect): fix a bug
      	where we tried to use transport->connection that was NULL,
      	happened when transport was disconnected early on due to OOM
      
      	* bus/*.c: adapt to handle OOM for watches/timeouts
      
      	* dbus/dbus-transport-unix.c: port to handle OOM during
      	watch handling
      
      	* dbus/dbus-auth.c (_dbus_auth_get_unused_bytes): return a
      	reference to unused bytes instead of a copy
      
      	* dbus/dbus-server.c (dbus_server_handle_watch): return FALSE for
      	out of memory
      
      	* dbus/dbus-connection.c (dbus_connection_handle_watch): return
      	FALSE on OOM
      
      	* dbus/dbus-timeout.c (dbus_timeout_handle): return FALSE for out
      	of memory
      b4a1100f
  29. 16 Mar, 2003 2 commits
    • Anders Carlsson's avatar
      2003-03-16 Anders Carlsson <andersca@codefactory.se> · 3f4086f0
      Anders Carlsson authored
      	* 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.
      3f4086f0
    • Havoc Pennington's avatar
      2003-03-16 Havoc Pennington <hp@pobox.com> · ce173b29
      Havoc Pennington authored
      	Oops - test code was only testing failure of around 30 of the
      	mallocs in the test path, but it turns out there are 500+
      	mallocs. I believe this was due to misguided linking setup such
      	that there was one copy of dbus_malloc etc. in the daemon and one
      	in the shared lib, and only daemon mallocs were tested. In any
      	case, the test case now tests all 500+ mallocs, and doesn't pass
      	yet, though there are lots of fixes in this patch.
      
      	* dbus/dbus-connection.c (dbus_connection_dispatch_message): fix
      	this so that it doesn't need to allocate memory, since it
      	has no way of indicating failure due to OOM (and would be
      	annoying if it did).
      
      	* dbus/dbus-list.c (_dbus_list_pop_first_link): new function
      
      	* bus/Makefile.am: rearrange to create two self-contained
      	libraries, to avoid having libraries with overlapping symbols.
      	that was resulting in weirdness, e.g. I'm pretty sure there
      	were two copies of global static variables.
      
      	* dbus/dbus-internals.c: move the malloc debug stuff to
      	dbus-memory.c
      
      	* dbus/dbus-list.c (free_link): free list mempool if it becomes
      	empty.
      
      	* dbus/dbus-memory.c (_dbus_disable_mem_pools): new function
      
      	* dbus/dbus-address.c (dbus_parse_address): free list nodes
      	on failure.
      
      	* bus/dispatch.c (bus_dispatch_add_connection): free
      	message_handler_slot when no longer using it, so
      	memory leak checkers are happy for the test suite.
      
      	* dbus/dbus-server-debug-pipe.c (debug_finalize): free server name
      
      	* bus/bus.c (new_connection_callback): disconnect in here if
      	bus_connections_setup_connection fails.
      
      	* bus/connection.c (bus_connections_unref): fix to free the
      	connections
      	(bus_connections_setup_connection): if this fails, don't
      	disconnect the connection, just be sure there are no side
      	effects.
      
      	* dbus/dbus-string.c (undo_alignment): unbreak this
      
      	* dbus/dbus-auth.c (_dbus_auth_unref): free some stuff we were
      	leaking
      	(_dbus_auth_new): fix the order in which we free strings
      	on OOM failure
      
      	* bus/connection.c (bus_connection_disconnected): fix to
      	not send ServiceDeleted multiple times in case of memory
      	allocation failure
      
      	* dbus/dbus-bus.c (dbus_bus_get_base_service): new function to
      	get the base service name
      	(dbus_bus_register_client): don't return base service name,
      	instead store it on the DBusConnection and have an accessor
      	function for it.
      	(dbus_bus_register_client): rename dbus_bus_register()
      
      	* bus/dispatch.c (check_hello_message): verify that other
      	connections on the bus also got the correct results, not
      	just the one sending hello
      ce173b29
  30. 15 Mar, 2003 2 commits
    • Havoc Pennington's avatar
      2003-03-15 Havoc Pennington <hp@pobox.com> · f587ce78
      Havoc Pennington authored
      	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
      f587ce78
    • Havoc Pennington's avatar
      2003-03-14 Havoc Pennington <hp@redhat.com> · 4c95a978
      Havoc Pennington authored
      	* dbus/dbus-memory.c: add a "detect buffer overwrites on free"
      	cheesy hack
      
      	* dbus/dbus-transport-debug.c: rework this a good bit to be
      	less complicated. hopefully still works.
      
      	* dbus/dbus-server-debug.c (handle_new_client): remove timeout
      	manually
      
      	* glib/dbus-gmain.c (timeout_handler): don't remove timeout
      	after running it
      
      	* dbus/dbus-message.c (dbus_message_copy): rename from
      	dbus_message_new_from_message, fix it up to copy
      	all the message fields, add test case
      
      	* bus/dispatch.c (bus_dispatch_test): add some more test code,
      	not quite passing yet
      4c95a978
  31. 14 Mar, 2003 1 commit
    • Havoc Pennington's avatar
      2003-03-13 Havoc Pennington <hp@redhat.com> · 3bea9353
      Havoc Pennington authored
      	* dbus/dbus-timeout.c (_dbus_timeout_list_set_functions): handle
      	out of memory
      
      	* dbus/dbus-watch.c (_dbus_watch_list_set_functions): handle out
      	of memory
      
      	* dbus/dbus-connection.h: Make AddWatchFunction and
      	AddTimeoutFunction return a bool so they can fail on out-of-memory
      
      	* bus/bus.c (bus_context_new): set up timeout handlers
      
      	* bus/connection.c (bus_connections_setup_connection): set up
      	timeout handlers
      
      	* glib/dbus-gmain.c: adapt to the fact that set_functions stuff
      	can fail
      
      	* bus/bus.c (bus_context_new): adapt to changes
      
      	* bus/connection.c: adapt to changes
      
      	* test/watch.c: adapt to DBusWatch changes
      
      	* bus/dispatch.c (bus_dispatch_test): started adding this but
      	didn't finish
      3bea9353