Commit graph

210 commits

Author SHA1 Message Date
Havoc Pennington
6c241c1035 2003-04-08 Havoc Pennington <hp@redhat.com>
* bus/driver.c (bus_driver_handle_acquire_service): init
	retval/reply before checking name

	* dbus/dbus-marshal.c (_dbus_marshal_validate_arg): add a
	recursion depth argument

	* dbus/dbus-message.h (struct DBusMessageIter): put some padding
	in the public struct for future extension

	* dbus/dbus-message-builder.c (_dbus_message_data_load): fix
	typo

	* dbus/dbus-marshal.c (_dbus_marshal_validate_arg): fix a verbose
	message

	* doc/dbus-specification.sgml: fix typo
2003-04-08 20:16:03 +00:00
Alexander Larsson
c5020ac870 2003-04-08 Alexander Larsson <alexl@redhat.com>
Implemented recursive types, named types and new-style iters

	* bus/driver.c:
	* glib/test-thread-client.c: (thread_func):
	* glib/test-thread-server.c: (handle_test_message):
	* test/test-service.c: (handle_echo):
	Update to new api

	* dbus/Makefile.am:
	* dbus/dbus-dict.c:
	* dbus/dbus-dict.h:
	* dbus/dbus.h
	Remove DBusDict

	* dbus/dbus-internals.c: (_dbus_type_to_string):
	Update for new types.

	* dbus/dbus-marshal.[ch]:
	Implement recursive types and the new marshalling format.
	Remove hardcoded dict marshalling.
	Marshal named types.

	* dbus/dbus-message-builder.c:
	Add BYTE_ARRAY.
	Remove references to old types

	* dbus/dbus-message.[ch]:
	New non-refcounted iter API that supports recursive iters.
	Use iters for appending, including support for recursive
	iters.
	Add byte and named type support.
	Update everything to new marshalling formats.
	Add tests for new API.

	* dbus/dbus-protocol.h:
	Remove old array types.
	Add types: BYTE, ARRAY, DICT, NAMED

	* dbus/dbus-string.c:
	* dbus/dbus-sysdeps.c:
	Make parse_double locale safe.

	* dbus/dbus-test-main.c:
	Call setlocale.

	* dbus/dbus-test.c:
	Kill dict test

	* doc/dbus-specification.sgml:
	Update spec

	* test/data/incomplete-messages/missing-body.message:
	* test/data/invalid-messages/bad-boolean.message:
	* test/data/invalid-messages/bad-boolean-array.message:
	* test/data/invalid-messages/boolean-array-length-too-long.message-raw:
	* test/data/invalid-messages/boolean-has-no-value.message-raw:
	* test/data/invalid-messages/too-short-dict.message:
	* test/data/valid-messages/dict-simple.message:
	* test/data/valid-messages/dict.message:
	* test/data/valid-messages/emptiness.message:
	* test/data/valid-messages/lots-of-arguments.message:
	* test/data/valid-messages/no-padding.message:
	* test/data/valid-messages/recursive-types.message:
	Add missing NAME fields
	Fix up dicts & arrays

	* test/data/invalid-messages/dict-with-nil-value.message:
	Removed, this is not invalid anymore.

	* test/data/valid-messages/recursive-types.message:
	Add new test for deeply recursive types.
2003-04-08 15:52:51 +00:00
Havoc Pennington
fe22b2194d 2003-04-07 Havoc Pennington <hp@redhat.com>
* doc/dbus-specification.sgml: require that base service names
	start with ':' and that the base service is created/deleted
	as first and last things a connection does on the bus

	* bus/dispatch.c (check_existent_service_activation): lots more
	work on the activation test; it doesn't fully pass yet...

	* test/test-service.c (main): fix so we don't memleak the
	connection to the message bus
	(filter_func): accept a message asking us to exit
2003-04-07 23:28:16 +00:00
Havoc Pennington
a7f69a41d5 2003-04-06 Havoc Pennington <hp@pobox.com>
* qt/Makefile.am (dbusinclude_HEADERS): install dbus-qt.h,
	from Colin Walters

	* configure.in: fixes to Qt detection from Colin Walters

	* doc/Makefile.am: Only remove generated docbook dirs if they
	exist, from Colin Walters

	* dbus/dbus-bus.c: change how we set well-known connections to
	NULL, so that it works if a single connection is stored in
	two well-known array slots.

	* test/Makefile.am: remove a lot of stuff that isn't immediately
	useful, it's in CVS history if we want it.

	* test/test-service.c: use dbus-mainloop instead of that
	watch.[hc] crack
