summaryrefslogtreecommitdiff
path: root/bus
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2011-06-01 15:11:01 +0100
committerSimon McVittie <smcv@debian.org>2011-06-01 15:11:01 +0100
commite034e2bbd4352a21b7f5bf9d4d89f7a41c78cb03 (patch)
tree6dbcb05ff39c830bec9bb80e0a65aeb6679772d5 /bus
parentb03dfc9ec734204fa8f5e2a6fa75ad2a1973e346 (diff)
downloaddbus-e034e2bbd4352a21b7f5bf9d4d89f7a41c78cb03.tar.gz
Imported Upstream version 1.4.10upstream/1.4.10
Diffstat (limited to 'bus')
-rw-r--r--bus/Makefile.am75
-rw-r--r--bus/Makefile.in212
-rw-r--r--bus/activation.c68
-rw-r--r--bus/bus.c228
-rw-r--r--bus/selinux.c3
-rw-r--r--bus/test-main.c9
6 files changed, 334 insertions, 261 deletions
diff --git a/bus/Makefile.am b/bus/Makefile.am
index efa8ab5b..dfb3bc34 100644
--- a/bus/Makefile.am
+++ b/bus/Makefile.am
@@ -1,8 +1,9 @@
-
configdir=$(sysconfdir)/dbus-1
+dbus_daemon_execdir = $(DBUS_DAEMONDIR)
-INCLUDES=-I$(top_srcdir) $(DBUS_BUS_CFLAGS) @PIE_CFLAGS@ \
- -DDBUS_SYSTEM_CONFIG_FILE=\""$(configdir)/system.conf"\" \
+INCLUDES = -I$(top_srcdir) \
+ $(DBUS_BUS_CFLAGS) \
+ -DDBUS_SYSTEM_CONFIG_FILE=\""$(configdir)/system.conf"\" \
-DDBUS_COMPILATION
EFENCE=
@@ -88,7 +89,7 @@ dbus_daemon_LDADD= \
$(EFENCE) \
$(DBUS_BUS_LIBS)
-dbus_daemon_LDFLAGS=@R_DYNAMIC_LDFLAG@ @SECTION_LDFLAGS@ @PIE_LDFLAGS@
+dbus_daemon_LDFLAGS=@R_DYNAMIC_LDFLAG@ @SECTION_LDFLAGS@
LAUNCH_HELPER_SOURCES= \
$(XML_SOURCES) \
@@ -145,31 +146,28 @@ bus_test_launch_helper_CPPFLAGS= -DDBUS_STATIC_BUILD \
-DACTIVATION_LAUNCHER_TEST \
-DACTIVATION_LAUNCHER_DO_OOM
-extra_tests=
-extra_noinst_programs=
-extra_inst_programs=
-if DBUS_UNIX
-extra_tests+=bus-test-launch-helper
-extra_noinst_programs+=dbus-daemon-launch-helper dbus-daemon-launch-helper-test dbus-daemon
-endif
-if DBUS_WIN
-extra_inst_programs+=dbus-daemon
-endif
+## we use noinst_PROGRAMS not check_PROGRAMS so that we build
+## even when not doing "make check"
+noinst_PROGRAMS = $(TESTS)
+dbus_daemon_exec_PROGRAMS = dbus-daemon
+libexec_PROGRAMS = dbus-daemon-launch-helper
## 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
+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 bus-test-system $(extra_tests)
-else
-TESTS=
-endif
+TESTS += bus-test bus-test-system
-## we use noinst_PROGRAMS not check_PROGRAMS so that we build
-## even when not doing "make check"
-noinst_PROGRAMS=$(TESTS) $(extra_noinst_programs)
-bin_PROGRAMS=$(extra_inst_programs)
+if DBUS_UNIX
+TESTS += bus-test-launch-helper
+# this is used by the tests but is not,itself, a test
+noinst_PROGRAMS += dbus-daemon-launch-helper-test
+endif DBUS_UNIX
+
+endif DBUS_BUILD_TESTS
bus_test_system_SOURCES= \
$(XML_SOURCES) \
@@ -197,34 +195,12 @@ bus_test_LDFLAGS=@R_DYNAMIC_LDFLAG@
clean-local:
/bin/rm *.bb *.bbg *.da *.gcov || true
-uninstall-hook:
- rm -f $(DESTDIR)$(DBUS_DAEMONDIR)/dbus-daemon$(EXEEXT)
- rm -f $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper$(EXEEXT)
-
install-data-hook:
$(mkinstalldirs) $(DESTDIR)$(localstatedir)/run/dbus
$(mkinstalldirs) $(DESTDIR)$(configdir)/system.d
$(mkinstalldirs) $(DESTDIR)$(configdir)/session.d
$(mkinstalldirs) $(DESTDIR)$(datadir)/dbus-1/services
$(mkinstalldirs) $(DESTDIR)$(datadir)/dbus-1/system-services
-if DBUS_UNIX
- if test '!' -d $(DESTDIR)$(DBUS_DAEMONDIR); then \
- $(mkinstalldirs) $(DESTDIR)$(DBUS_DAEMONDIR); \
- chmod 755 $(DESTDIR)$(DBUS_DAEMONDIR); \
- fi
- $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) dbus-daemon$(EXEEXT) $(DESTDIR)$(DBUS_DAEMONDIR)
- $(mkinstalldirs) $(DESTDIR)$(libexecdir)/dbus-1
- if test -f dbus-daemon-launch-helper$(EXEEXT) ; then \
- $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) dbus-daemon-launch-helper$(EXEEXT) $(DESTDIR)$(libexecdir); \
- if test `id -u` -eq 0; then \
- chown root:$(DBUS_USER) $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper$(EXEEXT); \
- chmod 4750 $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper$(EXEEXT); \
- 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 \
- fi
-endif
if HAVE_SYSTEMD
# Install dbus.socket as default implementation of a D-Bus stack
$(mkinstalldirs) $(DESTDIR)$(systemdsystemunitdir)/dbus.target.wants
@@ -236,6 +212,17 @@ if HAVE_SYSTEMD
$(LN_S) ../dbus.service $(DESTDIR)$(systemdsystemunitdir)/multi-user.target.wants/dbus.service
endif
+if DBUS_UNIX
+install-exec-hook:
+ if test `id -u` -eq 0; then \
+ chown root:$(DBUS_USER) $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper$(EXEEXT); \
+ chmod 4750 $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper$(EXEEXT); \
+ 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
+endif
+
#### Init scripts fun
SCRIPT_IN_FILES=messagebus.in \
messagebus-config.in \
diff --git a/bus/Makefile.in b/bus/Makefile.in
index cd5a08b9..c0cc941a 100644
--- a/bus/Makefile.in
+++ b/bus/Makefile.in
@@ -36,14 +36,14 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-@DBUS_UNIX_TRUE@am__append_1 = bus-test-launch-helper
-@DBUS_UNIX_TRUE@am__append_2 = dbus-daemon-launch-helper dbus-daemon-launch-helper-test dbus-daemon
-@DBUS_WIN_TRUE@am__append_3 = dbus-daemon
-@DBUS_BUILD_TESTS_TRUE@TESTS = bus-test$(EXEEXT) \
-@DBUS_BUILD_TESTS_TRUE@ bus-test-system$(EXEEXT) \
-@DBUS_BUILD_TESTS_TRUE@ $(am__EXEEXT_4)
-noinst_PROGRAMS = $(am__EXEEXT_5) $(am__EXEEXT_7)
-bin_PROGRAMS = $(am__EXEEXT_2)
+noinst_PROGRAMS = $(am__EXEEXT_3) $(am__EXEEXT_4)
+dbus_daemon_exec_PROGRAMS = dbus-daemon$(EXEEXT)
+libexec_PROGRAMS = dbus-daemon-launch-helper$(EXEEXT)
+TESTS = $(am__EXEEXT_1) $(am__EXEEXT_2)
+@DBUS_BUILD_TESTS_TRUE@am__append_1 = bus-test bus-test-system
+@DBUS_BUILD_TESTS_TRUE@@DBUS_UNIX_TRUE@am__append_2 = bus-test-launch-helper
+# this is used by the tests but is not,itself, a test
+@DBUS_BUILD_TESTS_TRUE@@DBUS_UNIX_TRUE@am__append_3 = dbus-daemon-launch-helper-test
@HAVE_SYSTEMD_TRUE@am__append_4 = \
@HAVE_SYSTEMD_TRUE@ dbus.service.in \
@HAVE_SYSTEMD_TRUE@ dbus.socket.in
@@ -60,7 +60,9 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \
$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
- $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/tp-compiler-flag.m4 \
+ $(top_srcdir)/m4/tp-compiler-warnings.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -69,21 +71,17 @@ CONFIG_CLEAN_FILES = system.conf session.conf messagebus \
messagebus-config org.freedesktop.dbus-session.plist \
rc.messagebus dbus.service dbus.socket
CONFIG_CLEAN_VPATH_FILES =
-@DBUS_WIN_TRUE@am__EXEEXT_1 = dbus-daemon$(EXEEXT)
-am__EXEEXT_2 = $(am__EXEEXT_1)
-am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" \
+am__installdirs = "$(DESTDIR)$(dbus_daemon_execdir)" \
+ "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(bindir)" \
"$(DESTDIR)$(initddir)" "$(DESTDIR)$(agentdir)" \
"$(DESTDIR)$(configdir)" "$(DESTDIR)$(systemdsystemunitdir)"
-@DBUS_UNIX_TRUE@am__EXEEXT_3 = bus-test-launch-helper$(EXEEXT)
-am__EXEEXT_4 = $(am__EXEEXT_3)
-@DBUS_BUILD_TESTS_TRUE@am__EXEEXT_5 = bus-test$(EXEEXT) \
-@DBUS_BUILD_TESTS_TRUE@ bus-test-system$(EXEEXT) \
-@DBUS_BUILD_TESTS_TRUE@ $(am__EXEEXT_4)
-@DBUS_UNIX_TRUE@am__EXEEXT_6 = dbus-daemon-launch-helper$(EXEEXT) \
-@DBUS_UNIX_TRUE@ dbus-daemon-launch-helper-test$(EXEEXT) \
-@DBUS_UNIX_TRUE@ dbus-daemon$(EXEEXT)
-am__EXEEXT_7 = $(am__EXEEXT_6)
-PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
+@DBUS_BUILD_TESTS_TRUE@am__EXEEXT_1 = bus-test$(EXEEXT) \
+@DBUS_BUILD_TESTS_TRUE@ bus-test-system$(EXEEXT)
+@DBUS_BUILD_TESTS_TRUE@@DBUS_UNIX_TRUE@am__EXEEXT_2 = bus-test-launch-helper$(EXEEXT)
+am__EXEEXT_3 = $(am__EXEEXT_1) $(am__EXEEXT_2)
+@DBUS_BUILD_TESTS_TRUE@@DBUS_UNIX_TRUE@am__EXEEXT_4 = dbus-daemon-launch-helper-test$(EXEEXT)
+PROGRAMS = $(dbus_daemon_exec_PROGRAMS) $(libexec_PROGRAMS) \
+ $(noinst_PROGRAMS)
am__bus_test_SOURCES_DIST = activation.c activation.h \
activation-exit-codes.h bus.c bus.h config-parser.c \
config-parser.h config-parser-common.c config-parser-common.h \
@@ -367,6 +365,7 @@ DBUS_X_CFLAGS = @DBUS_X_CFLAGS@
DBUS_X_LIBS = @DBUS_X_LIBS@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
DOXYGEN = @DOXYGEN@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
@@ -408,6 +407,7 @@ LT_REVISION = @LT_REVISION@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MAN2HTML = @MAN2HTML@
+MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
@@ -423,15 +423,10 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
-PIC_CFLAGS = @PIC_CFLAGS@
-PIC_LDFLAGS = @PIC_LDFLAGS@
-PIE_CFLAGS = @PIE_CFLAGS@
-PIE_LDFLAGS = @PIE_LDFLAGS@
PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
RC = @RC@
R_DYNAMIC_LDFLAG = @R_DYNAMIC_LDFLAG@
-SECTION_FLAGS = @SECTION_FLAGS@
SECTION_LDFLAGS = @SECTION_LDFLAGS@
SED = @SED@
SET_MAKE = @SET_MAKE@
@@ -463,6 +458,7 @@ abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -496,7 +492,6 @@ libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
@@ -514,8 +509,10 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
configdir = $(sysconfdir)/dbus-1
-INCLUDES = -I$(top_srcdir) $(DBUS_BUS_CFLAGS) @PIE_CFLAGS@ \
- -DDBUS_SYSTEM_CONFIG_FILE=\""$(configdir)/system.conf"\" \
+dbus_daemon_execdir = $(DBUS_DAEMONDIR)
+INCLUDES = -I$(top_srcdir) \
+ $(DBUS_BUS_CFLAGS) \
+ -DDBUS_SYSTEM_CONFIG_FILE=\""$(configdir)/system.conf"\" \
-DDBUS_COMPILATION
EFENCE =
@@ -582,7 +579,7 @@ dbus_daemon_LDADD = \
$(EFENCE) \
$(DBUS_BUS_LIBS)
-dbus_daemon_LDFLAGS = @R_DYNAMIC_LDFLAG@ @SECTION_LDFLAGS@ @PIE_LDFLAGS@
+dbus_daemon_LDFLAGS = @R_DYNAMIC_LDFLAG@ @SECTION_LDFLAGS@
LAUNCH_HELPER_SOURCES = \
$(XML_SOURCES) \
config-parser-common.c \
@@ -632,9 +629,6 @@ bus_test_launch_helper_CPPFLAGS = -DDBUS_STATIC_BUILD \
-DACTIVATION_LAUNCHER_TEST \
-DACTIVATION_LAUNCHER_DO_OOM
-extra_tests = $(am__append_1)
-extra_noinst_programs = $(am__append_2)
-extra_inst_programs = $(am__append_3)
@DBUS_BUILD_TESTS_TRUE@TESTS_ENVIRONMENT = DBUS_TEST_DATA=$(top_builddir)/test/data DBUS_TEST_HOMEDIR=$(top_builddir)/dbus DBUS_FATAL_WARNINGS=1 DBUS_BLOCK_ON_ABORT=1
bus_test_system_SOURCES = \
$(XML_SOURCES) \
@@ -728,10 +722,10 @@ dbus.service: $(top_builddir)/config.status $(srcdir)/dbus.service.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
dbus.socket: $(top_builddir)/config.status $(srcdir)/dbus.socket.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-install-binPROGRAMS: $(bin_PROGRAMS)
+install-dbus_daemon_execPROGRAMS: $(dbus_daemon_exec_PROGRAMS)
@$(NORMAL_INSTALL)
- test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
- @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ test -z "$(dbus_daemon_execdir)" || $(MKDIR_P) "$(DESTDIR)$(dbus_daemon_execdir)"
+ @list='$(dbus_daemon_exec_PROGRAMS)'; test -n "$(dbus_daemon_execdir)" || list=; \
for p in $$list; do echo "$$p $$p"; done | \
sed 's/$(EXEEXT)$$//' | \
while read p p1; do if test -f $$p || test -f $$p1; \
@@ -748,23 +742,66 @@ install-binPROGRAMS: $(bin_PROGRAMS)
while read type dir files; do \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
test -z "$$files" || { \
- echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
- $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(dbus_daemon_execdir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(dbus_daemon_execdir)$$dir" || exit $$?; \
} \
; done
-uninstall-binPROGRAMS:
+uninstall-dbus_daemon_execPROGRAMS:
@$(NORMAL_UNINSTALL)
- @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ @list='$(dbus_daemon_exec_PROGRAMS)'; test -n "$(dbus_daemon_execdir)" || list=; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-e 's/$$/$(EXEEXT)/' `; \
test -n "$$list" || exit 0; \
- echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
- cd "$(DESTDIR)$(bindir)" && rm -f $$files
+ echo " ( cd '$(DESTDIR)$(dbus_daemon_execdir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(dbus_daemon_execdir)" && rm -f $$files
+
+clean-dbus_daemon_execPROGRAMS:
+ @list='$(dbus_daemon_exec_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+install-libexecPROGRAMS: $(libexec_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(libexecdir)" || $(MKDIR_P) "$(DESTDIR)$(libexecdir)"
+ @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p || test -f $$p1; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \
+ } \
+ ; done
-clean-binPROGRAMS:
- @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+uninstall-libexecPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(libexecdir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(libexecdir)" && rm -f $$files
+
+clean-libexecPROGRAMS:
+ @list='$(libexec_PROGRAMS)'; test -n "$$list" || exit 0; \
echo " rm -f" $$list; \
rm -f $$list || exit $$?; \
test -n "$(EXEEXT)" || exit 0; \
@@ -2401,7 +2438,7 @@ check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(DATA)
installdirs:
- for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(initddir)" "$(DESTDIR)$(agentdir)" "$(DESTDIR)$(configdir)" "$(DESTDIR)$(systemdsystemunitdir)"; do \
+ for dir in "$(DESTDIR)$(dbus_daemon_execdir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(initddir)" "$(DESTDIR)$(agentdir)" "$(DESTDIR)$(configdir)" "$(DESTDIR)$(systemdsystemunitdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
@@ -2429,9 +2466,11 @@ distclean-generic:
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
+@DBUS_UNIX_FALSE@install-exec-hook:
clean: clean-am
-clean-am: clean-binPROGRAMS clean-generic clean-libtool clean-local \
+clean-am: clean-dbus_daemon_execPROGRAMS clean-generic \
+ clean-libexecPROGRAMS clean-libtool clean-local \
clean-noinstPROGRAMS mostlyclean-am
distclean: distclean-am
@@ -2460,8 +2499,10 @@ install-dvi: install-dvi-am
install-dvi-am:
-install-exec-am: install-binPROGRAMS install-binSCRIPTS
-
+install-exec-am: install-binSCRIPTS install-dbus_daemon_execPROGRAMS \
+ install-libexecPROGRAMS
+ @$(NORMAL_INSTALL)
+ $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
install-html: install-html-am
install-html-am:
@@ -2500,62 +2541,46 @@ ps: ps-am
ps-am:
-uninstall-am: uninstall-agentDATA uninstall-binPROGRAMS \
- uninstall-binSCRIPTS uninstall-configDATA \
- uninstall-initdSCRIPTS uninstall-systemdsystemunitDATA
- @$(NORMAL_INSTALL)
- $(MAKE) $(AM_MAKEFLAGS) uninstall-hook
-.MAKE: check-am install-am install-data-am install-strip uninstall-am
+uninstall-am: uninstall-agentDATA uninstall-binSCRIPTS \
+ uninstall-configDATA uninstall-dbus_daemon_execPROGRAMS \
+ uninstall-initdSCRIPTS uninstall-libexecPROGRAMS \
+ uninstall-systemdsystemunitDATA
+
+.MAKE: check-am install-am install-data-am install-exec-am \
+ install-strip
.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
- clean-binPROGRAMS clean-generic clean-libtool clean-local \
+ clean-dbus_daemon_execPROGRAMS clean-generic \
+ clean-libexecPROGRAMS clean-libtool clean-local \
clean-noinstPROGRAMS ctags distclean distclean-compile \
distclean-generic distclean-libtool distclean-tags distdir dvi \
dvi-am html html-am info info-am install install-agentDATA \
- install-am install-binPROGRAMS install-binSCRIPTS \
- install-configDATA install-data install-data-am \
- install-data-hook install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-initdSCRIPTS install-man install-pdf \
- install-pdf-am install-ps install-ps-am install-strip \
- install-systemdsystemunitDATA installcheck installcheck-am \
- installdirs maintainer-clean maintainer-clean-generic \
- mostlyclean mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
- uninstall-agentDATA uninstall-am uninstall-binPROGRAMS \
- uninstall-binSCRIPTS uninstall-configDATA uninstall-hook \
- uninstall-initdSCRIPTS uninstall-systemdsystemunitDATA
+ install-am install-binSCRIPTS install-configDATA install-data \
+ install-data-am install-data-hook \
+ install-dbus_daemon_execPROGRAMS install-dvi install-dvi-am \
+ install-exec install-exec-am install-exec-hook install-html \
+ install-html-am install-info install-info-am \
+ install-initdSCRIPTS install-libexecPROGRAMS install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip install-systemdsystemunitDATA installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-agentDATA uninstall-am \
+ uninstall-binSCRIPTS uninstall-configDATA \
+ uninstall-dbus_daemon_execPROGRAMS uninstall-initdSCRIPTS \
+ uninstall-libexecPROGRAMS uninstall-systemdsystemunitDATA
clean-local:
/bin/rm *.bb *.bbg *.da *.gcov || true
-uninstall-hook:
- rm -f $(DESTDIR)$(DBUS_DAEMONDIR)/dbus-daemon$(EXEEXT)
- rm -f $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper$(EXEEXT)
-
install-data-hook:
$(mkinstalldirs) $(DESTDIR)$(localstatedir)/run/dbus
$(mkinstalldirs) $(DESTDIR)$(configdir)/system.d
$(mkinstalldirs) $(DESTDIR)$(configdir)/session.d
$(mkinstalldirs) $(DESTDIR)$(datadir)/dbus-1/services
$(mkinstalldirs) $(DESTDIR)$(datadir)/dbus-1/system-services
-@DBUS_UNIX_TRUE@ if test '!' -d $(DESTDIR)$(DBUS_DAEMONDIR); then \
-@DBUS_UNIX_TRUE@ $(mkinstalldirs) $(DESTDIR)$(DBUS_DAEMONDIR); \
-@DBUS_UNIX_TRUE@ chmod 755 $(DESTDIR)$(DBUS_DAEMONDIR); \
-@DBUS_UNIX_TRUE@ fi
-@DBUS_UNIX_TRUE@ $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) dbus-daemon$(EXEEXT) $(DESTDIR)$(DBUS_DAEMONDIR)
-@DBUS_UNIX_TRUE@ $(mkinstalldirs) $(DESTDIR)$(libexecdir)/dbus-1
-@DBUS_UNIX_TRUE@ if test -f dbus-daemon-launch-helper$(EXEEXT) ; then \
-@DBUS_UNIX_TRUE@ $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) dbus-daemon-launch-helper$(EXEEXT) $(DESTDIR)$(libexecdir); \
-@DBUS_UNIX_TRUE@ if test `id -u` -eq 0; then \
-@DBUS_UNIX_TRUE@ chown root:$(DBUS_USER) $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper$(EXEEXT); \
-@DBUS_UNIX_TRUE@ chmod 4750 $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper$(EXEEXT); \
-@DBUS_UNIX_TRUE@ else \
-@DBUS_UNIX_TRUE@ echo "Not installing $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper binary setuid!"; \
-@DBUS_UNIX_TRUE@ echo "You'll need to manually set permissions to root:$(DBUS_USER) and permissions 4750"; \
-@DBUS_UNIX_TRUE@ fi \
-@DBUS_UNIX_TRUE@ fi
# Install dbus.socket as default implementation of a D-Bus stack
@HAVE_SYSTEMD_TRUE@ $(mkinstalldirs) $(DESTDIR)$(systemdsystemunitdir)/dbus.target.wants
@HAVE_SYSTEMD_TRUE@ $(LN_S) ../dbus.socket $(DESTDIR)$(systemdsystemunitdir)/dbus.target.wants/dbus.socket
@@ -2565,6 +2590,15 @@ install-data-hook:
@HAVE_SYSTEMD_TRUE@ $(mkinstalldirs) $(DESTDIR)$(systemdsystemunitdir)/multi-user.target.wants
@HAVE_SYSTEMD_TRUE@ $(LN_S) ../dbus.service $(DESTDIR)$(systemdsystemunitdir)/multi-user.target.wants/dbus.service
+@DBUS_UNIX_TRUE@install-exec-hook:
+@DBUS_UNIX_TRUE@ if test `id -u` -eq 0; then \
+@DBUS_UNIX_TRUE@ chown root:$(DBUS_USER) $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper$(EXEEXT); \
+@DBUS_UNIX_TRUE@ chmod 4750 $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper$(EXEEXT); \
+@DBUS_UNIX_TRUE@ else \
+@DBUS_UNIX_TRUE@ echo "Not installing $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper binary setuid!"; \
+@DBUS_UNIX_TRUE@ echo "You'll need to manually set permissions to root:$(DBUS_USER) and permissions 4750"; \
+@DBUS_UNIX_TRUE@ fi
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/bus/activation.c b/bus/activation.c
index ab6ef51e..3177d023 100644
--- a/bus/activation.c
+++ b/bus/activation.c
@@ -1106,6 +1106,10 @@ bus_activation_service_created (BusActivation *activation,
if (!pending_activation)
return TRUE;
+ bus_context_log (activation->context,
+ DBUS_SYSTEM_LOG_INFO, "Successfully activated service '%s'",
+ service_name);
+
link = _dbus_list_get_first_link (&pending_activation->entries);
while (link != NULL)
{
@@ -1400,6 +1404,11 @@ babysitter_watch_callback (DBusWatch *watch,
if (activation_failed)
{
+ bus_context_log (pending_activation->activation->context,
+ DBUS_SYSTEM_LOG_INFO, "Activated service '%s' failed: %s",
+ pending_activation->service_name,
+ error.message);
+
/* Destroy all pending activations with the same exec */
_dbus_hash_iter_init (pending_activation->activation->pending_activations,
&iter);
@@ -1462,6 +1471,10 @@ pending_activation_timed_out (void *data)
dbus_set_error (&error, DBUS_ERROR_TIMED_OUT,
"Activation of %s timed out",
pending_activation->service_name);
+ bus_context_log (pending_activation->activation->context,
+ DBUS_SYSTEM_LOG_INFO,
+ "Failed to activate service '%s': timed out",
+ pending_activation->service_name);
pending_activation_failed (pending_activation, &error);
@@ -1674,6 +1687,7 @@ bus_activation_activate_service (BusActivation *activation,
const char *service_name,
DBusError *error)
{
+ DBusError tmp_error;
BusActivationEntry *entry;
BusPendingActivation *pending_activation;
BusPendingActivationEntry *pending_activation_entry;
@@ -1962,18 +1976,34 @@ bus_activation_activate_service (BusActivation *activation,
service = bus_registry_lookup (registry, &service_string);
if (service != NULL)
- /* Wonderful, systemd is connected, let's just send the msg */
- retval = bus_dispatch_matches (activation_transaction, NULL, bus_service_get_primary_owners_connection (service),
- message, error);
+ {
+ bus_context_log (activation->context,
+ DBUS_SYSTEM_LOG_INFO, "Activating via systemd: service name='%s' unit='%s'",
+ service_name,
+ entry->systemd_service);
+ /* Wonderful, systemd is connected, let's just send the msg */
+ retval = bus_dispatch_matches (activation_transaction, NULL, bus_service_get_primary_owners_connection (service),
+ message, error);
+ }
else
- /* systemd is not around, let's "activate" it. */
- retval = bus_activation_activate_service (activation, connection, activation_transaction, TRUE,
- message, "org.freedesktop.systemd1", error);
+ {
+ bus_context_log (activation->context,
+ DBUS_SYSTEM_LOG_INFO, "Activating systemd to hand-off: service name='%s' unit='%s'",
+ service_name,
+ entry->systemd_service);
+ /* systemd is not around, let's "activate" it. */
+ retval = bus_activation_activate_service (activation, connection, activation_transaction, TRUE,
+ message, "org.freedesktop.systemd1", error);
+ }
dbus_message_unref (message);
if (!retval)
{
+ bus_context_log (activation->context,
+ DBUS_SYSTEM_LOG_INFO, "Failed to activate via systemd: service name='%s' unit='%s'",
+ service_name,
+ entry->systemd_service);
_DBUS_ASSERT_ERROR_IS_SET (error);
_dbus_verbose ("failed to send activation message: %s\n", error->name);
bus_transaction_cancel_and_free (activation_transaction);
@@ -2069,13 +2099,29 @@ bus_activation_activate_service (BusActivation *activation,
}
_dbus_verbose ("Spawning %s ...\n", argv[0]);
+ if (servicehelper != NULL)
+ bus_context_log (activation->context,
+ DBUS_SYSTEM_LOG_INFO, "Activating service name='%s' (using servicehelper)",
+ service_name);
+ else
+ bus_context_log (activation->context,
+ DBUS_SYSTEM_LOG_INFO, "Activating service name='%s'",
+ service_name);
+
+ dbus_error_init (&tmp_error);
+
if (!_dbus_spawn_async_with_babysitter (&pending_activation->babysitter, argv,
envp,
NULL, activation,
- error))
+ &tmp_error))
{
_dbus_verbose ("Failed to spawn child\n");
- _DBUS_ASSERT_ERROR_IS_SET (error);
+ bus_context_log (activation->context,
+ DBUS_SYSTEM_LOG_INFO, "Failed to activate service %s: %s",
+ service_name,
+ tmp_error.message);
+ _DBUS_ASSERT_ERROR_IS_SET (&tmp_error);
+ dbus_move_error (&tmp_error, error);
dbus_free_string_array (argv);
dbus_free_string_array (envp);
@@ -2166,10 +2212,16 @@ dbus_activation_systemd_failure (BusActivation *activation,
DBUS_TYPE_INVALID))
dbus_set_error(&error, code, str);
+
if (unit)
{
DBusHashIter iter;
+ bus_context_log (activation->context,
+ DBUS_SYSTEM_LOG_INFO, "Activation via systemd failed for unit '%s': %s",
+ unit,
+ str);
+
_dbus_hash_iter_init (activation->pending_activations,
&iter);
diff --git a/bus/bus.c b/bus/bus.c
index 66633470..6b0dc088 100644
--- a/bus/bus.c
+++ b/bus/bus.c
@@ -23,6 +23,9 @@
#include <config.h>
#include "bus.h"
+
+#include <stdio.h>
+
#include "activation.h"
#include "connection.h"
#include "services.h"
@@ -36,6 +39,7 @@
#include <dbus/dbus-hash.h>
#include <dbus/dbus-credentials.h>
#include <dbus/dbus-internals.h>
+
#ifdef DBUS_CYGWIN
#include <signal.h>
#endif
@@ -297,6 +301,8 @@ process_config_first_time_only (BusContext *context,
retval = FALSE;
auth_mechanisms = NULL;
+ _dbus_init_system_log ();
+
context->systemd_activation = systemd_activation;
/* Check for an existing pid file. Of course this is a race;
@@ -1281,7 +1287,14 @@ bus_context_log (BusContext *context, DBusSystemLogSeverity severity, const char
va_list args;
if (!context->syslog)
- return;
+ {
+ /* we're not syslogging; just output to stderr */
+ va_start (args, msg);
+ vfprintf (stderr, msg, args);
+ fprintf (stderr, "\n");
+ va_end (args);
+ return;
+ }
va_start (args, msg);
@@ -1307,6 +1320,77 @@ out:
va_end (args);
}
+static inline const char *
+nonnull (const char *maybe_null,
+ const char *if_null)
+{
+ return (maybe_null ? maybe_null : if_null);
+}
+
+/*
+ * Log something about a message, usually that it was rejected.
+ */
+static void
+complain_about_message (BusContext *context,
+ const char *error_name,
+ const char *complaint,
+ int matched_rules,
+ DBusMessage *message,
+ DBusConnection *sender,
+ DBusConnection *proposed_recipient,
+ dbus_bool_t requested_reply,
+ dbus_bool_t log,
+ DBusError *error)
+{
+ DBusError stack_error = DBUS_ERROR_INIT;
+ const char *sender_name;
+ const char *sender_loginfo;
+ const char *proposed_recipient_loginfo;
+
+ if (error == NULL && !log)
+ return;
+
+ if (sender != NULL)
+ {
+ sender_name = bus_connection_get_name (sender);
+ sender_loginfo = bus_connection_get_loginfo (sender);
+ }
+ else
+ {
+ sender_name = "(unset)";
+ sender_loginfo = "(bus)";
+ }
+
+ if (proposed_recipient != NULL)
+ proposed_recipient_loginfo = bus_connection_get_loginfo (proposed_recipient);
+ else
+ proposed_recipient_loginfo = "bus";
+
+ dbus_set_error (&stack_error, error_name,
+ "%s, %d matched rules; type=\"%s\", sender=\"%s\" (%s) "
+ "interface=\"%s\" member=\"%s\" error name=\"%s\" "
+ "requested_reply=\"%d\" destination=\"%s\" (%s)",
+ complaint,
+ matched_rules,
+ dbus_message_type_to_string (dbus_message_get_type (message)),
+ sender_name,
+ sender_loginfo,
+ nonnull (dbus_message_get_interface (message), "(unset)"),
+ nonnull (dbus_message_get_member (message), "(unset)"),
+ nonnull (dbus_message_get_error_name (message), "(unset)"),
+ requested_reply,
+ nonnull (dbus_message_get_destination (message), DBUS_SERVICE_DBUS),
+ proposed_recipient_loginfo);
+
+ /* If we hit OOM while setting the error, this will syslog "out of memory"
+ * which is itself an indication that something is seriously wrong */
+ if (log)
+ bus_context_log (context, DBUS_SYSTEM_LOG_SECURITY, "%s",
+ stack_error.message);
+
+ dbus_move_error (&stack_error, error);
+}
+
/*
* addressed_recipient is the recipient specified in the message.
*
@@ -1351,23 +1435,6 @@ bus_context_check_security_policy (BusContext *context,
addressed_recipient != NULL ||
strcmp (dest, DBUS_SERVICE_DBUS) == 0);
- /* Used in logging below */
- if (sender != NULL)
- {
- sender_name = bus_connection_get_name (sender);
- sender_loginfo = bus_connection_get_loginfo (sender);
- }
- else
- {
- sender_name = NULL;
- sender_loginfo = "(bus)";
- }
-
- if (proposed_recipient != NULL)
- proposed_recipient_loginfo = bus_connection_get_loginfo (proposed_recipient);
- else
- proposed_recipient_loginfo = "bus";
-
switch (type)
{
case DBUS_MESSAGE_TYPE_METHOD_CALL:
@@ -1402,19 +1469,12 @@ bus_context_check_security_policy (BusContext *context,
{
if (error != NULL && !dbus_error_is_set (error))
{
- dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED,
- "An SELinux policy prevents this sender "
- "from sending this message to this recipient "
- "(rejected message had sender \"%s\" interface \"%s\" "
- "member \"%s\" error name \"%s\" destination \"%s\")",
- sender_name ? sender_name : "(unset)",
- dbus_message_get_interface (message) ?
- dbus_message_get_interface (message) : "(unset)",
- dbus_message_get_member (message) ?
- dbus_message_get_member (message) : "(unset)",
- dbus_message_get_error_name (message) ?
- dbus_message_get_error_name (message) : "(unset)",
- dest ? dest : DBUS_SERVICE_DBUS);
+ /* don't syslog this, just set the error: avc_has_perm should
+ * have already written to either the audit log or syslog */
+ complain_about_message (context, DBUS_ERROR_ACCESS_DENIED,
+ "An SELinux policy prevents this sender from sending this "
+ "message to this recipient",
+ 0, message, sender, proposed_recipient, FALSE, FALSE, error);
_dbus_verbose ("SELinux security check denying send to service\n");
}
@@ -1531,57 +1591,23 @@ bus_context_check_security_policy (BusContext *context,
const char *msg = "Rejected send message, %d matched rules; "
"type=\"%s\", sender=\"%s\" (%s) interface=\"%s\" member=\"%s\" error name=\"%s\" requested_reply=%d destination=\"%s\" (%s))";
- dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED, msg,
- toggles,
- dbus_message_type_to_string (dbus_message_get_type (message)),
- sender_name ? sender_name : "(unset)",
- sender_loginfo,
- dbus_message_get_interface (message) ?
- dbus_message_get_interface (message) : "(unset)",
- dbus_message_get_member (message) ?
- dbus_message_get_member (message) : "(unset)",
- dbus_message_get_error_name (message) ?
- dbus_message_get_error_name (message) : "(unset)",
- requested_reply,
- dest ? dest : DBUS_SERVICE_DBUS,
- proposed_recipient_loginfo);
- /* Needs to be duplicated to avoid calling malloc and having to handle OOM */
- if (addressed_recipient == proposed_recipient)
- bus_context_log (context, DBUS_SYSTEM_LOG_SECURITY, msg,
- toggles,
- dbus_message_type_to_string (dbus_message_get_type (message)),
- sender_name ? sender_name : "(unset)",
- sender_loginfo,
- dbus_message_get_interface (message) ?
- dbus_message_get_interface (message) : "(unset)",
- dbus_message_get_member (message) ?
- dbus_message_get_member (message) : "(unset)",
- dbus_message_get_error_name (message) ?
- dbus_message_get_error_name (message) : "(unset)",
- requested_reply,
- dest ? dest : DBUS_SERVICE_DBUS,
- proposed_recipient_loginfo);
+ complain_about_message (context, DBUS_ERROR_ACCESS_DENIED,
+ "Rejected send message", toggles,
+ message, sender, proposed_recipient, requested_reply,
+ (addressed_recipient == proposed_recipient), error);
_dbus_verbose ("security policy disallowing message due to sender policy\n");
return FALSE;
}
if (log)
- bus_context_log (context, DBUS_SYSTEM_LOG_SECURITY,
- "Would reject message, %d matched rules; "
- "type=\"%s\", sender=\"%s\" (%s) interface=\"%s\" member=\"%s\" error name=\"%s\" requested_reply=%d destination=\"%s\" (%s))",
- toggles,
- dbus_message_type_to_string (dbus_message_get_type (message)),
- sender_name ? sender_name : "(unset)",
- sender_loginfo,
- dbus_message_get_interface (message) ?
- dbus_message_get_interface (message) : "(unset)",
- dbus_message_get_member (message) ?
- dbus_message_get_member (message) : "(unset)",
- dbus_message_get_error_name (message) ?
- dbus_message_get_error_name (message) : "(unset)",
- requested_reply,
- dest ? dest : DBUS_SERVICE_DBUS,
- proposed_recipient_loginfo);
+ {
+ /* We want to drop this message, and are only not doing so for backwards
+ * compatibility. */
+ complain_about_message (context, DBUS_ERROR_ACCESS_DENIED,
+ "Would reject message", toggles,
+ message, sender, proposed_recipient, requested_reply,
+ TRUE, NULL);
+ }
if (recipient_policy &&
!bus_client_policy_check_can_receive (recipient_policy,
@@ -1591,41 +1617,10 @@ bus_context_check_security_policy (BusContext *context,
addressed_recipient, proposed_recipient,
message, &toggles))
{
- const char *msg = "Rejected receive message, %d matched rules; "
- "type=\"%s\" sender=\"%s\" (%s) interface=\"%s\" member=\"%s\" error name=\"%s\" reply serial=%u requested_reply=%d destination=\"%s\" (%s))";
-
- dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED, msg,
- toggles,
- dbus_message_type_to_string (dbus_message_get_type (message)),
- sender_name ? sender_name : "(unset)",
- sender_loginfo,
- dbus_message_get_interface (message) ?
- dbus_message_get_interface (message) : "(unset)",
- dbus_message_get_member (message) ?
- dbus_message_get_member (message) : "(unset)",
- dbus_message_get_error_name (message) ?
- dbus_message_get_error_name (message) : "(unset)",
- dbus_message_get_reply_serial (message),
- requested_reply,
- dest ? dest : DBUS_SERVICE_DBUS,
- proposed_recipient_loginfo);
- /* Needs to be duplicated to avoid calling malloc and having to handle OOM */
- if (addressed_recipient == proposed_recipient)
- bus_context_log (context, DBUS_SYSTEM_LOG_SECURITY, msg,
- toggles,
- dbus_message_type_to_string (dbus_message_get_type (message)),
- sender_name ? sender_name : "(unset)",
- sender_loginfo,
- dbus_message_get_interface (message) ?
- dbus_message_get_interface (message) : "(unset)",
- dbus_message_get_member (message) ?
- dbus_message_get_member (message) : "(unset)",
- dbus_message_get_error_name (message) ?
- dbus_message_get_error_name (message) : "(unset)",
- dbus_message_get_reply_serial (message),
- requested_reply,
- dest ? dest : DBUS_SERVICE_DBUS,
- proposed_recipient_loginfo);
+ complain_about_message (context, DBUS_ERROR_ACCESS_DENIED,
+ "Rejected receive message", toggles,
+ message, sender, proposed_recipient, requested_reply,
+ (addressed_recipient == proposed_recipient), NULL);
_dbus_verbose ("security policy disallowing message due to recipient policy\n");
return FALSE;
}
@@ -1635,11 +1630,10 @@ bus_context_check_security_policy (BusContext *context,
((dbus_connection_get_outgoing_size (proposed_recipient) > context->limits.max_outgoing_bytes) ||
(dbus_connection_get_outgoing_unix_fds (proposed_recipient) > context->limits.max_outgoing_unix_fds)))
{
- dbus_set_error (error, DBUS_ERROR_LIMITS_EXCEEDED,
- "The destination service \"%s\" has a full message queue",
- dest ? dest : (proposed_recipient ?
- bus_connection_get_name (proposed_recipient) :
- DBUS_SERVICE_DBUS));
+ complain_about_message (context, DBUS_ERROR_LIMITS_EXCEEDED,
+ "Rejected: destination has a full message queue",
+ 0, message, sender, proposed_recipient, requested_reply, TRUE,
+ error);
_dbus_verbose ("security policy disallowing message due to full message queue\n");
return FALSE;
}
diff --git a/bus/selinux.c b/bus/selinux.c
index fe04063a..e94d8a8e 100644
--- a/bus/selinux.c
+++ b/bus/selinux.c
@@ -164,7 +164,7 @@ log_callback (const char *fmt, ...)
}
#endif /* HAVE_LIBAUDIT */
- vsyslog (LOG_INFO, fmt, ap);
+ vsyslog (LOG_USER | LOG_INFO, fmt, ap);
va_end(ap);
}
@@ -342,7 +342,6 @@ bus_selinux_full_init (void)
}
else
{
- openlog ("dbus", LOG_PERROR, LOG_USER);
_dbus_verbose ("Access Vector Cache (AVC) started.\n");
}
diff --git a/bus/test-main.c b/bus/test-main.c
index cab75306..a8039d51 100644
--- a/bus/test-main.c
+++ b/bus/test-main.c
@@ -54,6 +54,8 @@ check_memleaks (const char *name)
}
#endif /* DBUS_BUILD_TESTS */
+static DBusInitialFDs *initial_fds = NULL;
+
static void
test_pre_hook (void)
{
@@ -62,16 +64,21 @@ test_pre_hook (void)
&& (!bus_selinux_pre_init ()
|| !bus_selinux_full_init ()))
die ("could not init selinux support");
+
+ initial_fds = _dbus_check_fdleaks_enter ();
}
static char *progname = "";
+
static void
test_post_hook (void)
{
if (_dbus_getenv ("DBUS_TEST_SELINUX"))
bus_selinux_shutdown ();
check_memleaks (progname);
- _dbus_check_fdleaks();
+
+ _dbus_check_fdleaks_leave (initial_fds);
+ initial_fds = NULL;
}
int