summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2007-07-24 12:10:58 +0000
committerRichard Hughes <richard@hughsie.com>2007-07-24 12:10:58 +0000
commit6dd454681ab3bbe94d8b5ae5a4d67684f23bc3a9 (patch)
tree939e6f503deacd55f6202bdf56a2cbee4013eb8a
parent5a1865999262af1dabac5bf26c65f805d737461e (diff)
2007-07-24 Richard Hughes <richard@hughsie.com>
* bus/Makefile.am: * bus/test.h: Add the build glue for the lauch helper, and also add the launch-helper OOM checks into make check. I've probably broken the build, give me 2.
-rw-r--r--ChangeLog7
-rw-r--r--bus/Makefile.am85
-rw-r--r--bus/test.h1
3 files changed, 90 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 5b31938a..25e39c1b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2007-07-24 Richard Hughes <richard@hughsie.com>
+ * bus/Makefile.am:
+ * bus/test.h:
+ Add the build glue for the lauch helper, and also add the launch-helper
+ OOM checks into make check. I've probably broken the build, give me 2.
+
+2007-07-24 Richard Hughes <richard@hughsie.com>
+
* bus/test-launch-helper.c: (die), (check_memleaks),
(test_post_hook), (bus_activation_helper_oom_test), (main):
Add a test wrapper to allow OOM checks on the launch helper.
diff --git a/bus/Makefile.am b/bus/Makefile.am
index d8dd22d4..5892e33c 100644
--- a/bus/Makefile.am
+++ b/bus/Makefile.am
@@ -77,21 +77,88 @@ dbus_daemon_LDADD= \
$(DBUS_BUS_LIBS) \
$(top_builddir)/dbus/libdbus-convenience.la
-dbus_daemon_LDFLAGS=@R_DYNAMIC_LDFLAG@
+dbus_daemon_LDFLAGS=@R_DYNAMIC_LDFLAG@ @SECTION_LDFLAGS@
+
+LAUNCH_HELPER_SOURCES= \
+ $(XML_SOURCES) \
+ config-parser-common.c \
+ config-parser-common.h \
+ config-parser-trivial.c \
+ config-parser-trivial.h \
+ desktop-file.c \
+ desktop-file.h \
+ utils.c \
+ utils.h \
+ activation-exit-codes.h \
+ activation-helper.h \
+ activation-helper.c
+
+## This is the installed launch helper with the setuid checks
+dbus_daemon_launch_helper_SOURCES= \
+ activation-helper-bin.c \
+ $(LAUNCH_HELPER_SOURCES)
+
+dbus_daemon_launch_helper_LDADD= \
+ $(DBUS_LAUNCHER_LIBS) \
+ $(top_builddir)/dbus/libdbus-convenience.la
+
+dbus_daemon_launch_helper_LDFLAGS=@R_DYNAMIC_LDFLAG@ @SECTION_LDFLAGS@
+
+## we build another binary so we can do the launch testing without root privs.
+## DO NOT INSTALL THIS FILE
+dbus_daemon_launch_helper_test_SOURCES= \
+ activation-helper-bin.c \
+ $(LAUNCH_HELPER_SOURCES)
+
+dbus_daemon_launch_helper_test_LDADD= \
+ $(DBUS_LAUNCHER_LIBS) \
+ $(top_builddir)/dbus/libdbus-convenience.la
+
+dbus_daemon_launch_helper_test_LDFLAGS=@R_DYNAMIC_LDFLAG@ @SECTION_LDFLAGS@
+dbus_daemon_launch_helper_test_CPPFLAGS= \
+ -DACTIVATION_LAUNCHER_TEST
+
+## we build yet another binary so we can do the OOM tests
+## DO NOT INSTALL THIS FILE
+bus_test_launch_helper_SOURCES= \
+ test-launch-helper.c \
+ $(LAUNCH_HELPER_SOURCES)
+
+bus_test_launch_helper_LDADD= \
+ $(DBUS_LAUNCHER_LIBS) \
+ $(top_builddir)/dbus/libdbus-convenience.la
+
+bus_test_launch_helper_LDFLAGS=@R_DYNAMIC_LDFLAG@ @SECTION_LDFLAGS@
+bus_test_launch_helper_CPPFLAGS= \
+ -DACTIVATION_LAUNCHER_TEST \
+ -DACTIVATION_LAUNCHER_DO_OOM
## note that TESTS has special meaning (stuff to use in make check)
## so if adding tests not to be run in make check, don't add them to
## TESTS
if DBUS_BUILD_TESTS
TESTS_ENVIRONMENT=DBUS_TEST_DATA=$(top_builddir)/test/data DBUS_TEST_HOMEDIR=$(top_builddir)/dbus DBUS_FATAL_WARNINGS=1 DBUS_BLOCK_ON_ABORT=1
-TESTS=bus-test
+TESTS=bus-test bus-test-launch-helper
else
TESTS=
endif
## we use noinst_PROGRAMS not check_PROGRAMS so that we build
## even when not doing "make check"
-noinst_PROGRAMS=$(TESTS) dbus-daemon
+noinst_PROGRAMS=$(TESTS) dbus-daemon dbus-daemon-launch-helper-test dbus-daemon-launch-helper
+
+bus_test_system_SOURCES= \
+ $(XML_SOURCES) \
+ config-parser-common.c \
+ config-parser-common.h \
+ config-parser-trivial.c \
+ config-parser-trivial.h \
+ utils.c \
+ utils.h \
+ test-system.c
+
+bus_test_system_LDADD=$(top_builddir)/dbus/libdbus-convenience.la $(DBUS_BUS_LIBS)
+bus_test_system_LDFLAGS=@R_DYNAMIC_LDFLAG@
bus_test_SOURCES= \
$(BUS_SOURCES) \
@@ -106,6 +173,7 @@ clean-local:
uninstall-hook:
rm -f $(DESTDIR)$(DBUS_DAEMONDIR)/dbus-daemon
+ rm -f $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper
install-data-hook:
if test '!' -d $(DESTDIR)$(DBUS_DAEMONDIR); then \
@@ -117,6 +185,17 @@ install-data-hook:
$(mkinstalldirs) $(DESTDIR)$(configdir)/system.d
$(mkinstalldirs) $(DESTDIR)$(configdir)/session.d
$(mkinstalldirs) $(DESTDIR)$(datadir)/dbus-1/services
+ $(mkinstalldirs) $(DESTDIR)$(datadir)/dbus-1/system-services
+ $(mkinstalldirs) $(DESTDIR)$(libexecdir)/dbus-1
+ $(INSTALL_PROGRAM) dbus-daemon-launch-helper $(DESTDIR)$(libexecdir)
+ ## This is SETUID! <insert suitable warning here...>
+ if test `id -u` -eq 0; then \
+ chown root:$(DBUS_USER) $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper; \
+ chmod 4750 $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper; \
+ else \
+ echo "Not installing $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper binary setuid!"; \
+ echo "You'll need to manually set permissions to root:$(DBUS_USER) and permissions 4750"; \
+ fi
#### Init scripts fun
SCRIPT_IN_FILES=messagebus.in \
diff --git a/bus/test.h b/bus/test.h
index f9478395..5aab0ea9 100644
--- a/bus/test.h
+++ b/bus/test.h
@@ -36,6 +36,7 @@ dbus_bool_t bus_dispatch_test (const DBusString *test_data_d
dbus_bool_t bus_dispatch_sha1_test (const DBusString *test_data_dir);
dbus_bool_t bus_policy_test (const DBusString *test_data_dir);
dbus_bool_t bus_config_parser_test (const DBusString *test_data_dir);
+dbus_bool_t bus_config_parser_trivial_test (const DBusString *test_data_dir);
dbus_bool_t bus_signals_test (const DBusString *test_data_dir);
dbus_bool_t bus_expire_list_test (const DBusString *test_data_dir);
dbus_bool_t bus_activation_service_reload_test (const DBusString *test_data_dir);