Commit graph

85 commits

Author SHA1 Message Date
Simon McVittie
aa009ba18b oops, fix XML mis-nesting 2011-04-07 18:27:52 +01:00
Sven Herzberg
136b8b8c86 list which parts of the Desktop Entry spec apply to service files
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=19159
2011-04-07 18:26:17 +01:00
Havoc Pennington
7d65a3a6ed CVE 2010-4352: Reject deeply nested variants
Add DBUS_INVALID_NESTED_TOO_DEEPLY validity problem and a test that
should generate it.

Previously, we rejected deep nesting in the signature, but
variants allow dynamic message nesting, conditional only
on the depth of the message body.

The nesting limit is 64, which was also the limit in static
signatures.  Empirically, dynamic nesting depth observed on my
Fedora 14 system doesn't exceed 2; 64 is really a huge limit.

https://bugs.freedesktop.org/show_bug.cgi?id=32321

Signed-Off-By: Colin Walters <walters@verbum.org>
Signed-off-by: Will Thompson <will.thompson@collabora.co.uk>
2010-12-20 21:39:00 +00:00
Will Thompson
ff393c562d Fix malformed specification XML.
bf532d6 and 28a2d08 each introduced errors in the specification XML that
left it malformed and unbuildable.
2010-12-13 15:35:34 +00:00
Ralf Habacker
bf532d6556 Add documentation for autolaunch meta transport on Windows.
Reviewed-by: Romain Pokrzywka
2010-12-13 15:06:33 +01:00
Mike McQuaid
28a2d08815 Add launchd section to specification. 2010-12-13 12:35:55 +01:00
Ralf Habacker
b3fa6eff0d Added revision history. 2010-11-03 15:15:24 +01:00
Thiago Macieira
b17a5f852c Documentated autolaunch implementation for X Windowing system. 2010-11-03 15:10:44 +01:00
Ralf Habacker
a96fcb19d1 Revert "Added documentation for autolaunch transport."
This reverts commit 2e61875728.
2010-10-08 14:56:57 +02:00
Ralf Habacker
2e61875728 Added documentation for autolaunch transport. 2010-09-27 21:56:40 +02:00
Will Thompson
81839c9389 Explicitly require the daemon to respect destination='' 2010-09-08 12:11:50 +01:00
Will Thompson
1861c9fdd0 Clarify GetConnectionUnixUser documentation.
(This makes it match the freshly-documented GetConnectionUnixProcessID.)
2010-06-17 15:27:08 +01:00
Will Thompson
c8aa4ba183 Document ListQueuedOwners in the spec 2010-06-17 15:27:08 +01:00
Will Thompson
318c55c9c0 Document GetConnectionUnixProcessID in the spec 2010-06-17 15:27:07 +01:00
Will Thompson
1b6adc407e Fix a broken <xref/> 2010-06-17 15:27:07 +01:00
David Zeuthen
f8729bc864 Add an extra parameter to the PropertiesChanged() signal
It was pointed out on the mailing list that it would be useful to know
that a given property has changed without conveying its value. Because
without this parameter a true_no_value property could change, however
there is no way for a client-side proxy to know _what_ property it was
(only that some property changed).

With the parameter, however, a client-side proxy can reliably discard
a cached property value.

Also rename the "true_no_value" to "invalidates" as the spec is now
using this language.

Also allow using the annotation in the enclosed interface name.

Also rename the annotation name so it uses Property in its name
instead of Properties. This is to be more consistent with the existing
org.freedesktop.DBus.Method.NoReply annotation which uses Method, not
Methods.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-05-13 10:58:32 -04:00
David Zeuthen
2541e86615 Add an optional PropertiesChanged() signal
Some notes about this new signal

 - The PropertiesChanged() signal is optional. An application can
   convey support for this signal by either including or excluding it
   from the returned introspection data much like apps not supporting
   (or predating) the GetAll() method does not include GetAll() in the
   introspection data.

 - An object can use PropertiesChanged() but opt out of using it for
   one or more properties by using the

     org.freedesktop.DBus.Properties.EmitsChangedSignal

   annotation on the properties in question

 - Applications can start using this new signal without breaking
   compatibility with clients relying on existing D-Bus API.

