Commit graph

944 commits

Author SHA1 Message Date
Simon McVittie
e529c4bcdb test_server_setup: allocate two server-data blobs, for watches and timeouts
This is similar to how ConnectionData works. Without this change, we
deserve to segfault: when the first set of callbacks (either watches or
timeouts) is cleaned up, we unref the server and loop, and free sd;
when the second set of callbacks is cleaned up, we use-after-free sd,
the server and the loop, then double-free sd.

However, due to fd.o #33277 we don't even get that far, because we've
already died with an assertion failure.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33277
2011-01-21 14:22:39 +00:00
Simon McVittie
c894f62f2c test_server_setup: on OOM while setting up watch/timeout, don't leak sd
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33128
Reviwed-by: Colin Walters <walters@verbum.org>
2011-01-21 13:28:08 +00:00
Simon McVittie
e870df7b82 Add autolaunch test to .gitignore 2011-01-06 17:35:35 +00:00
Will Thompson
f2905def7b policy tests: Use bin rather than nogroup, wheel, or root
This group seems to exist on all of Debian, Fedora and Mac OS X. (I
mistakenly believed that nogroup exists on Fedora.)
2010-12-17 18:42:13 +00:00
Will Thompson
c3a94b57c8 Revert "test-autolaunch is only known to work in launchd environments."
This reverts commit 4626b40560.
test-autolaunch works fine in non-launchd environments (and non-X11
environments, based on a quick test passing enable_x11=no to configure).
On the contrary: this commit *broke* the build on non-launchd
environments, because test/name-test/run-test.sh still tried to run this
test even if it hadn't been built.
2010-12-15 09:43:17 +01:00
Will Thompson
844134faee policy tests: Use 'nogroup' rather than 'wheel' or 'root'
The excellently-titled commit 197bef8 “Fix test failures on OSX.” broke
the tests on Linux, since there's no wheel group on this side of the
tracks. So here's a group everyone should enjoy.

(If anyone comes along and tells me that DragonflyBSD doesn't have
'nogroup' …)
2010-12-15 09:42:55 +01:00
Mike McQuaid
197bef8277 Fix test failures on OSX. 2010-12-04 23:49:39 +01:00
Mike McQuaid
4626b40560 test-autolaunch is only known to work in launchd environments. 2010-12-04 23:47:35 +01:00
Colin Walters
aff6263561 Added a test-autolaunch.
* test/name-test/test-autolaunch.c: New file,
	unsets DBUS_SESSION_BUS_ADDRESS so we should
	fall back to autolaunch:.
	* test/name-test/run-test.sh: Run it.
	* test/name-test/Makefile.am: Build it.
2010-12-04 23:03:13 +01:00
Will Thompson
92ac7113d3 Update a load of .gitignores 2010-10-05 11:45:48 +01:00
Will Thompson
4d8c0c3074 Silence silent build a bit more. 2010-10-05 11:45:48 +01:00
Colin Walters
45d53565bc Make dbus-uuidgen atomic
A Red Hat QA engineer hit in practice a race condition in dbus-uuidgen
where it could leave an empty file.

dbus-uuidgen (_dbus_create_uuid_file_exclusively) formerly created an
empty file in the path to the uuid, then filled it in.  At some point,
the internal libdbus _dbus_string_save_to_file became atomic on Unix
at least (doing the save to temp file, fsync(), rename() dance).

