1. 09 Sep, 2004 1 commit
  2. 25 Aug, 2004 1 commit
    • John Palmieri's avatar
      Console user security policy · b78d2220
      John Palmieri authored
      * bus/config-parser.c:
      (struct PolicyType): Add POLICY_CONSOLE
      (struct Element.d.policy): s/gid_or_uid/gid_uid_or_at_console
      (start_busconfig_child): Sets up console element when
      <policy at_console=""> is encountered in a policy file
      (append_rule_from_element): Convert console elements to console
      rules.
      
      * bus/policy.c:
      (bus_policy_create_client_policy): Add console rules to the client
      policy based on if the client is at the console
      (bus_policy_append_console_rule): New function for adding a
      console rule to a policy
      (bus_policy_merge): Handle console rule merging
      
      * dbus/dbus-sysdeps.h: Added the DBUS_CONSOLE_DIR constant
      where we check for console user files
      
      * dbus/dbus-sysdeps.c:
      (_dbus_file_exists): New function which checks if the given
      file exists
      (_dbus_user_at_console): New function which does the system
      specific process of checking if the user is at the console
      
      * dbus/dbus-userdb.c:
      (_dbus_is_console_user): New function converts a UID to user name
      and then calls the system specific _dbus_user_at_console to
      see if the user is at the console and therefor a console user
      b78d2220
  3. 10 Aug, 2004 1 commit
  4. 28 May, 2004 1 commit
    • Havoc Pennington's avatar
      2004-05-28 Havoc Pennington <hp@redhat.com> · fbae5baa
      Havoc Pennington authored
      	* test/glib/test-service-glib.c (main): remove unused variable
      
      	* glib/dbus-gidl.c (base_info_ref): fix a silly compiler warning
      
      	* dbus/dbus-auth.h (enum): remove AUTHENTICATED_WITH_UNUSED_BYTES
      	from the enum, no longer in use.
      
      	* dbus/dbus-sysdeps.h: include config.h so DBUS_VA_COPY actually
      	works right.
      
      	* dbus/dbus-message.c: add various _dbus_return_val_if_fail for
      	whether error_name passed in is a valid error name.
      fbae5baa
  5. 12 Mar, 2004 1 commit
    • 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
  6. 05 Mar, 2004 1 commit
    • David Zeuthen's avatar
      2004-03-01 David Zeuthen <david@fubar.dk> · 868dd4b4
      David Zeuthen authored
      	* dbus/dbus-string.c (_dbus_string_append_printf_valist): Fix a
      	bug where args were used twice. This bug resulted in a segfault
      	on a Debian/PPC system when starting the messagebus daemon. Include
      	dbus-sysdeps.h for DBUS_VA_COPY
      
      	* dbus/dbus-sysdeps.h: Define DBUS_VA_COPY if neccessary. From GLib
      
      	* configure.in: Check for va_copy; define DBUS_VA_COPY to the
      	appropriate va_copy implementation. From GLib
      868dd4b4
  7. 02 Dec, 2003 1 commit
  8. 07 Sep, 2003 1 commit
  9. 12 Aug, 2003 1 commit
    • Havoc Pennington's avatar
      2003-08-12 Havoc Pennington <hp@pobox.com> · 1d1b0f20
      Havoc Pennington authored
      	* bus/dispatch.c (bus_dispatch): make this return proper
      	DBusHandlerResult to avoid DBUS_ERROR_UNKNOWN_METHOD
      
      	* dbus/dbus-errors.c (dbus_set_error): use
      	_dbus_string_append_printf_valist
      
      	* dbus/dbus-string.c (_dbus_string_append_printf_valist)
      	(_dbus_string_append_printf): new
      
      	* dbus/dbus-errors.h (DBUS_ERROR_UNKNOWN_MESSAGE): change to
      	UNKNOWN_METHOD
      
      	* dbus/dbus-connection.c (dbus_connection_dispatch): handle
      	DBUS_HANDLER_RESULT_NEED_MEMORY; send default error reply if a
      	message is unhandled.
      1d1b0f20
  10. 04 Jun, 2003 1 commit
    • Havoc Pennington's avatar
      2003-06-04 Havoc Pennington <hp@pobox.com> · a70b042f
      Havoc Pennington authored
      	* dbus/dbus-server.c (dbus_server_listen): allow abstract sockets
      	using unix:abstract=/foo, and when listening in a tmpdir
      	i.e. unix:tmpdir=/tmp, always use abstract sockets if we can.
      
      	* dbus/dbus-transport.c (_dbus_transport_open): support
      	unix:abstract=/foo
      
      	* dbus/dbus-server-unix.c (_dbus_server_new_for_domain_socket):
      	support abstract sockets
      
      	* dbus/dbus-transport-unix.c
      	(_dbus_transport_new_for_domain_socket): support abstract sockets
      
      	* dbus/dbus-sysdeps.c (_dbus_connect_unix_socket): add "abstract"
      	toggle as an argument, implement abstract namespace support
      	(_dbus_listen_unix_socket): ditto
      
      	* configure.in: add --enable-abstract-sockets and implement
      	a configure check for autodetection of the right value.
      a70b042f
  11. 12 May, 2003 1 commit
    • Havoc Pennington's avatar
      2003-05-11 Havoc Pennington <hp@pobox.com> · d4e80132
      Havoc Pennington authored
      	* dbus/dbus-marshal.c (_dbus_marshal_validate_arg): fix to avoid
      	calling _dbus_marshal_validate_arg() for every byte in a byte
      	array, etc.
      
      	* dbus/dbus-message-handler.c: use atomic reference counting to
      	reduce number of locks slightly; the global lock in here sucks
      
      	* dbus/dbus-connection.c
      	(_dbus_connection_update_dispatch_status_and_unlock): variant of
      	update_dispatch_status that can be called with lock held; then use
      	in a couple places to reduce locking/unlocking
      	(dbus_connection_send): hold the lock over the whole function
      	instead of acquiring it twice.
      
      	* dbus/dbus-timeout.c (_dbus_timeout_new): handle OOM
      
      	* bus/connection.c (bus_connections_setup_connection): fix access
      	to already-freed memory.
      
      	* dbus/dbus-connection.c: keep a little cache of linked list
      	nodes, to avoid using the global linked list alloc lock in the
      	normal send-message case. Instead we just use the connection lock
      	that we already have to take.
      
      	* dbus/dbus-list.c (_dbus_list_find_last): new function
      
      	* dbus/dbus-sysdeps.c (_dbus_atomic_inc, _dbus_atomic_dec):
      	change to use a struct for the atomic type; fix docs,
      	they return value before increment, not after increment.
      
      	* dbus/dbus-string.c (_dbus_string_append_4_aligned)
      	(_dbus_string_append_8_aligned): new functions to try to
      	microoptimize this operation.
      	(reallocate_for_length): break this out of set_length(), to
      	improve profile info, and also so we can consider inlining the
      	set_length() part.
      
      	* dbus/dbus-message.c (dbus_message_new_empty_header): init data
      	strings with some preallocation, cuts down on our calls to realloc
      	a fair bit. Though if we can get the "move entire string to empty
      	string" optimization below to kick in here, it would be better.
      
      	* dbus/dbus-string.c (_dbus_string_move): just call
      	_dbus_string_move_len
      	(_dbus_string_move_len): add a special case for moving
      	an entire string into an empty string; we can just
      	swap the string data instead of doing any reallocs.
      	(_dbus_string_init_preallocated): new function
      d4e80132
  12. 11 May, 2003 1 commit
    • Havoc Pennington's avatar
      2003-05-11 Havoc Pennington <hp@pobox.com> · ab10ae90
      Havoc Pennington authored
      	Write a "test-profile" that does echo client-server with threads;
      	profile reveals lock contention, memcpy/realloc of buffers, and
      	UTF-8 validation as hot spots. 20% of lock contention eliminated
      	with dbus_atomic_inc/dec implementation on x86.  Much remaining
      	contention is global mempool locks for GList and DBusList.
      
      	* dbus/dbus-sysdeps.c (_dbus_atomic_inc, _dbus_atomic_dec): add
      	x86 implementation
      
      	* dbus/dbus-connection.c (struct DBusConnection): use
      	dbus_atomic_t for the reference count
      
      	* dbus/dbus-message.c (struct DBusMessage): declare
      	dbus_atomic_t values as volatile
      
      	* configure.in: code to detect ability to use atomic integer
      	operations in assembly, from GLib patch
      
      	* dbus/dbus-internals.c (_dbus_verbose_real): call getpid every
      	time, tired of it being wrong in threads and forked processes
      
      	* glib/test-profile.c: a little program to bounce messages back
      	and forth between threads and eat CPU
      
      	* dbus/dbus-connection.c: add debug spew macros for debugging
      	thread locks; include config.h at top; fix deadlock in
      	dbus_connection_flush()
      ab10ae90
  13. 17 Apr, 2003 1 commit
  14. 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
  15. 13 Apr, 2003 2 commits
    • Havoc Pennington's avatar
      2003-04-13 Havoc Pennington <hp@pobox.com> · 8aabca8d
      Havoc Pennington authored
      	* bus/config-parser.c: Load up the BusPolicy and BusPolicyRules
      
      	* dbus/dbus-sysdeps.c (_dbus_get_user_id): new function
      
      	* bus/policy.c (bus_policy_append_mandatory_rule)
      	(bus_policy_append_default_rule, bus_policy_append_user_rule)
      	(bus_policy_append_group_rule): new functions
      8aabca8d
    • Havoc Pennington's avatar
      2003-04-12 Havoc Pennington <hp@pobox.com> · b09b7ca3
      Havoc Pennington authored
      	* bus/config-parser.c (bus_config_parser_new): fix a memleak
      
      	* dbus/dbus-sysdeps.c: change DBusCredentials to use longs for
      	the pid/gid/uid, just for paranoia.
      
      	* test/break-loader.c (randomly_do_n_things): find a byte
      	containing a type code, and randomly change it to a different
      	type code.
      b09b7ca3
  16. 06 Apr, 2003 2 commits
    • 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> · 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
  17. 05 Apr, 2003 1 commit
    • Havoc Pennington's avatar
      2003-04-04 Havoc Pennington <hp@redhat.com> · 03b9ca6d
      Havoc Pennington authored
      	* dbus/dbus-spawn.c, dbus/dbus-spawn.h: Change dbus_spawn to
      	return a "babysitter" object that is used to monitor the status of
      	the spawned process and reap it when required.
      
      	* test/test-segfault.c, test/test-exit.c,
      	test/test-sleep-forever.c: binaries that do various lame things,
      	used in the test suite.
      
      	* dbus/dbus-sysdeps.c: kill _dbus_errno_to_string()
      03b9ca6d
  18. 04 Apr, 2003 1 commit
  19. 02 Apr, 2003 1 commit
    • Havoc Pennington's avatar
      2003-04-02 Havoc Pennington <hp@redhat.com> · 94790fef
      Havoc Pennington authored
      	* dbus/dbus-sysdeps.c (_dbus_file_get_contents): include filenames
      	in error messages
      	(_dbus_string_get_dirname): new
      	(_dbus_sysdeps_test): new
      	(_dbus_directory_open): include dirnames in error messages
      
      	* bus/config-parser.c: interpret <include> and <includedir> and
      	<servicedir> relative to config file location if the given
      	filename is not absolute.
      
      	* dbus/dbus-string.c (_dbus_string_find_byte_backward): new
      94790fef
  20. 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
  21. 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
  22. 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
  23. 15 Mar, 2003 2 commits
    • Havoc Pennington's avatar
      2003-03-15 Havoc Pennington <hp@pobox.com> · f05f87a8
      Havoc Pennington authored
      	* bus/dispatch.c (bus_dispatch_test): OK, now finally actually
      	write useful test code, after all that futzing around ;-)
      
      	Test does not yet pass because we can't handle OOM in
      	_dbus_transport_messages_pending (basically,
      	dbus_connection_preallocate_send() does not prealloc the write
      	watch). To fix this, I think we need to add new stuff to
      	set_watch_functions, namely a SetEnabled function so we can alloc
      	the watch earlier, then enable it later.
      
      	* dbus/Makefile.am (libdbus_convenience_la_SOURCES): move
      	dbus-memory.c to the convenience lib
      
      	* bus/test.c: rename some static functions to keep them clearly
      	distinct from stuff in connection.c. Handle client disconnection.
      f05f87a8
    • Havoc Pennington's avatar
      2003-03-14 Havoc Pennington <hp@pobox.com> · 169238e9
      Havoc Pennington authored
      	* bus/dispatch.c (bus_dispatch_test): do test using debug-pipe
      	transport, tests more of the real codepath. Set up clients
      	with bus_setup_debug_client.
      
      	* bus/test.c (bus_setup_debug_client): function to set up debug
      	"clients" on the main loop
      
      	* dbus/dbus-transport.c (_dbus_transport_open): add debug-pipe
      	support
      
      	* dbus/dbus-server.c (dbus_server_listen): add debug-pipe
      	server type
      
      	* dbus/dbus-server-debug.c: support a debug server based on pipes
      
      	* dbus/dbus-sysdeps.c (_dbus_full_duplex_pipe): new function
      	(_dbus_close): new function
      
      	* configure.in: check for socketpair
      169238e9
  24. 13 Mar, 2003 1 commit
    • Havoc Pennington's avatar
      2003-03-12 Havoc Pennington <hp@redhat.com> · 29560adc
      Havoc Pennington authored
              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
      29560adc
  25. 24 Feb, 2003 1 commit
    • Havoc Pennington's avatar
      2003-02-23 Havoc Pennington <hp@pobox.com> · 2f38c959
      Havoc Pennington authored
      	* dbus/dbus-keyring.c: finish most of this implementation and
      	simple unit test
      
      	* dbus/dbus-errors.c (dbus_set_error_const, dbus_set_error): make
      	these barf if the error isn't cleared to NULL
      
      	* dbus/dbus-sysdeps.c (_dbus_delete_file): set error on failure
      	(_dbus_create_directory): new function
      
      	* dbus/dbus-errors.c (dbus_set_error): fix warning
      
      	* dbus/dbus-string.c (_dbus_string_hex_encode): new function
      	(_dbus_string_hex_decode): new function
      	(test_hex_roundtrip): test code
      
      	* dbus/dbus-sha.c (_dbus_sha_compute): use dbus_string_hex_encode
      
      	* dbus/dbus-md5.c (_dbus_md5_compute): use dbus_string_hex_encode
      
      	* dbus/dbus-sysdeps.c (_dbus_string_save_to_file): make this use
      	the save-to-temp/rename trick to atomically write the new file
      	(_dbus_string_parse_uint): new function
      2f38c959
  26. 20 Feb, 2003 1 commit
    • Havoc Pennington's avatar
      2003-02-19 Havoc Pennington <hp@pobox.com> · 6b40feaf
      Havoc Pennington authored
      	* Doxyfile.in (PREDEFINED): put DOXYGEN_SHOULD_SKIP_THIS in
      	Doxyfile.in, not Doxyfile
      
      	* dbus/dbus-keyring.c: do some hacking on this
      
      	* dbus/dbus-sysdeps.c (_dbus_delete_file): new
      
      	* dbus/dbus-errors.c (dbus_set_error_const): do not call
      	dbus_error_init
      	(dbus_set_error): remove dbus_error_init, check for message ==
      	NULL *before* we sprintf into it, and add @todo about including
      	system headers in this file
      
      	* dbus/dbus-sysdeps.c (_dbus_create_file_exclusively): new
      
      	* dbus/dbus-errors.h (DBUS_ERROR_FAILED): add
      
      	* dbus/dbus-sysdeps.c (get_user_info): break this function out to
      	get various bits of user information based on either username
      	or user ID
      	(_dbus_homedir_from_username): new function
      6b40feaf
  27. 19 Feb, 2003 1 commit
    • Mikael Hallendal's avatar
      2003-02-19 Mikael Hallendal <micke@codefactory.se> · 6180d695
      Mikael Hallendal authored
      	* dbus/dbus-server.c (dbus_server_listen): Support tcp: addresses.
      
      	* dbus/dbus-transport-unix.c (_dbus_transport_new_for_tcp_socket):
      	Added to create a transport connecting using a tcp/ip socket.
      
      	* dbus/dbus-sysdeps.c (_dbus_connect_tcp_socket): Added to connect
      	to a tcp socket at given host and port.
      	(_dbus_listen_tcp_socket): added to listen on tcp socket for given
      	hostname and port.
      
      	* dbus/dbus-server.c (dbus_server_listen): Support tcp: addresses.
      
      	* dbus/dbus-server-unix.c (_dbus_server_new_for_tcp_socket):
      	Added to create a server listening on a TCP/IP socket.
      6180d695
  28. 17 Feb, 2003 1 commit
    • Anders Carlsson's avatar
      2003-02-17 Anders Carlsson <andersca@codefactory.se> · 3c8db267
      Anders Carlsson authored
      	* bus/activation.c: (bus_activation_init), (child_setup),
      	(bus_activation_activate_service):
      	* bus/activation.h:
      	* bus/main.c: (main):
      	Set DBUS_ADDRESS environment variable.
      
      	* dbus/dbus-errors.c: (dbus_set_error):
      	Don't use va_copy since that's a C99 feature.
      
      	* dbus/dbus-sysdeps.c: (_dbus_setenv), (do_exec),
      	(_dbus_spawn_async):
      	* dbus/dbus-sysdeps.h:
      	Add child_setup_func to _dbus_spawn_async.
      
      	* doc/dbus-specification.sgml:
      	Update specification.
      
      	* test/spawn-test.c: (setup_func), (main):
      	Fix test.
      3c8db267
  29. 16 Feb, 2003 2 commits
  30. 15 Feb, 2003 2 commits
    • Anders Carlsson's avatar
      2003-02-15 Anders Carlsson <andersca@codefactory.se> · 2aa38be2
      Anders Carlsson authored
      	* dbus/dbus-errors.c: (dbus_set_error):
      	* dbus/dbus-errors.h:
      	Add a few errors and make dbus_set_error void.
      
      	* dbus/dbus-sysdeps.c:
      	(_dbus_errno_to_string), (close_and_invalidate), (make_pipe),
      	(write_err_and_exit), (read_ints), (do_exec), (_dbus_spawn_async):
      	* dbus/dbus-sysdeps.h:
      	Add _dbus_spawn_async.
      
      	* test/spawn-test.c: (main):
      	Test for _dbus_spawn_async.
      2aa38be2
    • Alexander Larsson's avatar
      2003-02-15 Alexander Larsson <alexl@redhat.com> · fe401894
      Alexander Larsson authored
      	* dbus/dbus-threads.c:
      	* dbus/dbus-threads.h:
      	Add condvars. Remove static mutext from API.
      	Implement static mutexes by initializing them from threads_init.
      
      	* glib/dbus-gthread.c:
      	* qt/dbus-qthread.cpp:
      	Update with the thread api changes.
      
      
      	* dbus/dbus-list.c:
      	* dbus/dbus-list.h:
      	Turn StaticMutex into normal mutex + init function.
      	Export new functions _dbus_list_alloc_link, _dbus_list_free_link,
      	_dbus_list_append_link, _dbus_list_prepend_link
      
      
      	* dbus/dbus-sysdeps.c:
      	* dbus/dbus-sysdeps.h:
      	New type dbus_atomic_t, and new functions _dbus_atomic_inc,
      	_dbus_atomic_dec. Only slow fallback implementation at the moment.
      
      	* dbus/dbus-protocol.h:
      	Add DBUS_MESSAGE_LOCAL_DISCONNECT define
      
      	* dbus/dbus-message.c:
      	Make ref/unref atomic.
      	Fix some docs.
      
      	* dbus/dbus-connection-internal.h:
      	* dbus/dbus-connection.c:
      	* dbus/dbus-connection.h:
      	Make threadsafe.
      	Change _peek to _borrow,_return & _steal_borrowed.
      	Change disconnect callback to event.
      	Make dbus_connection_dispatch_messages reentrant.
      
      	* dbus/dbus-transport.c:
      	Don't ref the connection on calls to the transport
      	implementation.
      
      	* dbus/dbus-message-handler.c:
      	Make threadsafe.
      
      	* glib/dbus-gmain.c:
      	Don't use peek_message anymore
      
      	* test/Makefile.am:
      	* test/debug-thread.c:
      	* test/debug-thread.h:
      	Simple thread implementation that asserts() on deadlocks in
      	single-threaded code.
      
      	* test/bus-test.c:
      	(main) Call debug_threads_init.
      
      	* test/watch.c:
      	Use disconnect message instead of disconnect callback.
      
      	* bus/connection.c:
      	* bus/connection.h:
      	Don't call dbus_connection_set_disconnect_function. Instead export
      	bus_connection_disconnect.
      
      	* bus/dispatch.c:
      	Call bus_connection_disconnect when we get a disconnected message.
      fe401894
  31. 05 Feb, 2003 1 commit
    • Havoc Pennington's avatar
      2003-02-02 Havoc Pennington <hp@pobox.com> · a07bc460
      Havoc Pennington authored
      	* dbus/dbus-keyring.c, dbus/dbus-keyring.h: template files
      	for code to manage cookies in your home directory
      
      	* dbus/dbus-sysdeps.c (_dbus_generate_random_bytes): new function
      
      	* dbus/dbus-auth.c (get_state): impose a maximum number of tries
      	to authenticate, then disconnect the client.
      a07bc460
  32. 01 Feb, 2003 1 commit
    • Havoc Pennington's avatar
      2003-02-01 Havoc Pennington <hp@pobox.com> · e0ffb6eb
      Havoc Pennington authored
      	* dbus/dbus-break-loader.c (main): new program to find messages
      	that break the loader.
      
      	* dbus/dbus-sysdeps.c (_dbus_string_append_uint): new function
      	* dbus/dbus-sysdeps.c (_dbus_string_save_to_file): new function
      
      	* dbus/dbus-string.c (_dbus_string_set_byte): new
      e0ffb6eb
  33. 28 Jan, 2003 1 commit
    • Havoc Pennington's avatar
      2003-01-27 Havoc Pennington <hp@pobox.com> · 05a4ad69
      Havoc Pennington authored
      	* dbus/dbus-mempool.c (time_for_size): replace printf with
      	_dbus_verbose
      
      	* dbus/dbus-message-builder.c (_dbus_message_data_load): allow
      	empty lines; fix the SAVE_LENGTH stuff to be
      	START_LENGTH/END_LENGTH so it actually works; couple other
      	bugfixes
      
      	* test/Makefile.am (dist-hook): add dist-hook for .message files
      
      	* dbus/dbus-string.c (DBUS_STRING_COPY_PREAMBLE): source of a copy
      	can be constant or locked.
      	(_dbus_string_free): allow freeing a const string as
      	documented/intended
      
      	* dbus/dbus-sysdeps.c (_dbus_concat_dir_and_file): utility
      
      	* dbus/dbus-test-main.c (main): take an argument which is the
      	directory containing test data
      
      	* dbus/dbus-message.c (_dbus_message_test): pass a test_data_dir
      	argument to this and load all the messages in test/data/
      	checking that they can be loaded or not loaded as appropriate.
      05a4ad69
  34. 26 Jan, 2003 1 commit
    • Havoc Pennington's avatar
      2003-01-26 Havoc Pennington <hp@pobox.com> · 9a0b07f2
      Havoc Pennington authored
      	* dbus/dbus-sysdeps.c (_dbus_file_get_contents): new function
      
      	* dbus/dbus-errors.c (dbus_result_to_string): add
      	file errors
      
      	* dbus/dbus-message-builder.c: new file, will contain code to load
      	up messages from files. Not implemented yet.
      9a0b07f2
  35. 22 Jan, 2003 1 commit
    • Havoc Pennington's avatar
      2003-01-21 Havoc Pennington <hp@pobox.com> · d6d50a29
      Havoc Pennington authored
              (patch untested because can't compile)
      
      	* bus/driver.c (create_unique_client_name): make this function
      	never recycle client names. Also, caller should initialize
      	the DBusString.
      
      	* dbus/dbus-sysdeps.c (_dbus_get_current_time): new function
      d6d50a29