2003-04-07 02:01:53 +00:00
Havoc Pennington
2f3fbd451d 2003-04-05 Havoc Pennington <hp@pobox.com>
* doc/config-file.txt (Elements): fix docs of <auth> to reflect
	reality; in fact multiple mechanisms are allowed.

	* dbus/dbus-internals.c (_dbus_real_assert)
	(_dbus_real_assert_not_reached): move guts of _dbus_assert() and
	_dbus_assert_not_reached() into functions, so that they don't show
	up in basic block counts for test coverage, and don't use up as
	much disk space. Does mean slower execution speed though, so
	assumes --disable-asserts is the normal production case.
2003-04-05 20:38:01 +00:00
Havoc Pennington
03b9ca6d4e 2003-04-04 Havoc Pennington <hp@redhat.com>
* 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()
2003-04-05 00:37:17 +00:00
Havoc Pennington
1b08036103 2003-04-03 Havoc Pennington <hp@redhat.com>
* bus/loop.h, bus/loop.c: make the mainloop an object so we can
	have multiple ones

	* bus/*.[hc]: adapt to mainloop change
2003-04-04 00:39:22 +00:00
Havoc Pennington
f216e81432 2003-04-03 Havoc Pennington <hp@redhat.com>
* bus/activation.c (load_directory): fix up memleaks
	(bus_activation_entry_free): free the entry

	* dbus/dbus-bus.c (dbus_bus_acquire_service): return an error if
	we get one from the message bus; fix memleaks.

	* dbus/dbus-message.c (dbus_set_error_from_message): new function
2003-04-03 21:56:22 +00:00
Havoc Pennington
eeb88949d8 2003-04-03 Havoc Pennington <hp@pobox.com>
* 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
2003-04-03 05:22:49 +00:00
Havoc Pennington
44ed933284 2003-04-01 Havoc Pennington <hp@pobox.com>
* 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
2003-04-01 05:33:01 +00:00
Havoc Pennington
7af5933433 2003-03-31 Havoc Pennington <hp@redhat.com>
* bus/main.c (main): fix up the command line arguments to be nicer
2003-03-31 18:58:14 +00:00
Havoc Pennington
e6809d1a69 2003-03-31 Havoc Pennington <hp@redhat.com>
* dbus/Makefile.am (INCLUDES): use EXPANDED_LOCALSTATEDIR to
	define DBUS_SYSTEM_BUS_PATH as we want to compile in the same
	final location that lands in the config file

	* bus/config-loader-expat.c (bus_config_load): fix type of
	XML_Parser variable

	* doc/TODO: remove TODO item for dbus_bus_get()

	* dbus/dbus-bus.c (bus_data_free): add missing lock/unlock
2003-03-31 08:28:23 +00:00
Havoc Pennington
29c71168cd 2003-03-31 Havoc Pennington <hp@pobox.com>
* 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
2003-03-31 08:19:50 +00:00
Havoc Pennington
bc86794f23 2003-03-30 Havoc Pennington <hp@pobox.com>
* bus/config-parser.c: hacking

	* dbus/dbus-memory.c: don't use DBusList for the list of stuff
	to shut down, since it could cause weirdness with the DBusList
	lock

	* dbus/dbus-list.c (_dbus_list_test): add tests for the
	link-oriented stack routines
	(alloc_link): free the mempool if the first alloc from it fails

	* dbus/dbus-mempool.c (struct DBusMemBlock): fix alignment issue

	* dbus/dbus-string.c (UNICODE_VALID): sync new version of this
	from GLib
	(_dbus_string_skip_white): new

	* doc/config-file.txt (Elements): add <includedir>
2003-03-31 04:01:00 +00:00
Havoc Pennington
bf99381351 2003-03-28 Havoc Pennington <hp@pobox.com>
* bus/test.c (bus_test_flush_bus): remove the sleep from here,
	I think it may have just been superstition. Not sure.

	* dbus/dbus-string.c (_dbus_string_base64_decode): catch some OOM
	failures that were not being handled.

	* dbus/dbus-auth.c (process_auth): fix a memleak in OOM handling

	* dbus/dbus-memory.c: add ability to set number of mallocs in a
	row that will fail on out-of-memory.

	* dbus/dbus-internals.c (_dbus_test_oom_handling): convenience
	function for testing out-of-memory handling.

	* bus/config-loader-expat.c (memsuite): don't wrap the dbus
	allocation functions, they do map exactly to the expat ones.
2003-03-28 05:42:19 +00:00
Anders Carlsson
19670f221f More updates 2003-03-27 00:43:39 +00:00
Anders Carlsson
987f14721e Fix a small error. 2003-03-26 21:43:56 +00:00
Anders Carlsson
71e3bd44f9 Some more things. 2003-03-26 21:40:56 +00:00
Anders Carlsson
24ae27fa76 2003-03-26 Anders Carlsson <andersca@codefactory.se>
* doc/TODO:
	Add note about automatic service activation.

	* doc/dbus-specification.sgml:
	Rename the specification and clarify a few things.
2003-03-26 21:06:17 +00:00
Havoc Pennington
44fff65688 2003-03-24 Havoc Pennington <hp@pobox.com>
* bus/connection.c (bus_connections_setup_connection): set up
	the "can this user connect" function, but it always returns
	TRUE until we have a config file parser so we can have a config
	file that allows connections.
2003-03-24 17:30:47 +00:00
Havoc Pennington
a26607ab68 2003-03-23 Havoc Pennington <hp@pobox.com>
* 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
2003-03-23 07:41:54 +00:00
Havoc Pennington
b6ffea177f 2003-03-20 Havoc Pennington <hp@redhat.com>
* dbus/dbus-connection.c (dbus_connection_set_unix_user_function):
	new function
	(dbus_connection_get_unix_user): new function
2003-03-21 02:38:40 +00:00
Havoc Pennington
a284a148e4 2003-03-19 Havoc Pennington <hp@redhat.com>
* bus/policy.c: start sketching code for policy restrictions on
	what connections can do.
2003-03-19 23:48:17 +00:00
Havoc Pennington
b052524195 2003-03-18 Havoc Pennington <hp@redhat.com>
* doc/TODO: some notes on high-level todo items. Little nitpick
	stuff is all in @todo, so no need to add it here.

	* doc/config-file.txt: some notes on how config file might look
2003-03-18 23:22:12 +00:00
Havoc Pennington
1fbf6fa49c 2003-03-17 Havoc Pennington <hp@redhat.com>
* bus/test-main.c (main): make it print something as it runs
	so make check doesn't look stuck

	* doc/negotiation.txt, doc/dbus-sasl-profile.txt: remove
	from CVS, now obsolete
2003-03-17 23:29:03 +00:00
Anders Carlsson
3caaa342e8 2003-03-16 Anders Carlsson <andersca@codefactory.se>
* doc/dbus-specification.sgml:
	Document reply message for ActivateService.
2003-03-16 22:29:14 +00:00
Anders Carlsson
799a3ff443 2003-03-10 Anders Carlsson <andersca@codefactory.se>
* dbus/dbus-marshal.c:
	(_dbus_marshal_set_string):
	Take a length argument so we can marshal the correct string
	length.

	(_dbus_marshal_dict), (_dbus_demarshal_dict),
	(_dbus_marshal_get_arg_end_pos), (_dbus_marshal_validate_arg),
	(_dbus_marshal_test):
	* dbus/dbus-marshal.h:
	Add support for marshalling and demarshalling dicts.

	* dbus/dbus-message-builder.c: (_dbus_message_data_load):
	Add support for TYPE DICT.

	* dbus/dbus-message.c: (set_string_field):
	Adjust header padding.

	(dbus_message_append_args_valist), (dbus_message_append_dict),
	(dbus_message_get_args_valist), (dbus_message_iter_get_arg_type),
	(dbus_message_iter_get_dict), (_dbus_message_loader_return_buffer),
	(check_message_handling), (check_have_valid_message):
	* dbus/dbus-message.h:
	Add functions for setting and getting dicts.

	* dbus/dbus-protocol.h:
	Add DBUS_TYPE_DICT.

	* dbus/dbus.h:
	Add dbus-dict.h

	* doc/dbus-specification.sgml:
	Add information about how dicts are marshalled.

	* test/data/invalid-messages/dict-with-nil-value.message:
	* test/data/invalid-messages/too-short-dict.message:
	* test/data/valid-messages/dict-simple.message:
	* test/data/valid-messages/dict.message:
	Add sample messages containing dicts.
2003-03-10 00:13:55 +00:00
Havoc Pennington
7e050c8871 2003-03-04 Havoc Pennington <hp@pobox.com>
* test/data/auth/*: adapt to changes

	* dbus/dbus-auth-script.c (_dbus_auth_script_run): add
	USERID_BASE64 and change USERNAME_BASE64 to put in username not
	userid

	* dbus/dbus-keyring.c (_dbus_keyring_validate_context): prevent
	more stuff from being in a context name, to make the protocol
	simpler to deal with

	* dbus/dbus-errors.c (dbus_error_has_name): new function
	(dbus_error_is_set): new function

	* dbus/dbus-auth.c: replace DBUS_STUPID_TEST_MECH auth
	with DBUS_COOKIE_SHA1, implement DBUS_COOKIE_SHA1

	* dbus/dbus-connection.c (dbus_connection_flush): also read
	messages during a flush operation

	* dbus/Makefile.am: remove dbus-md5 since it isn't currently used.
2003-03-05 02:01:34 +00:00
Anders Carlsson
bafed4197e Doh 2003-03-04 23:06:11 +00:00
Anders Carlsson
942a69b1cd 2003-03-05 Anders Carlsson <andersca@codefactory.se>
* dbus/dbus-transport.c: (_dbus_transport_open):
	Remove duplicate "tcp" entry.

	* doc/dbus-specification.sgml:
	Clarify some things.
2003-03-04 23:02:40 +00:00
Anders Carlsson
3781f063a6 2003-02-24 Anders Carlsson <andersca@codefactory.se>
* dbus/dbus-marshal.c: (_dbus_marshal_validate_arg):
	* dbus/dbus-message-builder.c: (_dbus_message_data_load):
	* dbus/dbus-message.c: (dbus_message_append_boolean),
	(dbus_message_append_boolean_array),
	(dbus_message_get_args_valist), (_dbus_message_test):
	* dbus/dbus-message.h:
	* doc/dbus-specification.sgml:
	Various fixes as pointed out by Havoc.

	* test/data/invalid-messages/bad-boolean-array.message:
	* test/data/invalid-messages/bad-boolean.message:
	Add invalid boolean value test cases.
2003-02-24 20:26:13 +00:00
Anders Carlsson
c8769e0b1d 2003-02-24 Anders Carlsson <andersca@codefactory.se>
* dbus/dbus-internals.c: (_dbus_type_to_string):
	* dbus/dbus-marshal.c: (_dbus_marshal_get_arg_end_pos),
	(_dbus_marshal_validate_arg):
	* dbus/dbus-message-builder.c: (_dbus_message_data_load):
	* dbus/dbus-message.c: (dbus_message_append_args_valist),
	(dbus_message_append_boolean), (dbus_message_append_boolean_array),
	(dbus_message_get_args_valist), (dbus_message_iter_get_boolean),
	(dbus_message_iter_get_int32), (dbus_message_iter_get_uint32),
	(dbus_message_iter_get_double),
	(dbus_message_iter_get_boolean_array), (message_iter_test):
	* dbus/dbus-message.h:
	* dbus/dbus-protocol.h:
	* doc/dbus-specification.sgml:
	* test/data/valid-messages/lots-of-arguments.message:
	Add support for boolean and boolean array types.
2003-02-24 19:04:13 +00:00
Havoc Pennington
9e1b2fe28e another FIXME about method call mapping signals and slots 2003-02-18 04:43:35 +00:00
Havoc Pennington
614f82f6a6 add FIXME about how we might want to consider BYTE or BOOL 2003-02-18 04:39:05 +00:00
Havoc Pennington
c62323786c 2003-02-17 Havoc Pennington <hp@pobox.com>
* doc/dbus-specification.sgml: lots of cosmetic
	cleanups/rearrangement, add assorted FIXME, change DBUS_ADDRESS
	env variable to DBUS_BUS_ADDRESS, s/client/application/,
	s/server/bus/ (except in authentication section). Add a section
	"Message Bus Message Routing"
2003-02-18 03:08:04 +00:00
Havoc Pennington
061455a358 typo fixes 2003-02-18 02:05:08 +00:00
Anders Carlsson
94a718b2af 2003-02-17 Anders Carlsson <andersca@codefactory.se.>
Release 0.4

	* NEWS: Update
2003-02-17 11:38:02 +00:00
Anders Carlsson
108fdc542a 2003-02-17 Anders Carlsson <andersca@codefactory.se>
* doc/dbus-specification.sgml:
	Specification updates.
2003-02-17 11:04:18 +00:00
Anders Carlsson
3c8db26789 2003-02-17 Anders Carlsson <andersca@codefactory.se>
* 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.
2003-02-17 09:59:23 +00:00
Anders Carlsson
014e1be482 2003-02-17 Anders Carlsson <andersca@codefactory.se>
* doc/.cvsignore:
	* doc/Makefile.am:
	* doc/dbus-test-plan.sgml:
	Add test plan document.

	* test/Makefile.am:
	Fix distcheck.
2003-02-16 23:35:51 +00:00
Havoc Pennington
ece62d7c14 s/desktop session message bus/login session message bus/ 2003-02-15 15:35:14 +00:00
Havoc Pennington
5970d04af5 2003-02-13 Havoc Pennington <hp@pobox.com>
* dbus/dbus-auth.c (handle_server_data_external_mech): args to
	dbus_credentials_match were backward

	* dbus/dbus-auth-script.c (_dbus_auth_script_run): support
	NO_CREDENTIALS and ROOT_CREDENTIALS

	* dbus/dbus-auth.c (_dbus_auth_do_work): move get_state() routine
	into here. Never process more commands after we've reached an
	end state; store further data as unused bytes.

	* test/data/auth/*: add more auth tests

	* dbus/dbus-auth-script.c (_dbus_auth_script_run): support EXPECT
	command to match exact string and EXPECT_UNUSED to match unused
	bytes

	* test/Makefile.am (dist-hook): fix to dist all the test stuff
2003-02-13 04:11:57 +00:00
Zack Rusin
9ac27f95fe Minimal semantic fixes. 2003-02-10 03:14:29 +00:00
Anders Carlsson
c90bd5a7d2 2003-02-02 Anders Carlsson <andersca@codefactory.se>
* doc/dbus-specification.sgml:
	Update address format section.
2003-02-02 17:36:46 +00:00
Havoc Pennington
ca84a29217 2003-01-31 Havoc Pennington <hp@pobox.com>
* doc/dbus-specification.sgml: work on the specification

	* dbus/dbus-message.c (_dbus_message_loader_return_buffer): check
	the protocol version of the message.

	* dbus/dbus-protocol.h: drop special _REPLY names, the spec
	no longer specifies that.
	(DBUS_SERVICE_REPLY_SERVICE_EXISTS): fix flags (1/2/4/8 not
	1/2/3/4)

	* dbus/dbus-marshal.c (_dbus_marshal_get_arg_end_pos): add missing
	"break" for DBUS_TYPE_NIL, remove @todo
2003-02-01 00:08:32 +00:00
Havoc Pennington
482dab2076 2003-01-31 Havoc Pennington <hp@pobox.com>
* doc/dbus-specification.sgml: fully specify the header.  Add
	flags and major protocol version, and change header/body len to
	unsigned.

	* dbus/dbus-message-builder.c (append_saved_length): append length
	as uint32

	* dbus/dbus-message.c (dbus_message_create_header): change header
	length and body length to unsigned. Add the new fields from the
	spec
	(_dbus_message_loader_return_buffer): unsigned header/body len
2003-01-31 03:49:42 +00:00
Havoc Pennington
af4ef42fa5 2003-01-30 Havoc Pennington <hp@pobox.com>
* dbus/dbus-auth.c: rework to use only REJECTED, no
	MECHANISMS

	* doc/dbus-sasl-profile.txt: drop MECHANISMS and just
	use REJECTED, suggested by Mark McLoughlin
2003-01-31 01:31:00 +00:00
Havoc Pennington
c514c719ec 2003-01-24 Havoc Pennington <hp@pobox.com>
* doc/dbus-specification.sgml: add some stuff
2003-01-24 05:16:42 +00:00
Havoc Pennington
f8e9de35d7 .cvsignore 2003-01-23 20:31:01 +00:00
Havoc Pennington
f703c5ddd3 2003-01-22 Havoc Pennington <hp@pobox.com>
* doc/dbus-specification.sgml: Start to document the protocol.
2003-01-23 05:04:03 +00:00