So _dbus_create_uuid_file_exclusively doesn't need to create the file
beforehand anymore.  However, it *does* need the file to be
world-readable, unlike all other consumers of
_dbus_string_save_to_file.  So add a "world_readable" argument.
2010-09-03 14:29:53 -04:00
Yaakov Selkowitz
aec82e2edd Applied patches from cygwin port. 2010-08-10 08:25:24 +02:00
Ralf Habacker
ec18f1fc89 Port test-privserver to windows by using the TEST_LISTEN bus address. 2010-04-13 21:15:41 +02:00
Ralf Habacker
0ed7d779b7 Cmake support for cross plattform usable test files.
Recent test configuration files contains 'unix:...'
bus adresses which do not work on windows.
For cross plattform usable test files the whole
listen tag entry has to be set by the build system,
which is available with a new build system variable
named TEST_LISTEN.
To have the client client side definition in sync,
TEST_CONNECTION has been moved from c file into cmake
build system.
2010-04-11 11:49:46 +02:00
Ralf Habacker
ca7b8112c9 Renamed libdbus-convenience to libdbus-internal for automake (to stay in sync with cmake). 2010-03-23 09:21:48 +01:00
Marcus Brinkmann
1de6b09fbd Update dll export for autoconf (to stay in sync with cmake). 2010-03-23 09:10:39 +01:00
Colin Walters
df89cfeb38 Merge branch 'dbus-1.2'
Conflicts:
	bus/dispatch.c
	configure.in
	test/name-test/test-names.c
2010-03-22 14:39:56 -04:00
Marcus Brinkmann
01d9d169f3 Make more signal and locale interface use conditional. 2010-03-22 17:28:55 +01:00
Marcus Brinkmann
dbecdeabb2 Consistently include <config.h> in all C source files and never in header files. 2010-03-19 20:11:48 +01:00
Colin Walters
d47154c28b Delete name-test/test-names
This test, while extensive, has the serious flaw of effectively
spinning on _dbus_connection_do_iteration_unlocked.  Any tests
like this should be using the internal DBus mainloop, which
I don't have time to port it to before doing a release.
2010-03-16 22:25:40 -04:00
Colin Walters
7a4cd46284 Merge branch 'my-dbus-1.2'
Conflicts:
	bus/Makefile.am
	dbus/dbus-sysdeps-util-unix.c
	dbus/dbus-transport.c
	test/test-service.c
2010-01-28 17:09:15 -05:00
Colin Walters
b7e77c6b03 Ignore exit code zero from activated services
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>
2010-01-28 17:01:24 -05:00
Ralf Habacker
be51ff7e5e windows does not support fork, skip it 2009-12-18 16:45:50 +01:00
Colin Walters
949a64b127 Ignore exit code zero from activated services
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>
2009-12-15 13:08:02 -05:00
Ralf Habacker
f27dd9b8f2 fixed memory leak 2009-12-07 10:16:10 +01:00
Ralf Habacker
4a24e84aa7 readded test files required for windows 2009-12-01 10:53:53 +01:00
Marc Mutz
a871d0f42e Makefile.am's: reorder libraries so static libs come first (fixes linking on W32) (cherry picked from commit f88bd88d6b4b318f9401fae595343c8b1bacf654) 2009-12-01 08:36:29 +01:00
Ralf Habacker
fd049c3455 use dbus provided wait function 2009-11-30 16:00:20 +01:00
Frank Osterfeld
fa2a53309d fix warning, use Sleep, not _sleep on windows (cherry picked from commit ea36c743ad60a2dd5c6286571d1a475903519809) 2009-11-30 12:00:14 +01:00
Colin Watson
be89ffacc9 Fix link order: system libraries should come after libdbus-convenience
libdbus-convenience may use system libraries, but not the other way
round. Most platforms don't care, but on some platforms this means that
system libraries need to be listed after libdbus-convenience.la on the
link line.
2009-09-18 21:12:39 +02:00
Thiago Macieira
4a342d711f Fix running tests when builddir != srcdir.
This script is not deployed to the builddir, so it cannot be
run with relative paths.
2009-07-16 16:35:22 +02:00
Tobias Mueller
dc33f4f774 Bug 21161 - Update the FSF address
No comment.

Signed-off-by: Colin Walters <walters@verbum.org>
(cherry picked from commit 5baf2f856a)
2009-07-14 15:39:47 -04:00
Colin Walters
576a87dc5a Add missing include for unistd.h in test-service.c
We use usleep here.
(cherry picked from commit e5310abd6c)
2009-07-14 15:39:33 -04:00
Scott James Remnant
0539a23c66 Add tests for pending call timeouts
* test/test-service.c (handle_delay_echo, path_message_func): Add a
  variant of the Echo method which sleeps for a short time.
