Commit graph

1851 commits

Author SHA1 Message Date
Colin Walters
dd6de35b4e Bug 15646: Remove spurious debugging fprintf(stderr 2008-07-28 16:31:09 -04:00
Marc Brockschmidt
9d51f086b0 Bug 16727: Handle ERANGE for getgr; fixes user in many groups
Patch originally from Noèl Köthe.
	Modified by Colin Walters <walters@verbum.org>

	* dbus/dbus-sysdeps-unix.c, dbus/dbus-sysdeps-unix-utils.c:
	Use a while() loop to reallocate buffer if we get ERANGE
	return.  This fixes the case where a user is in a large
	number of groups.
2008-07-28 16:14:18 -04:00
Colin Walters
121c6b13a3 Bug 16294: Don't lose inotify watch when config fails to parse
* bus/dir-watch-inotify.c: Always drop the watch in
	handle_inotify_watch; this ensures we always readd it
	correctly in bus_drop_all_directory_watches.
2008-07-28 12:02:56 -04:00
Colin Walters
892c0a0053 Bug 16838: Use bash instead of sh to avoid breaking on Ubuntu 2008-07-24 16:37:25 -04:00
Colin Walters
d86df0220e Merge branch 'master' of ssh://walters@git.freedesktop.org/git/dbus/dbus 2008-07-24 16:19:34 -04:00
Scott James Remnant
4cbc30465e Bug 16839: Fix bus names in test case so it actually works.
* test/name-test/test-privserver.c (filter_session_message, main),
* test/name-test/test-privserver-client.c (open_shutdown_private_connection):
 Replace TestServer with PrivServer to match the service definition files.
2008-07-24 16:19:14 -04:00
Ray Strode
3bc6840b04 Fix leaks in bus_activation_get_environment error paths
Commit 91306ef938 introduced
two memory leaks on OOM error paths.  In one case the
environment string array wasn't getting freed, and in the
other case it was getting freed with dbus_free instead of
dbus_free_string_array.
2008-07-15 04:01:49 -04:00
Ray Strode
01e50bcd5d Update man page to make the point of the <type> element more clear
There have been a number of patches in the past try to key system
versus session bus policy off of the message bus type, when the
policy should be distinguished from more fine-grained options in the
individulal policy files.  Hopefully, this man page update will make
that more clear.
2008-07-12 13:38:04 -04: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
Ray Strode
91306ef938 Store what environment to activate with on activation object
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.
2008-07-12 13:21:23 -04:00
Ray Strode
8ec1604192 When spawning processes, don't ignore the passed in environment
Previously, we'd always call execv() and unconditionally use
the environment of the parent.  Now we call execve() with the
passed in environment.  For compatibility, we detect if
the passed in environment is NULL and for that case, use the
environment from the parent instead.
2008-07-12 00:32:24 -04:00
Ray Strode
0e3ec9cec0 Add new function _dbus_string_split_on_byte
It allows you to turn a string like KEY=VALUE
into two strings key and value.
2008-07-11 23:58:59 -04:00
Ray Strode
417c41f6c1 Add new _dbus_get_environment call
It's a wrapper around the environ external variable.
It will be important in the future when we allow
bus clients to modify the environment of future
activated clients. Presently, we just always use the
bus daemon environment wholesale.
2008-07-11 23:58:53 -04:00
Thiago Macieira
458c6ead85 Merge branch 'dbus-1.2' 2008-06-07 17:48:04 +02:00
Oswald Buddenhagen
d7bb3cf8df Fix inverted return value from dbus_connection_read_write()
* dbus/dbus-connection.c (_dbus_connection_read_write_dispatch):
      The double negation re no_progress_possible was obviously too
      confusing: the path for dispatch = FALSE would return an inverted
      status. So make it progress_possible and fix the logic.

Signed-off-by: Thiago Macieira <thiago@kde.org>
2008-06-07 17:45:08 +02:00
Colin Walters
ab1eb1fd5a Bug 15740: Solaris/ADT auditing support (simon zheng)
* bus/driver.c: Add GetAdtAuditSessionData method
	which returns audit data for a connection.
	* configure.in: Detect ADT auditing support
	* dbus/dbus-auth.c: Read ADT auditing creds.
	* dbus/dbus-connection.c: Implement
	dbus_connection_get_adt_audit_session_data.
	* dbus/dbus-connection.h: Export it.
	* dbus/dbus-credentials.c: Add support for
	gathering adt_audit_data and retrieving it
	via _dbus_credentials_get_adt_audit_data.
	* dbus/dbus-credentials.h: Add
	DBUS_CREDENTIAL_ADT_AUDIT_DATA_ID.
	* dbus/dbus-protocol.h: New error
	DBUS_ERROR_ADT_AUDIT_DATA_UNKNOWN.
	* dbus/dbus-sysdeps.c: Support for reading
	audit credentials via ADT API.
	* dbus/dbus-transport.c: New function
	_dbus_transport_get_adt_audit_session_data
	to retrieve credentials.
	* dbus/dbus-transport.h: Export it.
2008-06-05 17:24:34 -04:00
Colin Walters
81c32a5257 Tweak HACKING to describe test/name-test briefly
* HACKING: Describe test/name-test.
2008-05-30 21:05:48 -04:00
Colin Walters
ef41cd3110 Bug 15635: Hold a reference during read/write dispatch (Scott James Remnant)
* dbus/dbus-connection.c (_dbus_connection_read_write_dispatch):
 	Reference the D-Bus connection during the function call since we
 	call other functions that may free the last reference and we
 	still expect to be able to check the connection after they return
 	to decide our own return value.
2008-05-30 20:41:49 -04:00
Colin Walters
0e2a099b55 Bug 15571: Clean up GUID-less connections correctly (Scott James Remnant)
* dbus/dbus-connection.c (connection_forget_shared_unlocked):
 	Remove shared connections which lack a GUID from the list that
 	caches those, otherwise references to them will remain after
 	they have been freed.
	* test/name-test/test-privserver-client.c: Update test to
	try GUID-less connections too.
2008-05-30 20:25:36 -04:00
Colin Walters
fd32a72b2f Bug 15570: Reset initialized state on dbus_shutdown (Scott James Remnant)
* dbus/dbus-bus.c (addresses_shutdown_func): Reset initialized back
 	to FALSE after cleaning up the address list so that it will be
 	reinitialized again if D-Bus is used after dbus_shutdown()
	* test/name-test/test-privserver-client.c: Uncomment part of
	test which should now pass.
2008-05-30 19:58:13 -04:00
Colin Walters
5e359834f2 Add "PrivServer" test which exercises DBusServer and dbus_shutdown
* test/data/valid-service-files/org.freedesktop.DBus.TestSuite.PrivServer.service.in:
	New service file for PrivServer.
	* configure.in: Generate it.
	* test/name-test/Makefile.am: Build test-privserver and
	test-privserver-client.
	* test/name-test/test-privserver.c: Use DBusServer to
	serve a private connection.
	* test/name-test/test-privserver-client.c: Connect
	via session bus and get address of private server,
	exercise dbus_shutdown().
	* test/name-test/run-test.sh: Run it.
2008-05-30 17:11:15 -04:00
Colin Walters
a73a79a155 Add noinst convenience test library, add a test-shutdown
* test/Makefile.am: New convenience library
	libdbus_testutils_la.  Reorder build so that
	test/ gets built before test/name-test so
	name-test files can depend on it.
	* test/name-test/test-shutdown.c: New file,
	exercises dbus_shutdown () a bit.
	* test/name-test/run-test.sh Run test-shutdown.
	* test/test-utils.h: In some cases we already have
	DBUS_COMPILATION defined, avoid double definition
	warning.
2008-05-30 16:53:35 -04:00
Colin Walters
9d8989cfec Add test library functions for using DBusServer
* test/test-utils.h, test/test-utils.c: Add functions
	which hook up a DBusServer to a DBusLoop, useful
	for test cases.
2008-05-30 16:19:40 -04:00
Colin Walters
80306140b9 Bug 15588: Fix typo in #ifdef for userdb cache (Scott James Remnant)
* dbus/dbus-userdb-util.c, dbus/dbus-userdb.c: Correct name of
 	macro used in #ifdef block to match that defined by configure,
 	otherwise the userdb cache will never be enabled.
2008-05-30 11:14:46 -04:00
Colin Walters
e2bc723206 Bug 15947: Close file descriptors before execing helper (Markus Rechberger)
* dbus/dbus-sysdeps-unix.c (_dbus_get_autolaunch_address):
	Close file descriptors before exec.
2008-05-28 16:01:22 -04:00
Thiago Macieira
af41f085c6 Merge branch 'dbus-1.2' 2008-05-17 10:11:20 +02:00
Thiago Macieira
cdca6dbce8 Prevent a crash in some applications due to timers leaking after the
DVusPendingCall object was freed.

    * dbus-connection.c: Remove the timer for the pending call's timeout in
      case the reply has timed out in blocking code. This fixes bug 15684.
2008-05-17 10:10:42 +02:00
John (J5) Palmieri
12e838d766 take out trailing comma inside an enum so non gcc compilers don't error out
* tools/dbus-monitor.c: take out the trailing comma in the
  ProfileAttributeFlags enum as it isn't in our style guides and causes
  some compilers to error out
2008-04-16 10:53:00 -04:00
John (J5) Palmieri
eead418b24 take out trailing comma inside an enum so non gcc compilers don't error out
* tools/dbus-monitor.c: take out the trailing comma in the
  ProfileAttributeFlags enum as it isn't in our style guides and causes
  some compilers to error out
2008-04-16 10:49:25 -04:00
John (J5) Palmieri
a2b72d577e up version for unstable development 2008-04-04 15:42:58 -04:00
John (J5) Palmieri
b4cbb84fe0 getting ready for 1.2 stable branch
* ChangeLog.pre-1-2: rename ChangeLog
* NEWS.pre-1-2: rename NEWS
* Makefile.am: list the pre files in EXTRA_DIST; the pre-1-0 files had not
  been added yet so do that too
2008-04-04 15:37:50 -04:00
John (J5) Palmieri
541779373b bump version after release 2008-04-04 15:26:52 -04:00
John (J5) Palmieri
ef96f66e3b Released 1.2.1 2008-04-04 15:24:46 -04:00
John (J5) Palmieri
00ac996ec0 change version to 1.2.1 to prep release
* we are moving to the 1.2.x version scheme because re-licensing seems to be
  blocked indefinitely
2008-04-04 15:15:22 -04:00
John (J5) Palmieri
d7446ac003 Revert "fix dbus-send so it can correctly send dictionaries"
This reverts commit a689ef29f1.

Conflicts:

	ChangeLog

* Turns out I reversed a patch that was alread committed but the bug had not
  been closed.  Since the patch was applied before I also reverted the
  mention of Jérémie in the AUTHORS list mainly for license book keeping
  sanity.
2008-04-04 14:58:07 -04:00
John (J5) Palmieri
ca87b90981 fix memleak due to autolaunch and recursive calls to _dbus_open_transport
* Patch from Sumit <sumitskj_20@yahoo.com>, comments added

* dbus/dbus-transport.c(_dbus_transport_open): fix mem leak
2008-04-03 16:08:40 -04:00
John (J5) Palmieri
b5818e619f modify dbus_connection_send documentation
* dbus/dbus-connection.c (dbus_connection_send): add documentation
  to describe when to call dbus_connection_flush and
  dbus_connection_unref after a call to dbus_connection_send is made
  Initial wording by Stanislav Brabec <sbrabec at suse.cz>
  (fd.o bug#13558)
2008-04-03 13:15:45 -04:00
Jérémie Dimino
a689ef29f1 fix dbus-send so it can correctly send dictionaries
* tools/dbus-send.c (append_dict): Send in signature when opening up
  a dict entry container

* AUTHORS: Add Jérémie to AUTHORS file since it was a slightly above
  trivial fix
2008-04-03 11:32:09 -04:00
Kimmo Hämäläinen
7c4b345802 fix expiration of pending replies
* bus/expirelist.c
  (do_expiration_with_current_time): calculate correct min wait time
  and next interval
  (bus_expire_list_add, bus_expire_list_add_link): if the timeout is
  disabled when we add an item to the expire list, enable the timeout
  (do_expiration_with_current_time): only set timeout if there are
  items to expire
2008-04-03 11:12:27 -04:00
John (J5) Palmieri
960fef844b Merge branch 'master' of git+ssh://johnp@git.freedesktop.org/git/dbus/dbus
Conflicts:

	ChangeLog
2008-04-03 11:11:19 -04:00
Frederic Crozat
68f69d3818 Fixes for the inotify configuration file monitor backend.
2008-04-01  Timo Hoenig  <thoenig@suse.de>

Patch from Frederic Crozat <fcrozat@mandriva.com>

* bus/dir-watch-inotify.c (bus_watch_directory): Only monitor
  IN_CLOSE_WRITE, IN_DELETE, IN_MOVE_TO and IN_MOVE_FROM events. This
  way, only atomic changes to configuration file are monitored.
* bus/dir-watch-inotify.c (_handle_inotify_watch): Fix typo in
  _dbus_verbose function call
* bus/dir-watch-inotify.c (bus_drop_all_directory_watches): Use
  _dbus_strerror instead of perror
2008-04-01 18:09:46 +02:00
Colin Walters
0bfc5e8d23 Check for X11 events before selecting (FDO bug #15293) 2008-03-31 18:20:07 -04:00
Colin Walters
193ebb7083 Make sure we call XFlush() on all code paths (FDO bug #15293) 2008-03-31 18:16:00 -04:00
Havoc Pennington
4058579dae Do not provide a signature to dbus_message_iter_open_container() when opening a dict entry.
2008-03-27  Havoc Pennington  <hp@redhat.com>

	* tools/dbus-send.c (append_dict): Do not provide a signature to
	dbus_message_iter_open_container() when opening a dict entry.
2008-03-27 16:52:40 -04:00
Colin Walters
52ea0f2cbb Set default exit_on_disconnect after registration
2008-03-26  Colin Walters  <walters@verbum.org>
	Patch from Scott James Remnant <scott@netsplit.com>

	* dbus/dbus-bus.c: Set default exit_on_disconnect after registration with
	the bus, not before.  This ensures that programs which wish to set
	exit_on_disconnect to FALSE will not be terminated if the bus exits
	during registration.  (FDO Bug #15112)
2008-03-26 10:28:40 -04:00
Havoc Pennington
a37404111b Make BusExpireList an opaque data type
2007-11-08  Havoc Pennington  <hp@redhat.com>

	* bus/connection.c, bus/expirelist.c: Make the BusExpireList
	struct opaque, adding accessors for manipulating the list. In this
	commit there should be no change in functionality or behavior. The
	purpose of this change is to improve encapsulation prior to fixing
	some bugs Kimmo Hämäläinen found where the timeout is not properly
	updated, since we need to e.g. take some action whenever adding
	and removing stuff from the expire list.
2008-03-04 14:21:42 -05:00
John (J5) Palmieri
d25151483f fix broken poll on Mac OSX - build patch by Benjamin Reed
* configure.in: check for OSX's deadlocking poll
* dbus/dbus-sysdeps-unix.c (_dbus_poll): if we have a broken poll
  don't use poll
2008-03-04 13:21:05 -05:00
John (J5) Palmieri
bd561f9a19 check if the linker supports a flag instead of just checking for GNU ld
* configure.in: move AM_PROG_LIBTOOL to the top
  (ld_supports_flag): new function for checking if the linker supports
  a given flag
2008-03-04 13:09:07 -05:00
John (J5) Palmieri
d511324fff add a changelog for Benjamin Reed's git patch (OS X build fixes)
* configure.in: Platform build fixes for Mac OS X
  the Darwin linker does not understand the -z option; wrap it in
  a check for $with_gnu_ld.
  environ is only available at runtime, so you need to make a
  reference to _NSGetEnviron instead for symbols to resolve properly.
2008-03-04 13:07:38 -05:00
Benjamin Reed
ee4a0dce33 Platform build fixes for Mac OS X
- the Darwin linker does not understand the -z option; wrap it in
  a check for $with_gnu_ld.
- environ is only available at runtime, so you need to make a
  reference to _NSGetEnviron instead for symbols to resolve properly.
2008-03-04 10:31:28 -05:00