1. 19 Mar, 2010 2 commits
    • Marcus Brinkmann's avatar
    • Will Thompson's avatar
      Dispatch post-activation messages to anyone interested · 6663cb5d
      Will Thompson authored
      Previously, if a method call activated a service, it would only be
      delivered to that service, and not to other services with match rules
      which should match. This patch replaces the improperly-duplicated
      dispatch code in activation.c with a call back into the normal dispatch
      code, fixing this bug (fd.o#26427).
      
      (Additionally, were one to service-activate a service that doesn't
      understand file descriptors with a message containing a file descriptor,
      the previous code would send it anyway, and the service's dbus library
      would blow up. This is also fixed here, since the normal dispatch code
      checks this correctly.)
      6663cb5d
  2. 28 Jan, 2010 2 commits
    • Colin Walters's avatar
      Don't drop pending activations when reloading configuration · b93476ce
      Colin Walters authored
      The reload handling for activation simply dropped all knowledge
      of pending activations, which was clearly wrong.  Refactor things
      so that reload only reloads directories, server address etc.
      
      Based on a patch originally from Matthias Clasen <mclasen@redhat.com>
      b93476ce
    • Colin Walters's avatar
      Ignore exit code zero from activated services · b7e77c6b
      Colin Walters authored
      A variety of system components have migrated from legacy init into DBus
      service activation.  Many of these system components "daemonize", which
      involves forking.  The DBus activation system treated an exit as an
      activation failure, assuming that the child process which grabbed the
      DBus name didn't run first.
      
      While we're in here, also differentiate in this code path between the
      servicehelper (system) versus direct activation (session) paths.  In
      the session activation path our error message mentioned a helper
      process which was confusing, since none was involved.
      
      Based on a patch and debugging research from Ray Strode <rstrode@redhat.com>
      b7e77c6b
  3. 15 Dec, 2009 1 commit
    • Colin Walters's avatar
      Ignore exit code zero from activated services · 949a64b1
      Colin Walters authored
      A variety of system components have migrated from legacy init into DBus
      service activation.  Many of these system components "daemonize", which
      involves forking.  The DBus activation system treated an exit as an
      activation failure, assuming that the child process which grabbed the
      DBus name didn't run first.
      
      While we're in here, also differentiate in this code path between the
      servicehelper (system) versus direct activation (session) paths.  In
      the session activation path our error message mentioned a helper
      process which was confusing, since none was involved.
      
      Based on a patch and debugging research from Ray Strode <rstrode@redhat.com>
      949a64b1
  4. 14 Jul, 2009 1 commit
  5. 10 Jul, 2009 1 commit
  6. 06 Jan, 2009 2 commits
  7. 15 Jul, 2008 1 commit
  8. 12 Jul, 2008 1 commit
    • Ray Strode's avatar
      Store what environment to activate with on activation object · 91306ef9
      Ray Strode authored
      We now keep the environment in a hash table member of the
      activation object and provide a method
      bus_activation_set_environment_variable to modify the
      hash table.  This hash table is seeded initially with the
      environment of the bus daemon itself.
      91306ef9
  9. 26 Jul, 2007 1 commit
    • Havoc Pennington's avatar
      2007-07-26 Havoc Pennington <hp@redhat.com> · bdbab121
      Havoc Pennington authored
      	* bus/config-parser-trivial.c (check_return_values): disable a
      	test that hardcoded the bus user's name
      
      	* bus/dispatch.c (bus_dispatch_test_conf): remove the "if
      	(!use_launcher)" around the tests, they were only failing because
      	we didn't pass through all the expected errors from the helper.
      
      	* bus/activation-exit-codes.h
      	(BUS_SPAWN_EXIT_CODE_CHILD_SIGNALED): add a code for child segfaulting
      	(BUS_SPAWN_EXIT_CODE_GENERIC_FAILURE): make "1" be a generic
      	failure code, so if a third party launch helper were written it
      	could just always return 1 on failure.
      bdbab121
  10. 24 Jul, 2007 5 commits
    • Havoc Pennington's avatar
      2007-07-24 Havoc Pennington <hp@redhat.com> · 79d3004e
      Havoc Pennington authored
      	* configure.in: add AM_PROG_CC_C_O to allow per-target CPPFLAGS
      
      	* bus/dispatch.c (bus_dispatch_test_conf): Fix up setting
      	TEST_LAUNCH_HELPER_CONFIG to include the full path, and enable
      	test shell_fail_service_auto_start when use_launcher==TRUE
      
      	* bus/activation-helper-bin.c (convert_error_to_exit_code): pass
      	through the INVALID_ARGS error so the test suite works
      
      	* bus/activation.c (handle_activation_exit_error): return
      	DBUS_ERROR_NO_MEMORY if we get BUS_SPAWN_EXIT_CODE_NO_MEMORY
      
      	* dbus/dbus-spawn.c (_dbus_babysitter_get_child_exit_status):
      	return only the exit code of the child, not the entire thingy from
      	waitpid(), and make the return value indicate whether the child
      	exited normally (with a status code)
      
      	* bus/bus.c (process_config_first_time_only): _dbus_strdup works
      	on NULL so no need to check
      	(process_config_every_time): move servicehelper init here, so we
      	reload it on HUP or config file change
      
      	* bus/Makefile.am (install-data-hook): remove comment because
      	Emacs make mode seems to be grumpy about it
      79d3004e
    • Richard Hughes's avatar
      2007-07-24 Richard Hughes <richard@hughsie.com> · 60e764bc
      Richard Hughes authored
      * bus/activation.c: (bus_activation_activate_service):
      If the bus uses a service-laucher, then use the setuid laucher.
      60e764bc
    • Richard Hughes's avatar
      2007-07-24 Richard Hughes <richard@hughsie.com> · ea3bdfba
      Richard Hughes authored
      * bus/activation.c: (handle_activation_exit_error),
      (babysitter_watch_callback):
      Map the child exit status integer to a proper dbus error.
      ea3bdfba
    • Richard Hughes's avatar
      2007-07-24 Richard Hughes <richard@hughsie.com> · 153a2aed
      Richard Hughes authored
      * bus/activation.c: (bus_activation_entry_unref),
      (update_desktop_file_entry):
      Add the concept of, and read the value of user from the desktop file.
      The user string is not required unless we are using system activation.
      153a2aed
    • Richard Hughes's avatar
      2007-07-24 Richard Hughes <richard@hughsie.com> · 74e1b986
      Richard Hughes authored
      * bus/activation.c:
      * bus/desktop-file.h:
      Move the defines into the header file, as we use these in the lauch
      helper as well as the desktop file parsing.
      74e1b986
  11. 14 Jul, 2007 1 commit
  12. 15 Jun, 2007 1 commit
    • Havoc Pennington's avatar
      2007-06-15 Havoc Pennington <hp@redhat.com> · 43b944a0
      Havoc Pennington authored
      	* dbus/dbus-sysdeps.c (_dbus_set_errno_to_zero)
      	(_dbus_get_is_errno_nonzero, _dbus_get_is_errno_eintr)
      	(_dbus_strerror_from_errno): family of functions to abstract
      	errno, though these are somewhat bogus (really we should make our
      	socket wrappers not use errno probably - the issue is that any
      	usage of errno that isn't socket-related probably is not
      	cross-platform, so should either be in a unix-only file that can
      	use errno directly, or is a bug - these general errno wrappers
      	hide issues of this nature in non-socket code, while
      	socket-specific API changes would not since sockets are allowed
      	cross-platform)
      43b944a0
  13. 07 Mar, 2007 1 commit
  14. 04 Mar, 2007 1 commit
  15. 03 Nov, 2006 1 commit
  16. 11 Sep, 2006 2 commits
  17. 06 Sep, 2006 1 commit
  18. 10 Aug, 2006 1 commit
    • John Palmieri's avatar
      * dbus/dbus-sysdeps.c: · 2974c824
      John Palmieri authored
      * dbus/dbus-address.c:
      * bus/activation.c:
      * test/shell-test.c:
        don't hardcode tmp directory (patch from Dave Meikle
        <dmk at davemeikle dot co dot uk>)
      2974c824
  19. 08 Aug, 2006 1 commit
    • John Palmieri's avatar
      These are all patches from Kjartan Maraas <kmaraas at gnome dot org> · 9a3145b9
      John Palmieri authored
      with cleanups of bugs found from Coverity reports:
      
      * dbus/dbus-sysdeps-util.c (_dbus_write_pid_file):
        close the file on error to avoid a leak
      
      * bus/expirelist.c (bus_expire_list_test):
        Check for NULL on dbus_new0
      
      * bus/activation.c (update_directory):
        remove dead code
      
      * bus/config-parser.c (merge_service_context_hash, start_selinux_child):
        Fix some leaks
      
      * bus/bus.c (process_config_every_time):
        Fixed a leak
      
      * bus/desktop-file.c (parse_key_value):
        Fixed leak
      
      * bus/selinux.c (bus_selinux_id_table_insert):
        Fixed leak
      9a3145b9
  20. 14 Jul, 2006 1 commit
    • John Palmieri's avatar
      * bus/activation.[ch] (bus_activation_list_services): new function to · 7628b541
      John Palmieri authored
        get the list of services that can be activated
      
      * bus/dispatch.c: test coverage for the new bus method
        ListActivatableNames
      
      * bus/driver.c: new bus method ListActivatableNames to get the list of
        services that can be activated
      
      * doc/dbus-specification.xml: ListActivatableNames method documentation
      7628b541
  21. 22 Nov, 2005 1 commit
    • John Palmieri's avatar
      * configure.in: Add test/name-test/Makefile to the generated · 1a163e76
      John Palmieri authored
      	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
      1a163e76
  22. 06 Sep, 2005 1 commit
    • John Palmieri's avatar
      * Released 0.50 · bc564a69
      John Palmieri authored
      * Patch from Steve Grubb:
      - bus/activation.c (bus_activation_service_reload_test): clean up
      some indentation
      - dbus/dbus-keyring.c (_dbus_keyring_reload): fix conditional
      - dbus/dbus-message-factory.c (generate_special): fix a couple of
      buffer overflows in the test suite.  This is non critical because
      it can not be exploited and this code is only run when doing a
      make check.
      
      * Patch from Yaakov Selkowitz: Build fixes for Cygwin
      - configure.in: Don't check and link against kdecore, only qt headers
      - dbus/Makefile.am: Add -no-undefined to libdbus_1_la_LDFLAGS
      - gcj/org/freedesktop/dbus/Makefile.am:
      add libdbus_gcj_1_la_LDFLAGS = -no-undefined
      - glib/Makefile.am: Add -no-undefined to libdbus_glib_1_la_LDFLAGS
      and $(DBUS_GLIB_LIBS) to dbus_binding_tool_LDADD
      - qt/Makefile.am: Add -no-undefined to libdbus_qt_1_la_LDFLAGS
      - tools/Makefile.am: Add platform extentions to binaries
      (i.e. .exe on windows)
      
      * configure.in:
      - Make it so if no suitable version of python is found we only
      disable building python instead of exiting the configure script
      - Require version 2.4 of glib for glib bindings
      - Up version to 0.50
      
      * python/__init__.py: Sync version with libdbus to (0,50,0)
      bc564a69
  23. 14 Jul, 2005 1 commit
    • John Palmieri's avatar
      Checking in Rodrigo's patch along with my fixes to the patch · 075945f6
      John Palmieri authored
      2005-07-14  John (J5) Palmieri  <johnp@redhat.com>
      
      	* bus/activation.c: clean up all tabs to be 8 spaces
      	(bus_activation_activate_service): make sure we clean up
      	if activation fails
      
      	* bus/dispatch.c: clean up all tabs to be 8 spaces
      	(check_shell_fail_service_auto_start): New function
      	tests to make sure we get fail properly when trying to auto start a service
      	with a faulty command line
      	(check_shell_service_success_auto_start): New function tests to make sure
      	auto started services get the arguments on the command line
      
      	* test/test-shell-service.c: Added service for testing auto-starting with
      	command line arguments
      
      	* test/data/valid-service-files/debug-shell-echo-fail.service.in,
      	test/data/valid-service-files/debug-shell-echo-success.service.in:
      	Added service files for testing auto-starting with command line arguments
      
      	* */.cvsignore: added a bunch of generated files to various .cvsignore files
      
      2005-07-14  Rodrigo Moya  <rodrigo@novell.com>
      
      	* dbus/dbus-shell.[ch]: copy/pasted code from GLib.
      
      	* dbus/Makefile.am: added new files to build.
      
      	* bus/activation.c (bus_activation_activate_service): support
      	activation commands with parameters.
      
      	* test/shell-test.c: added test program for the shell parsing
      	code.
      075945f6
  24. 18 Jan, 2005 1 commit
    • Havoc Pennington's avatar
      2005-01-18 Havoc Pennington <hp@redhat.com> · 8873c90f
      Havoc Pennington authored
              * 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
      8873c90f
  25. 15 Jan, 2005 1 commit
    • Havoc Pennington's avatar
      2005-01-15 Havoc Pennington <hp@redhat.com> · 9c3d566e
      Havoc Pennington authored
      	* 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
      9c3d566e
  26. 10 Aug, 2004 1 commit
  27. 29 Jul, 2004 1 commit
    • Olivier Andrieu's avatar
      * bus/config-loader-libxml.c: complete the implementation of libxml · 4076d31c
      Olivier Andrieu authored
      backend for config file loader. Doesn't work with full OOM test yet.
      
      * configure.in: change error when selecting libxml into a warning.
      
      * test/data/invalid-config-files: add two non-well-formed XML files.
      
      * glib/Makefile.am: libdbus_gtool always uses expat, not libxml.
      
      * dbus/dbus-transport-unix.c (unix_handle_watch): do not disconnect in
      case of DBUS_WATCH_HANGUP, several do_reading() may be necessary to
      read all the buffer. (bug #894)
      
      * bus/activation.c (bus_activation_activate_service): fix a potential
      assertion failure (bug #896). Small optimization in the case of
      auto-activation messages.
      
      * dbus/dbus-message.c (verify_test_message, _dbus_message_test): add
      test case for byte-through-vararg bug (#901). patch by Kimmo
      Hämäläinen.
      4076d31c
  28. 16 Mar, 2004 1 commit
    • Richard Hult's avatar
      2004-03-16 Richard Hult <richard@imendio.com> · 93f433a1
      Richard Hult authored
      	* 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.
      93f433a1
  29. 12 Mar, 2004 2 commits
    • Mikael Hallendal's avatar
      2004-03-12 Mikael Hallendal <micke@imendio.com> · 520bdf70
      Mikael Hallendal authored
      	* bus/activation.c:
      	(babysitter_watch_callback): notify all pending activations waiting for
      	  the same exec that the activation failed.
      	(bus_activation_activate_service): shortcut the activation if we
      	  already waiting for the same executable to start up.
      520bdf70
    • Mikael Hallendal's avatar
      2004-03-12 Mikael Hallendal <micke@imendio.com> · dd79fc73
      Mikael Hallendal authored
      	* bus/activation.c:
      	- Added service file reloading.
      	  Each service files directory is kept in an hash table in
      	  BusActivation and each BusActivationEntry knows what .service-file it
      	  was read from. So when you try to activate a service the bus will
      	  check if it's been updated, removed or if new .service-files has
      	  been installed.
      	- Test code at the bottom for the service file reloading.
      	* bus/test-main.c: (main):
      	* bus/test.h:
      	- added service reloading test.
      	* dbus/dbus-sysdeps.c:
      	* dbus/dbus-sysdeps.h: (_dbus_delete_directory): Added.
      dd79fc73
  30. 02 Dec, 2003 1 commit
  31. 27 Nov, 2003 1 commit