* test/name-test/test-pending-call-timeout.c: Run tests with default,
  specified and infinite timeout to make sure we get the reply.
* test/name-test/run-test.sh: Run the new test
* test/name-test/Makefile.am: Build the new test

Signed-off-by: Scott James Remnant <scott@ubuntu.com>
(cherry picked from commit c1f165261a)
2009-07-14 15:38:42 -04:00
Tobias Mueller
5baf2f856a Bug 21161 - Update the FSF address
No comment.

Signed-off-by: Colin Walters <walters@verbum.org>
2009-07-10 19:32:38 -04:00
Colin Walters
e5310abd6c Add missing include for unistd.h in test-service.c
We use usleep here.
2009-07-10 19:22:54 -04:00
Scott James Remnant
c1f165261a Add tests for pending call timeouts
* test/test-service.c (handle_delay_echo, path_message_func): Add a
  variant of the Echo method which sleeps for a short time.
* test/name-test/test-pending-call-timeout.c: Run tests with default,
  specified and infinite timeout to make sure we get the reply.
* test/name-test/run-test.sh: Run the new test
* test/name-test/Makefile.am: Build the new test

Signed-off-by: Scott James Remnant <scott@ubuntu.com>
2009-05-28 11:47:38 +02:00
Kjartan Maraas
eb3b99e7c6 Bug 19502 - Sparse warning cleanups
This patch makes various things that should be static static,
corrects some "return FALSE" where it should be NULL, etc.

Signed-off-by: Colin Walters <walters@verbum.org>
2009-05-06 12:51:18 -04:00
Kjartan Maraas
3c89788fa4 Bug 19502 - Sparse warning cleanups
This patch makes various things that should be static static,
corrects some "return FALSE" where it should be NULL, etc.

Signed-off-by: Colin Walters <walters@verbum.org>
2009-04-21 13:10:10 -04:00
Colin Walters
dc77c21374 Clean up and clarify default system policy
The former was too reliant on old bugs and was generally unclear.
This one makes explicit exactly what is allowed and not.
2008-12-18 15:34:24 -05:00
Colin Walters
c224ba1861 Merge commit '3d6abf64d0abb2718e082e120f14f8f923a4af59' into dbus-1.2 2008-12-16 12:29:04 -05:00
Colin Walters
69ed32cbcc Add syslog of security denials and configuration file reloads
We need to start logging denials so that they become more easily trackable
and debuggable.
2008-12-12 15:18:12 -05:00
Colin Walters
3d6abf64d0 Clean up and clarify default system policy
The former was too reliant on old bugs and was generally unclear.
This one makes explicit exactly what is allowed and not.
2008-12-12 14:50:21 -05:00
Colin Walters
bb2a464067 Add syslog of security denials and configuration file reloads
We need to start logging denials so that they become more easily trackable
and debuggable.
2008-12-12 14:00:16 -05:00
Colin Walters
d899734475 Bug 18229: Allow signals
Our previous fix went too far towards lockdown; many things rely
on signals to work, and there's no really good reason to restrict
which signals can be emitted on the bus because we can't tie
them to a particular sender.
2008-12-09 10:17:36 -05:00
Colin Walters
920c3c0292 Bug 18229: Allow signals
Our previous fix went too far towards lockdown; many things rely
on signals to work, and there's no really good reason to restrict
which signals can be emitted on the bus because we can't tie
them to a particular sender.
2008-12-09 09:15:06 -05:00
Colin Walters
c5526c18ad Infrastructure for testing a "system like" bus in test suite
The tmp-session-like-system.conf bus configuration has a security
policy intended to mirror that of the system bus.  This allows
testing policy rules.
2008-12-05 11:39:36 -05:00
Colin Walters
4a436c3554 Infrastructure for testing a "system like" bus in test suite
The tmp-session-like-system.conf bus configuration has a security
policy intended to mirror that of the system bus.  This allows
testing policy rules.
2008-12-05 11:30:50 -05: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