The intent of the patch is simply to standardize existing behavior

 - EggDBus has a very similar signal called EggDBusPropertiesChanged()
   (also on the org.freedesktop.DBus.Properties interface)

 - NetworkManager has a PropertiesChanged() signal on each different
   interface (e.g. not org.fd.D.P) that it implements

 - GDBus, an implementation of the D-Bus protocol in GLib, already
   implements this signal

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-05-12 12:28:19 -04:00
Ray Strode
d5a6e590b8 Add clarification to spec about UpdateActivationEnvironment
UpdateActivationEnvironment takes a a{ss}.  This means only
valid UTF-8 can be used.  Environment variables are normally
ascii, but in theory have no specific encoding to them.  This
means that certain valid environment variables can't be sent
to the bus for updating its activation environment.

This commit just adds a note to the spec explaining this
restriction.
2010-05-10 10:16:15 -04:00
Colin Walters
ebfa7c02fd Merge branch 'dbus-1.2'
Conflicts:
	bus/bus.c
	configure.in
2010-03-16 16:11:14 -04:00
Simon McVittie
efc63e58da [doc/dbus-specification.xml] Explicitly specify lower-case hex must be used
https://bugs.freedesktop.org/show_bug.cgi?id=9486

When describing DBUS_COOKIE_SHA1, specify that lower-case hex encoding
must be used.
2010-03-16 12:40:08 -04:00
Will Thompson
ce87333cac Forbid zero serial numbers 2010-01-28 17:01:23 -05:00
Ralf Habacker
622e66944c added tranport address format to dbus specification 2009-12-23 23:28:48 +01:00
Ralf Habacker
658be8be7b added initial tcp transport section 2009-12-23 11:11:20 +01:00
Frank Osterfeld
5012769a3f Add nonce-tcp section to the specification (draft) (cherry picked from commit 7015b2db6c8744c88da9cb0fab8d5e0fcfc0220b) 2009-12-01 08:43:40 +01:00
Will Thompson
7689d71257 Forbid zero serial numbers 2009-11-01 14:32:34 +00:00
Lennart Poettering
869291ea5a doc: document Unix FD passing in the specification 2009-05-20 03:01:37 +02:00
Ray Strode
37853b6dd0 Add new UpdateActivationEnvironment bus message
It adjusts the environment of activated bus clients.
This is important for session managers that get started
after the session bus daemon and want to influence the
environment of desktop services that are started by the
bus.
2008-07-12 13:38:00 -04:00
Simon McVittie
1a5ef4003d Improve description of allowed variant signatures (#10185)
Patch based on one from Kristoffer Lundén, amended as per Havoc's comment.
2007-10-09 14:23:28 +01:00
Simon McVittie
fafd784424 doc/dbus-specification.xml: Clarify description of DBUS_COOKIE_SHA1 (#10184).
Patch from Kristoffer Lundén.
2007-10-09 14:12:31 +01:00
Simon McVittie
bf7c65f521 doc/dbus-specification.xml: Specifically forbid empty structs (#7969) 2007-10-09 14:06:35 +01:00
Ryan Lortie
f6ec4a80ab Add argument path matching support. Bug #11066.
2007-09-20  Ryan Lortie  <desrt@desrt.ca>

        * dbus/signals.c (struct DBusMatchRule, bus_match_rule_new,
        bus_match_rule_set_arg, bus_match_rule_parse_arg_match,
        match_rule_matches): Add support for parsing and matching on
        arg0path='/some/path' type rules.

        * dbus/signals.h (bus_match_rule_set_arg): change to take const
        DBusString instead of const char * for the string to match against.

        * dbus/dbus-bus.c: add a quick note to dbus_bus_add_match
        documentation about the path matching.

        * doc/dbus-specification.xml: add a more detailed description of the
        changes here.
2007-09-20 13:04:38 -04:00
Havoc Pennington
54b943432c 2007-06-18 Havoc Pennington <hp@redhat.com>
* doc/dbus-specification.xml: document org.freedesktop.DBus.GetId()

	* bus/driver.c (bus_driver_handle_get_id): implement org.freedesktop.DBus.GetId()

	* bus/bus.c (bus_context_new): generate a unique ID for each bus context

	* dbus/dbus-connection.c (dbus_connection_get_server_id): new function

	* dbus/dbus-bus.c (dbus_bus_get_id): new function

	* dbus/dbus-server.c (dbus_server_get_id): new function
2007-06-18 19:32:51 +00:00
Simon McVittie
9bdc8322ff doc/dbus-specification.xml: say the protocol version is 1 instead of 0
(patch from Kristoffer Lundén, fd.o#10033)
Also remove the FIXME about removing protocol version from messages (as per
Havoc's comment on that bug)
2007-06-14 09:50:17 +00:00
Simon McVittie
442e8ab1f3 doc/dbus-specification.xml: explicitly specify that STRING cannot contain embedded NULs. 2007-05-21 15:40:59 +00:00
Havoc Pennington
c81036b7ec be consistent about notations 2007-05-18 18:12:24 +00:00
Havoc Pennington
d5b030efcc 2007-05-18 Havoc Pennington <hp@redhat.com>
* doc/dbus-specification.xml: add a GetAll to the Properties
	interface.
2007-05-18 18:10:18 +00:00
Simon McVittie
e600d78e41 doc/dbus-specification.xml: mention the reserved o.fd.DBus.Local interface
and the corresponding /o/fd/DBus/Local object path; describe them as reserved
and forbid using them in a sent message, mentioning that in the reference
implementation this will cause the connection to be dropped.
Patch approved by Havoc.
2007-05-04 10:28:12 +00:00
Havoc Pennington
dbc061b812 2006-11-14 Havoc Pennington <hp@redhat.com>
* dbus/dbus-internals.c (_dbus_generate_uuid): The spec said the
	UUID had the timestamp last, but the implementation had it first;
	move it to last since I think it's a tiny bit nicer (easier to
	compare at a glance, faster to sort, less code), and will not
	cause any practical compatibility problems. Also, always convert
	the timestamp to big endian.

	* doc/dbus-specification.xml: Clean up the docs on the UUID.

	* tools/dbus-uuidgen.1: more prominently say it is not suitable
	as a replacement for regular uuidgen/RFC4122.
2006-11-15 01:52:01 +00:00
Havoc Pennington
3a02d8c132 2006-11-08 Havoc Pennington <hp@redhat.com>
* doc/dbus-specification.xml: add a note about protocol stability

	* doc/TODO: Remove "important for 1.0" section, replace with
	"important for 1.2" section
2006-11-09 00:19:29 +00:00
Havoc Pennington
151b3aaaef 2006-11-07 Havoc Pennington <hp@redhat.com>
* doc/dbus-specification.xml, doc/dbus-faq.xml, README: various
	documentation updates. Bump faq/spec versions (not to 1.0; I don't
	think the spec will be "finished"/1.0 when we ship the 1.0 library).
2006-11-07 06:13:53 +00:00
Havoc Pennington
bdbbf46ca8 2006-10-26 Havoc Pennington <hp@redhat.com>
* doc/dbus-specification.xml: clarify the UUID text slightly

	* dbus/dbus-sysdeps-pthread.c: check for and mostly abort on
	pthread errors. Add DBusMutexPThread and DBusCondVarPThread
	in preparation for being able to extend them for e.g. recursive
	mutexes.
2006-10-27 02:17:42 +00:00
Havoc Pennington
afa4ffbd85 2006-10-21 Havoc Pennington <hp@redhat.com>
* dbus/dbus-message.h: put #ifndef DBUS_DISABLE_DEPRECATED around
	dbus_message_iter_get_array_len().

	* throughout: documentation improvements.
2006-10-21 17:08:08 +00:00
Havoc Pennington
d8155bf51b 2006-09-30 Havoc Pennington <hp@redhat.com>
* configure.in (LT_CURRENT, LT_AGE): increment current and age to
	reflect addition of interfaces.

	* doc/dbus-specification.xml: describe a new
	org.freedesktop.DBus.Peer.GetMachineId method

	* dbus/dbus-string.c (_dbus_string_skip_white_reverse): new function
	(_dbus_string_skip_white, _dbus_string_skip_blank): use new
	DBUS_IS_ASCII_BLANK, DBUS_IS_ASCII_WHITE macros and fix assertion
	at end of skip_white
	(_dbus_string_chop_white): new function

	* bus/connection.c (bus_connections_setup_connection): call
	dbus_connection_set_route_peer_messages.

	* dbus/dbus-connection.c
	(_dbus_connection_peer_filter_unlocked_no_update): modify to
	support a GetMachineId method.

	Also, support a new flag to let the bus pass peer methods through
	to apps on the bus, which can be set with
	dbus_connection_set_route_peer_messages.

	Finally, handle and return an error for anything unknown on the
	Peer interface, which will allow us to extend the Peer interface
	in the future without fear that we're now intercepting something
	apps were wanting to see.

	* tools/dbus-uuidgen.c: a thin wrapper around the functions in
	dbus/dbus-uuidgen.c

	* dbus/dbus-uuidgen.c: implement the bulk of the dbus-uuidgen
	binary here, since most of the code is already in libdbus

	* dbus/dbus-sysdeps.c (_dbus_read_local_machine_uuid): read the
	uuid from the system config file

	* dbus/dbus-internals.c (_dbus_generate_uuid, _dbus_uuid_encode)
	(_dbus_read_uuid_file_without_creating)
	(_dbus_create_uuid_file_exclusively, _dbus_read_uuid_file): new
	uuid-related functions, partly factored out from dbus-server.c

	* dbus/dbus-sysdeps.c (_dbus_error_from_errno): convert EEXIST to
	DBUS_ERROR_FILE_EXISTS instead of EEXIST

	* dbus/dbus-protocol.h (DBUS_ERROR_FILE_EXISTS): add file exists error

	* tools/dbus-cleanup-sockets.1: explain what the point of this
	thing is a bit more

	* autogen.sh (run_configure): add --config-cache to default
	configure args

	* dbus/dbus-internals.h (_DBUS_ASSERT_ERROR_IS_SET): disable the
	error set/clear assertions when DBUS_DISABLE_CHECKS is defined

	* tools/dbus-launch.c (main): if xdisplay hasn't been opened,
	don't try to save address, fixes crash in make check
2006-10-01 03:18:47 +00:00
Robert McQueen
711c065e59 2006-08-17 Alp Toker <alp@atoker.com>
* doc/dbus-specification.xml: Fix some minor typos.
2006-08-17 21:20:13 +00:00
John (J5) Palmieri
7652304bff * s/D-BUS/D-Bus/g 2006-08-03 20:34:36 +00:00
John (J5) Palmieri
7628b54125 * bus/activation.[ch] (bus_activation_list_services): new function to
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
2006-07-14 01:17:59 +00:00
John (J5) Palmieri
50266d4190 * Adding old doc patch that never got applied
* dbus/bus.c (dbus_bus_add_match): Add documentation

* doc/dbus-specification.xml: Add documentation for the match rules
  and the AddMatch and RemoveMatch methods
2006-05-03 22:56:35 +00:00
John (J5) Palmieri
1a163e765c * configure.in: Add test/name-test/Makefile to the generated
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
2005-11-22 20:37:00 +00:00
Robert McQueen
b5e4d26ade 2005-11-15 Robert McQueen <robot101@debian.org>
* bus/driver.c, bus/services.c, bus/services.h: Add a ReleaseName
	method to org.freedesktop.DBus to release a bus name or give up
	waiting in the queue for it.

	* dbus/dbus-bus.c, dbus/dbus-bus.h, dbus/dbus-shared.h: Add a
	dbus_bus_release_name method to send the ReleaseName method calls.
	Add constants for the return values to dbus/dbus-shared.h.

	* doc/dbus-specification.xml: Document the new ReleaseName method
	in the specification.

	* python/dbus_bindings.pyx: Add a low-level python binding for the
	release name method.

	* python/exceptions.py, python/service.py: Make freeing BusName
	objects release the name. Add a NameExistsException, and fix a
	bug with creating UnknownMethodException.

	* test/python/test-client.py: Add tests for freeing BusName
	objects causing names to be released.
2005-11-15 17:19:19 +00:00
Ross Burton
4e2b0d94ec Add a NoReply annotation 2005-10-25 08:54:57 +00:00