1. 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
  2. 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
  3. 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
  4. 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
  5. 11 Apr, 2003 1 commit
  6. 09 Apr, 2003 1 commit
  7. 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
  8. 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
  9. 04 Apr, 2003 1 commit
  10. 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
  11. 02 Apr, 2003 1 commit
  12. 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
  13. 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
  14. 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
  15. 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
  16. 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
  17. 21 Mar, 2003 1 commit
  18. 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
  19. 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
  20. 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
  21. 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
  22. 13 Mar, 2003 1 commit
    • Havoc Pennington's avatar
      2003-03-12 Havoc Pennington <hp@pobox.com> · 6ecc14ff
      Havoc Pennington authored
      	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
      6ecc14ff