Commit graph

825 commits

Author SHA1 Message Date
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
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
John (J5) Palmieri
94bc113117 make shell script more portable (FDO Bug #11667)
2008-01-15  John (J5) Palmieri  <johnp@redhat.com>

	* tests/name-test/run-test.sh: make more portable (FDO Bug #11667)
2008-01-15 16:23:54 -05:00
Simon McVittie
9f22c3e1e8 Bring .gitignore files up to date; add *.o, *~ etc. to top-level .gitignore
CVS ignores these automatically, so they weren't in the .cvsignore when Ryan
converted the repository.
2007-10-10 17:38:00 +01:00
Ryan Lortie
d34905d811 migrate from cvs to git (cvs2svn -> git-svnimport).
2007-09-13  Ryan Lortie  <desrt@desrt.ca>

        migrate from cvs to git (cvs2svn -> git-svnimport).

        * HACKING: update release/branch/tag instructions
        * */.cvsignore: rename to .gitignore

        also, clean up tags and branch names to conform to HACKING
2007-09-13 11:13:40 -04:00
Havoc Pennington
bdbab12123 2007-07-26 Havoc Pennington <hp@redhat.com>
* bus/config-parser-trivial.c (check_return_values): disable a
	test that hardcoded the bus user's name

	* bus/dispatch.c (bus_dispatch_test_conf): remove the "if
	(!use_launcher)" around the tests, they were only failing because
	we didn't pass through all the expected errors from the helper.

	* bus/activation-exit-codes.h
	(BUS_SPAWN_EXIT_CODE_CHILD_SIGNALED): add a code for child segfaulting
	(BUS_SPAWN_EXIT_CODE_GENERIC_FAILURE): make "1" be a generic
	failure code, so if a third party launch helper were written it
	could just always return 1 on failure.
2007-07-26 23:01:14 +00:00
Havoc Pennington
ba38a9b12f fix whitespace 2007-07-26 22:32:09 +00:00
Richard Hughes
5cfa0506c2 2007-07-24 Richard Hughes <richard@hughsie.com>
* configure.in:
* test/Makefile.am:
* test/data/invalid-service-files-system/org.freedesktop.DBus.TestS
uiteNoExec.service.in:
* test/data/invalid-service-files-system/org.freedesktop.DBus.TestS
uiteNoService.service.in:
* test/data/invalid-service-files-system/org.freedesktop.DBus.TestS
uiteNoUser.service.in:
* test/data/valid-config-files-system/debug-allow-all-fail.conf.in:
* test/data/valid-config-files-system/debug-allow-all-pass.conf.in:
* test/data/valid-config-files/debug-allow-all-sha1.conf.in:
* test/data/valid-config-files/debug-allow-all.conf.in:
* test/data/valid-service-files-system/org.freedesktop.DBus.TestSui
teEchoService.service.in:
* test/data/valid-service-files-system/org.freedesktop.DBus.TestSui
teSegfaultService.service.in:
* test/data/valid-service-files-system/org.freedesktop.DBus.TestSui
teShellEchoServiceFail.service.in:
* test/data/valid-service-files-system/org.freedesktop.DBus.TestSui
teShellEchoServiceSuccess.service.in:
* test/data/valid-service-files/debug-echo.service.in:
* test/data/valid-service-files/debug-segfault.service.in:
* test/data/valid-service-files/debug-shell-echo-fail.service.in:
* test/data/valid-service-files/debug-shell-echo-success.service.in:
* test/data/valid-service-files/org.freedesktop.DBus.TestSuiteEchoS
ervice.service.in:
* test/data/valid-service-files/org.freedesktop.DBus.TestSuiteSegfa
ultService.service.in:
* test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShell
EchoServiceFail.service.in:
* test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShell
EchoServiceSuccess.service.in:
Add the data files needed by the system activation unit checks.
2007-07-24 12:48:45 +00:00
Havoc Pennington
d012387afe 2007-07-13 Havoc Pennington <hp@redhat.com>
* Add indent-tabs-mode: nil to all file headers.
2007-07-14 02:44:01 +00:00
Ralf Habacker
f1cb3ee0e7 * dbus/dbus-auth-script.c (_dbus_auth_script_run): added UNIX_ONLY and WIN_ONLY commands for auth scripts
* test/data/auth/external-root.auth-script: limit execution to unix
2007-06-23 07:45:17 +00: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
Havoc Pennington
a789b7b38c 2007-06-09 Havoc Pennington <hp@redhat.com>
* dbus/dbus-string.c (_dbus_string_pop_line): fix this not to
	think an empty line is the end of the file.
	Also, fix some whitespace.

	* dbus/dbus-string-util.c: add more tests for
	_dbus_string_pop_line() revealing that it thinks an empty line is
	the end of the file, which broke dbus-auth-script.c so
	it didn't really run the scripts

	* dbus/dbus-auth.c: add ANONYMOUS mechanism

	* dbus/dbus-auth-script.c (_dbus_auth_script_run): fix to detect
	an empty/no-op auth script; add commands to check that we have or
	don't have the expected credentials
2007-06-10 04:54:45 +00:00
Havoc Pennington
2383267226 2007-06-09 Havoc Pennington <hp@redhat.com>
* bus/dispatch.c (check_get_connection_unix_process_id): adapt
	since sysdeps-unix.h stuff isn't included anymore

	* bus/bus.c (bus_context_new): use more abstract functions to
	change user, so they can be no-ops on Windows

	* dbus/dbus-credentials.c, dbus/dbus-credentials.h,
	dbus/dbus-credentials-util.c: new files containing a fully opaque
	DBusCredentials data type to replace the old not opaque one.

	* configure.in (DBUS_UNIX): define DBUS_UNIX to match DBUS_WIN on
	windows

	* dbus/dbus-userdb.h: prohibit on Windows, next step is to clean
	up the uses of it in bus/*.c and factor out the parts of
	cookie auth that depend on it
2007-06-09 21:53:20 +00:00
Simon McVittie
6b4bd7d2e9 tools/.cvsignore: Ignore all currently built files.
test/name-test/.cvsignore: New file, ditto.
2007-05-21 16:50:13 +00:00
Ralf Habacker
892780c35e * configure.in, cmake/ConfigureChecks.cmake: added check for setrlimit.
* test/test-segfault.c: only include setrlimit stuff only when available.
2007-03-08 08:17:25 +00:00
Ralf Habacker
42fe5c9341 * test/test-segfault.c: unix compile fix.
* dbus-win.patch: removed obsolate patch.
2007-03-07 19:09:57 +00:00