diff options
author | Simon McVittie <smcv@debian.org> | 2013-06-12 19:52:04 +0100 |
---|---|---|
committer | Simon McVittie <smcv@debian.org> | 2013-06-12 19:52:04 +0100 |
commit | 20c1496fee4c06a5f268585ba67bd3a6f105fa78 (patch) | |
tree | 6a2ba4410fffb4a2241237398aa940ac7ae28881 /bus | |
parent | 05b847b89bcf23c7805e1519cdd16a2aeb16d14b (diff) | |
parent | 46d73712ab0750f995f0ec89f4d28b09dbba8c29 (diff) | |
download | dbus-20c1496fee4c06a5f268585ba67bd3a6f105fa78.tar.gz |
Imported Upstream version 1.7.4upstream/1.7.4
Diffstat (limited to 'bus')
-rw-r--r-- | bus/Makefile.am | 5 | ||||
-rw-r--r-- | bus/Makefile.in | 297 | ||||
-rw-r--r-- | bus/activation.c | 19 | ||||
-rw-r--r-- | bus/config-loader-libxml.c | 324 | ||||
-rw-r--r-- | bus/desktop-file.c | 6 | ||||
-rw-r--r-- | bus/main.c | 10 |
6 files changed, 179 insertions, 482 deletions
diff --git a/bus/Makefile.am b/bus/Makefile.am index 6cbc09a6..74c62e74 100644 --- a/bus/Makefile.am +++ b/bus/Makefile.am @@ -42,12 +42,7 @@ agentdir=$(LAUNCHD_AGENT_DIR) agent_DATA=org.freedesktop.dbus-session.plist endif -if DBUS_USE_LIBXML -XML_SOURCES=config-loader-libxml.c -endif -if DBUS_USE_EXPAT XML_SOURCES=config-loader-expat.c -endif if DBUS_BUS_ENABLE_KQUEUE DIR_WATCH_SOURCE=dir-watch-kqueue.c diff --git a/bus/Makefile.in b/bus/Makefile.in index 46fc92f3..81fb06f4 100644 --- a/bus/Makefile.in +++ b/bus/Makefile.in @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.6 from Makefile.am. +# Makefile.in generated by automake 1.13.3 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -18,23 +17,51 @@ VPATH = @srcdir@ -am__make_dryrun = \ - { \ - am__dry=no; \ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ - echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ - | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ - *) \ - for am__flg in $$MAKEFLAGS; do \ - case $$am__flg in \ - *=*|--*) ;; \ - *n*) am__dry=yes; break;; \ - esac; \ - done;; \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ - test $$am__dry = yes; \ - } + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -70,12 +97,12 @@ dbus_daemon_exec_PROGRAMS = dbus-daemon$(EXEEXT) @HAVE_SYSTEMD_TRUE@ dbus.socket.in subdir = bus -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(srcdir)/dbus.service.in $(srcdir)/dbus.socket.in \ - $(srcdir)/messagebus-config.in $(srcdir)/messagebus.in \ +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(srcdir)/system.conf.in $(srcdir)/session.conf.in \ + $(srcdir)/messagebus.in $(srcdir)/messagebus-config.in \ $(srcdir)/org.freedesktop.dbus-session.plist.in \ - $(srcdir)/rc.messagebus.in $(srcdir)/session.conf.in \ - $(srcdir)/system.conf.in + $(srcdir)/rc.messagebus.in $(srcdir)/dbus.service.in \ + $(srcdir)/dbus.socket.in $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/libtool.m4 \ @@ -111,14 +138,13 @@ am__bus_test_SOURCES_DIST = activation.c activation.h \ driver.h expirelist.c expirelist.h policy.c policy.h selinux.h \ selinux.c services.c services.h signals.c signals.h stats.c \ stats.h test.c test.h utils.c utils.h config-loader-expat.c \ - config-loader-libxml.c test-main.c + test-main.c @DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX_FALSE@@DBUS_BUS_ENABLE_INOTIFY_FALSE@@DBUS_BUS_ENABLE_KQUEUE_FALSE@am__objects_1 = dir-watch-default.$(OBJEXT) @DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX_TRUE@@DBUS_BUS_ENABLE_INOTIFY_FALSE@@DBUS_BUS_ENABLE_KQUEUE_FALSE@am__objects_1 = dir-watch-dnotify.$(OBJEXT) @DBUS_BUS_ENABLE_INOTIFY_TRUE@@DBUS_BUS_ENABLE_KQUEUE_FALSE@am__objects_1 = dir-watch-inotify.$(OBJEXT) @DBUS_BUS_ENABLE_KQUEUE_TRUE@am__objects_1 = \ @DBUS_BUS_ENABLE_KQUEUE_TRUE@ dir-watch-kqueue.$(OBJEXT) -@DBUS_USE_EXPAT_FALSE@@DBUS_USE_LIBXML_TRUE@am__objects_2 = config-loader-libxml.$(OBJEXT) -@DBUS_USE_EXPAT_TRUE@am__objects_2 = config-loader-expat.$(OBJEXT) +am__objects_2 = config-loader-expat.$(OBJEXT) am__objects_3 = activation.$(OBJEXT) bus.$(OBJEXT) \ config-parser.$(OBJEXT) config-parser-common.$(OBJEXT) \ connection.$(OBJEXT) desktop-file.$(OBJEXT) $(am__objects_1) \ @@ -137,14 +163,8 @@ bus_test_DEPENDENCIES = $(top_builddir)/dbus/libdbus-internal.la \ AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent -am__bus_test_launch_helper_SOURCES_DIST = test-launch-helper.c \ - config-loader-expat.c config-loader-libxml.c \ - 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 -@DBUS_USE_EXPAT_FALSE@@DBUS_USE_LIBXML_TRUE@am__objects_4 = bus_test_launch_helper-config-loader-libxml.$(OBJEXT) -@DBUS_USE_EXPAT_TRUE@am__objects_4 = bus_test_launch_helper-config-loader-expat.$(OBJEXT) +am__v_lt_1 = +am__objects_4 = bus_test_launch_helper-config-loader-expat.$(OBJEXT) am__objects_5 = $(am__objects_4) \ bus_test_launch_helper-config-parser-common.$(OBJEXT) \ bus_test_launch_helper-config-parser-trivial.$(OBJEXT) \ @@ -159,10 +179,6 @@ am__DEPENDENCIES_3 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) bus_test_launch_helper_DEPENDENCIES = \ $(top_builddir)/dbus/libdbus-internal.la $(am__DEPENDENCIES_3) -am__bus_test_system_SOURCES_DIST = config-loader-expat.c \ - config-loader-libxml.c config-parser-common.c \ - config-parser-common.h config-parser-trivial.c \ - config-parser-trivial.h utils.c utils.h test-system.c am_bus_test_system_OBJECTS = $(am__objects_2) \ config-parser-common.$(OBJEXT) config-parser-trivial.$(OBJEXT) \ utils.$(OBJEXT) test-system.$(OBJEXT) @@ -178,17 +194,11 @@ am__dbus_daemon_SOURCES_DIST = activation.c activation.h \ driver.h expirelist.c expirelist.h policy.c policy.h selinux.h \ selinux.c services.c services.h signals.c signals.h stats.c \ stats.h test.c test.h utils.c utils.h config-loader-expat.c \ - config-loader-libxml.c main.c + main.c am_dbus_daemon_OBJECTS = $(am__objects_3) main.$(OBJEXT) dbus_daemon_OBJECTS = $(am_dbus_daemon_OBJECTS) dbus_daemon_DEPENDENCIES = $(top_builddir)/dbus/libdbus-internal.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) -am__dbus_daemon_launch_helper_SOURCES_DIST = activation-helper-bin.c \ - config-loader-expat.c config-loader-libxml.c \ - 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 am__objects_6 = $(am__objects_2) config-parser-common.$(OBJEXT) \ config-parser-trivial.$(OBJEXT) desktop-file.$(OBJEXT) \ utils.$(OBJEXT) activation-helper.$(OBJEXT) @@ -198,15 +208,8 @@ dbus_daemon_launch_helper_OBJECTS = \ $(am_dbus_daemon_launch_helper_OBJECTS) dbus_daemon_launch_helper_DEPENDENCIES = \ $(top_builddir)/dbus/libdbus-internal.la $(am__DEPENDENCIES_3) -am__dbus_daemon_launch_helper_test_SOURCES_DIST = \ - activation-helper-bin.c config-loader-expat.c \ - config-loader-libxml.c 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 -@DBUS_USE_EXPAT_FALSE@@DBUS_USE_LIBXML_TRUE@am__objects_7 = dbus_daemon_launch_helper_test-config-loader-libxml.$(OBJEXT) -@DBUS_USE_EXPAT_TRUE@am__objects_7 = dbus_daemon_launch_helper_test-config-loader-expat.$(OBJEXT) +am__objects_7 = \ + dbus_daemon_launch_helper_test-config-loader-expat.$(OBJEXT) am__objects_8 = $(am__objects_7) \ dbus_daemon_launch_helper_test-config-parser-common.$(OBJEXT) \ dbus_daemon_launch_helper_test-config-parser-trivial.$(OBJEXT) \ @@ -247,6 +250,18 @@ am__uninstall_files_from_dir = { \ $(am__cd) "$$dir" && rm -f $$files; }; \ } SCRIPTS = $(bin_SCRIPTS) $(initd_SCRIPTS) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @@ -259,36 +274,48 @@ LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = SOURCES = $(bus_test_SOURCES) $(bus_test_launch_helper_SOURCES) \ $(bus_test_system_SOURCES) $(dbus_daemon_SOURCES) \ $(dbus_daemon_launch_helper_SOURCES) \ $(dbus_daemon_launch_helper_test_SOURCES) DIST_SOURCES = $(am__bus_test_SOURCES_DIST) \ - $(am__bus_test_launch_helper_SOURCES_DIST) \ - $(am__bus_test_system_SOURCES_DIST) \ + $(bus_test_launch_helper_SOURCES) $(bus_test_system_SOURCES) \ $(am__dbus_daemon_SOURCES_DIST) \ - $(am__dbus_daemon_launch_helper_SOURCES_DIST) \ - $(am__dbus_daemon_launch_helper_test_SOURCES_DIST) + $(dbus_daemon_launch_helper_SOURCES) \ + $(dbus_daemon_launch_helper_test_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(agent_DATA) $(config_DATA) $(systemdsystemunit_DATA) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -382,8 +409,6 @@ LIBDBUS_LIBS = @LIBDBUS_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIBXML_CFLAGS = @LIBXML_CFLAGS@ -LIBXML_LIBS = @LIBXML_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ @@ -540,8 +565,7 @@ config_DATA = \ @DBUS_ENABLE_LAUNCHD_TRUE@agentdir = $(LAUNCHD_AGENT_DIR) @DBUS_ENABLE_LAUNCHD_TRUE@agent_DATA = org.freedesktop.dbus-session.plist -@DBUS_USE_EXPAT_TRUE@XML_SOURCES = config-loader-expat.c -@DBUS_USE_LIBXML_TRUE@XML_SOURCES = config-loader-libxml.c +XML_SOURCES = config-loader-expat.c @DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX_FALSE@@DBUS_BUS_ENABLE_INOTIFY_FALSE@@DBUS_BUS_ENABLE_KQUEUE_FALSE@DIR_WATCH_SOURCE = dir-watch-default.c @DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX_TRUE@@DBUS_BUS_ENABLE_INOTIFY_FALSE@@DBUS_BUS_ENABLE_KQUEUE_FALSE@DIR_WATCH_SOURCE = dir-watch-dnotify.c @DBUS_BUS_ENABLE_INOTIFY_TRUE@@DBUS_BUS_ENABLE_KQUEUE_FALSE@DIR_WATCH_SOURCE = dir-watch-inotify.c @@ -737,10 +761,12 @@ install-dbus_daemon_execPROGRAMS: $(dbus_daemon_exec_PROGRAMS) fi; \ 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; \ + 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|.*|.|' \ + 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 } \ @@ -761,7 +787,8 @@ uninstall-dbus_daemon_execPROGRAMS: @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)/' `; \ + -e 's/$$/$(EXEEXT)/' \ + `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(dbus_daemon_execdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(dbus_daemon_execdir)" && rm -f $$files @@ -783,10 +810,12 @@ install-libexecPROGRAMS: $(libexec_PROGRAMS) fi; \ 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; \ + 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|.*|.|' \ + 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 } \ @@ -807,7 +836,8 @@ uninstall-libexecPROGRAMS: @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)/' `; \ + -e 's/$$/$(EXEEXT)/' \ + `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(libexecdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(libexecdir)" && rm -f $$files @@ -829,21 +859,27 @@ clean-noinstPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list + bus-test$(EXEEXT): $(bus_test_OBJECTS) $(bus_test_DEPENDENCIES) $(EXTRA_bus_test_DEPENDENCIES) @rm -f bus-test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bus_test_OBJECTS) $(bus_test_LDADD) $(LIBS) + bus-test-launch-helper$(EXEEXT): $(bus_test_launch_helper_OBJECTS) $(bus_test_launch_helper_DEPENDENCIES) $(EXTRA_bus_test_launch_helper_DEPENDENCIES) @rm -f bus-test-launch-helper$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bus_test_launch_helper_OBJECTS) $(bus_test_launch_helper_LDADD) $(LIBS) + bus-test-system$(EXEEXT): $(bus_test_system_OBJECTS) $(bus_test_system_DEPENDENCIES) $(EXTRA_bus_test_system_DEPENDENCIES) @rm -f bus-test-system$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bus_test_system_OBJECTS) $(bus_test_system_LDADD) $(LIBS) + dbus-daemon$(EXEEXT): $(dbus_daemon_OBJECTS) $(dbus_daemon_DEPENDENCIES) $(EXTRA_dbus_daemon_DEPENDENCIES) @rm -f dbus-daemon$(EXEEXT) $(AM_V_CCLD)$(LINK) $(dbus_daemon_OBJECTS) $(dbus_daemon_LDADD) $(LIBS) + dbus-daemon-launch-helper$(EXEEXT): $(dbus_daemon_launch_helper_OBJECTS) $(dbus_daemon_launch_helper_DEPENDENCIES) $(EXTRA_dbus_daemon_launch_helper_DEPENDENCIES) @rm -f dbus-daemon-launch-helper$(EXEEXT) $(AM_V_CCLD)$(LINK) $(dbus_daemon_launch_helper_OBJECTS) $(dbus_daemon_launch_helper_LDADD) $(LIBS) + dbus-daemon-launch-helper-test$(EXEEXT): $(dbus_daemon_launch_helper_test_OBJECTS) $(dbus_daemon_launch_helper_test_DEPENDENCIES) $(EXTRA_dbus_daemon_launch_helper_test_DEPENDENCIES) @rm -f dbus-daemon-launch-helper-test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(dbus_daemon_launch_helper_test_OBJECTS) $(dbus_daemon_launch_helper_test_LDADD) $(LIBS) @@ -930,14 +966,12 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bus.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bus_test_launch_helper-activation-helper.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bus_test_launch_helper-config-loader-expat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bus_test_launch_helper-config-loader-libxml.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bus_test_launch_helper-config-parser-common.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bus_test_launch_helper-config-parser-trivial.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bus_test_launch_helper-desktop-file.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bus_test_launch_helper-test-launch-helper.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bus_test_launch_helper-utils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/config-loader-expat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/config-loader-libxml.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/config-parser-common.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/config-parser-trivial.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/config-parser.Po@am__quote@ @@ -945,7 +979,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus_daemon_launch_helper_test-activation-helper-bin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus_daemon_launch_helper_test-activation-helper.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus_daemon_launch_helper_test-config-loader-expat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus_daemon_launch_helper_test-config-loader-libxml.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus_daemon_launch_helper_test-config-parser-common.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus_daemon_launch_helper_test-config-parser-trivial.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus_daemon_launch_helper_test-desktop-file.Po@am__quote@ @@ -1018,20 +1051,6 @@ bus_test_launch_helper-config-loader-expat.obj: config-loader-expat.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bus_test_launch_helper-config-loader-expat.obj `if test -f 'config-loader-expat.c'; then $(CYGPATH_W) 'config-loader-expat.c'; else $(CYGPATH_W) '$(srcdir)/config-loader-expat.c'; fi` -bus_test_launch_helper-config-loader-libxml.o: config-loader-libxml.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bus_test_launch_helper-config-loader-libxml.o -MD -MP -MF $(DEPDIR)/bus_test_launch_helper-config-loader-libxml.Tpo -c -o bus_test_launch_helper-config-loader-libxml.o `test -f 'config-loader-libxml.c' || echo '$(srcdir)/'`config-loader-libxml.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bus_test_launch_helper-config-loader-libxml.Tpo $(DEPDIR)/bus_test_launch_helper-config-loader-libxml.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='config-loader-libxml.c' object='bus_test_launch_helper-config-loader-libxml.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bus_test_launch_helper-config-loader-libxml.o `test -f 'config-loader-libxml.c' || echo '$(srcdir)/'`config-loader-libxml.c - -bus_test_launch_helper-config-loader-libxml.obj: config-loader-libxml.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bus_test_launch_helper-config-loader-libxml.obj -MD -MP -MF $(DEPDIR)/bus_test_launch_helper-config-loader-libxml.Tpo -c -o bus_test_launch_helper-config-loader-libxml.obj `if test -f 'config-loader-libxml.c'; then $(CYGPATH_W) 'config-loader-libxml.c'; else $(CYGPATH_W) '$(srcdir)/config-loader-libxml.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bus_test_launch_helper-config-loader-libxml.Tpo $(DEPDIR)/bus_test_launch_helper-config-loader-libxml.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='config-loader-libxml.c' object='bus_test_launch_helper-config-loader-libxml.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bus_test_launch_helper-config-loader-libxml.obj `if test -f 'config-loader-libxml.c'; then $(CYGPATH_W) 'config-loader-libxml.c'; else $(CYGPATH_W) '$(srcdir)/config-loader-libxml.c'; fi` - bus_test_launch_helper-config-parser-common.o: config-parser-common.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bus_test_launch_helper_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bus_test_launch_helper-config-parser-common.o -MD -MP -MF $(DEPDIR)/bus_test_launch_helper-config-parser-common.Tpo -c -o bus_test_launch_helper-config-parser-common.o `test -f 'config-parser-common.c' || echo '$(srcdir)/'`config-parser-common.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bus_test_launch_helper-config-parser-common.Tpo $(DEPDIR)/bus_test_launch_helper-config-parser-common.Po @@ -1130,20 +1149,6 @@ dbus_daemon_launch_helper_test-config-loader-expat.obj: config-loader-expat.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbus_daemon_launch_helper_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dbus_daemon_launch_helper_test-config-loader-expat.obj `if test -f 'config-loader-expat.c'; then $(CYGPATH_W) 'config-loader-expat.c'; else $(CYGPATH_W) '$(srcdir)/config-loader-expat.c'; fi` -dbus_daemon_launch_helper_test-config-loader-libxml.o: config-loader-libxml.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbus_daemon_launch_helper_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dbus_daemon_launch_helper_test-config-loader-libxml.o -MD -MP -MF $(DEPDIR)/dbus_daemon_launch_helper_test-config-loader-libxml.Tpo -c -o dbus_daemon_launch_helper_test-config-loader-libxml.o `test -f 'config-loader-libxml.c' || echo '$(srcdir)/'`config-loader-libxml.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dbus_daemon_launch_helper_test-config-loader-libxml.Tpo $(DEPDIR)/dbus_daemon_launch_helper_test-config-loader-libxml.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='config-loader-libxml.c' object='dbus_daemon_launch_helper_test-config-loader-libxml.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbus_daemon_launch_helper_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dbus_daemon_launch_helper_test-config-loader-libxml.o `test -f 'config-loader-libxml.c' || echo '$(srcdir)/'`config-loader-libxml.c - -dbus_daemon_launch_helper_test-config-loader-libxml.obj: config-loader-libxml.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbus_daemon_launch_helper_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dbus_daemon_launch_helper_test-config-loader-libxml.obj -MD -MP -MF $(DEPDIR)/dbus_daemon_launch_helper_test-config-loader-libxml.Tpo -c -o dbus_daemon_launch_helper_test-config-loader-libxml.obj `if test -f 'config-loader-libxml.c'; then $(CYGPATH_W) 'config-loader-libxml.c'; else $(CYGPATH_W) '$(srcdir)/config-loader-libxml.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dbus_daemon_launch_helper_test-config-loader-libxml.Tpo $(DEPDIR)/dbus_daemon_launch_helper_test-config-loader-libxml.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='config-loader-libxml.c' object='dbus_daemon_launch_helper_test-config-loader-libxml.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbus_daemon_launch_helper_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dbus_daemon_launch_helper_test-config-loader-libxml.obj `if test -f 'config-loader-libxml.c'; then $(CYGPATH_W) 'config-loader-libxml.c'; else $(CYGPATH_W) '$(srcdir)/config-loader-libxml.c'; fi` - dbus_daemon_launch_helper_test-config-parser-common.o: config-parser-common.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbus_daemon_launch_helper_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dbus_daemon_launch_helper_test-config-parser-common.o -MD -MP -MF $(DEPDIR)/dbus_daemon_launch_helper_test-config-parser-common.Tpo -c -o dbus_daemon_launch_helper_test-config-parser-common.o `test -f 'config-parser-common.c' || echo '$(srcdir)/'`config-parser-common.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dbus_daemon_launch_helper_test-config-parser-common.Tpo $(DEPDIR)/dbus_daemon_launch_helper_test-config-parser-common.Po @@ -1283,26 +1288,15 @@ uninstall-systemdsystemunitDATA: files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(systemdsystemunitdir)'; $(am__uninstall_files_from_dir) -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -1314,15 +1308,11 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique @@ -1331,6 +1321,21 @@ GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags @@ -1484,24 +1489,24 @@ uninstall-am: uninstall-agentDATA uninstall-binSCRIPTS \ .MAKE: install-am install-data-am install-exec-am install-strip -.PHONY: CTAGS GTAGS all all-am check check-am clean \ +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ 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-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 \ + clean-noinstPROGRAMS cscopelist-am ctags ctags-am 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-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 \ + tags tags-am uninstall uninstall-agentDATA uninstall-am \ uninstall-binSCRIPTS uninstall-configDATA \ uninstall-dbus_daemon_execPROGRAMS uninstall-initdSCRIPTS \ uninstall-libexecPROGRAMS uninstall-systemdsystemunitDATA diff --git a/bus/activation.c b/bus/activation.c index 3dfba787..fcb71337 100644 --- a/bus/activation.c +++ b/bus/activation.c @@ -80,7 +80,14 @@ typedef struct BusPendingActivationEntry BusPendingActivationEntry; struct BusPendingActivationEntry { + /* Normally a method call, but if connection is NULL, this is a signal + * instead. + */ DBusMessage *activation_message; + /* NULL if this activation entry is for the dbus-daemon itself, + * waiting for systemd to start. In this case, auto_activation is always + * TRUE. + */ DBusConnection *connection; dbus_bool_t auto_activation; @@ -1106,7 +1113,8 @@ bus_activation_service_created (BusActivation *activation, BusPendingActivationEntry *entry = link->data; DBusList *next = _dbus_list_get_next_link (&pending_activation->entries, link); - if (dbus_connection_get_is_connected (entry->connection)) + /* entry->connection is NULL for activating systemd */ + if (entry->connection && dbus_connection_get_is_connected (entry->connection)) { /* Only send activation replies to regular activation requests. */ if (!entry->auto_activation) @@ -1175,7 +1183,7 @@ bus_activation_send_pending_auto_activation_messages (BusActivation *activation BusPendingActivationEntry *entry = link->data; DBusList *next = _dbus_list_get_next_link (&pending_activation->entries, link); - if (entry->auto_activation && dbus_connection_get_is_connected (entry->connection)) + if (entry->auto_activation && (entry->connection == NULL || dbus_connection_get_is_connected (entry->connection))) { DBusConnection *addressed_recipient; @@ -1233,7 +1241,7 @@ try_send_activation_failure (BusPendingActivation *pending_activation, BusPendingActivationEntry *entry = link->data; DBusList *next = _dbus_list_get_next_link (&pending_activation->entries, link); - if (dbus_connection_get_is_connected (entry->connection)) + if (entry->connection && dbus_connection_get_is_connected (entry->connection)) { if (!bus_transaction_send_error_reply (transaction, entry->connection, @@ -1759,7 +1767,8 @@ bus_activation_activate_service (BusActivation *activation, pending_activation_entry->activation_message = activation_message; dbus_message_ref (activation_message); pending_activation_entry->connection = connection; - dbus_connection_ref (connection); + if (connection) + dbus_connection_ref (connection); /* Check if the service is being activated */ pending_activation = _dbus_hash_table_lookup_string (activation->pending_activations, service_name); @@ -1972,7 +1981,7 @@ bus_activation_activate_service (BusActivation *activation, service_name, entry->systemd_service); /* systemd is not around, let's "activate" it. */ - retval = bus_activation_activate_service (activation, connection, activation_transaction, TRUE, + retval = bus_activation_activate_service (activation, NULL, activation_transaction, TRUE, message, "org.freedesktop.systemd1", error); } diff --git a/bus/config-loader-libxml.c b/bus/config-loader-libxml.c deleted file mode 100644 index c73a1815..00000000 --- a/bus/config-loader-libxml.c +++ /dev/null @@ -1,324 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ -/* config-loader-libxml.c libxml2 XML loader - * - * Copyright (C) 2003 Red Hat, Inc. - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#include <config.h> -#include "config-parser.h" -#include <dbus/dbus-internals.h> -#include <libxml/xmlreader.h> -#include <libxml/parser.h> -#include <libxml/globals.h> -#include <libxml/xmlmemory.h> -#ifdef HAVE_ERRNO_H -#include <errno.h> -#endif -#include <string.h> - -/* About the error handling: - * - setup a "structured" error handler that catches structural - * errors and some oom errors - * - assume that a libxml function returning an error code means - * out-of-memory - */ -#define _DBUS_MAYBE_SET_OOM(e) (dbus_error_is_set(e) ? (void)0 : _DBUS_SET_OOM(e)) - - -static dbus_bool_t -xml_text_start_element (BusConfigParser *parser, - xmlTextReader *reader, - DBusError *error) -{ - const char *name; - int n_attributes; - const char **attribute_names, **attribute_values; - dbus_bool_t ret; - int i, status, is_empty; - - _DBUS_ASSERT_ERROR_IS_CLEAR (error); - - ret = FALSE; - attribute_names = NULL; - attribute_values = NULL; - - name = xmlTextReaderConstName (reader); - n_attributes = xmlTextReaderAttributeCount (reader); - is_empty = xmlTextReaderIsEmptyElement (reader); - - if (name == NULL || n_attributes < 0 || is_empty == -1) - { - _DBUS_MAYBE_SET_OOM (error); - goto out; - } - - attribute_names = dbus_new0 (const char *, n_attributes + 1); - attribute_values = dbus_new0 (const char *, n_attributes + 1); - if (attribute_names == NULL || attribute_values == NULL) - { - _DBUS_SET_OOM (error); - goto out; - } - i = 0; - while ((status = xmlTextReaderMoveToNextAttribute (reader)) == 1) - { - _dbus_assert (i < n_attributes); - attribute_names[i] = xmlTextReaderConstName (reader); - attribute_values[i] = xmlTextReaderConstValue (reader); - if (attribute_names[i] == NULL || attribute_values[i] == NULL) - { - _DBUS_MAYBE_SET_OOM (error); - goto out; - } - i++; - } - if (status == -1) - { - _DBUS_MAYBE_SET_OOM (error); - goto out; - } - _dbus_assert (i == n_attributes); - - ret = bus_config_parser_start_element (parser, name, - attribute_names, attribute_values, - error); - if (ret && is_empty == 1) - ret = bus_config_parser_end_element (parser, name, error); - - out: - dbus_free (attribute_names); - dbus_free (attribute_values); - - return ret; -} - -static void xml_shut_up (void *ctx, const char *msg, ...) -{ - return; -} - -static void -xml_text_reader_error (void *arg, xmlErrorPtr xml_error) -{ - DBusError *error = arg; - -#if 0 - _dbus_verbose ("XML_ERROR level=%d, domain=%d, code=%d, msg=%s\n", - xml_error->level, xml_error->domain, - xml_error->code, xml_error->message); -#endif - - if (!dbus_error_is_set (error)) - { - if (xml_error->code == XML_ERR_NO_MEMORY) - _DBUS_SET_OOM (error); - else if (xml_error->level == XML_ERR_ERROR || - xml_error->level == XML_ERR_FATAL) - dbus_set_error (error, DBUS_ERROR_FAILED, - "Error loading config file: '%s'", - xml_error->message); - } -} - - -BusConfigParser* -bus_config_load (const DBusString *file, - dbus_bool_t is_toplevel, - const BusConfigParser *parent, - DBusError *error) - -{ - xmlTextReader *reader; - BusConfigParser *parser; - DBusString dirname, data; - DBusError tmp_error; - int ret; - - _DBUS_ASSERT_ERROR_IS_CLEAR (error); - - parser = NULL; - reader = NULL; - - if (!_dbus_string_init (&dirname)) - { - _DBUS_SET_OOM (error); - return NULL; - } - - if (!_dbus_string_init (&data)) - { - _DBUS_SET_OOM (error); - _dbus_string_free (&dirname); - return NULL; - } - - if (is_toplevel) - { - /* xmlMemSetup only fails if one of the functions is NULL */ - xmlMemSetup (dbus_free, - dbus_malloc, - dbus_realloc, - _dbus_strdup); - xmlInitParser (); - xmlSetGenericErrorFunc (NULL, xml_shut_up); - } - - if (!_dbus_string_get_dirname (file, &dirname)) - { - _DBUS_SET_OOM (error); - goto failed; - } - - parser = bus_config_parser_new (&dirname, is_toplevel, parent); - if (parser == NULL) - { - _DBUS_SET_OOM (error); - goto failed; - } - - if (!_dbus_file_get_contents (&data, file, error)) - goto failed; - - reader = xmlReaderForMemory (_dbus_string_get_const_data (&data), - _dbus_string_get_length (&data), - NULL, NULL, 0); - if (reader == NULL) - { - _DBUS_SET_OOM (error); - goto failed; - } - - xmlTextReaderSetParserProp (reader, XML_PARSER_SUBST_ENTITIES, 1); - - dbus_error_init (&tmp_error); - xmlTextReaderSetStructuredErrorHandler (reader, xml_text_reader_error, &tmp_error); - - while ((ret = xmlTextReaderRead (reader)) == 1) - { - int type; - - if (dbus_error_is_set (&tmp_error)) - goto reader_out; - - type = xmlTextReaderNodeType (reader); - if (type == -1) - { - _DBUS_MAYBE_SET_OOM (&tmp_error); - goto reader_out; - } - - switch ((xmlReaderTypes) type) { - case XML_READER_TYPE_ELEMENT: - xml_text_start_element (parser, reader, &tmp_error); - break; - - case XML_READER_TYPE_TEXT: - case XML_READER_TYPE_CDATA: - { - DBusString content; - const char *value; - value = xmlTextReaderConstValue (reader); - if (value != NULL) - { - _dbus_string_init_const (&content, value); - bus_config_parser_content (parser, &content, &tmp_error); - } - else - _DBUS_MAYBE_SET_OOM (&tmp_error); - break; - } - - case XML_READER_TYPE_DOCUMENT_TYPE: - { - const char *name; - name = xmlTextReaderConstName (reader); - if (name != NULL) - bus_config_parser_check_doctype (parser, name, &tmp_error); - else - _DBUS_MAYBE_SET_OOM (&tmp_error); - break; - } - - case XML_READER_TYPE_END_ELEMENT: - { - const char *name; - name = xmlTextReaderConstName (reader); - if (name != NULL) - bus_config_parser_end_element (parser, name, &tmp_error); - else - _DBUS_MAYBE_SET_OOM (&tmp_error); - break; - } - - case XML_READER_TYPE_DOCUMENT: - case XML_READER_TYPE_DOCUMENT_FRAGMENT: - case XML_READER_TYPE_PROCESSING_INSTRUCTION: - case XML_READER_TYPE_COMMENT: - case XML_READER_TYPE_ENTITY: - case XML_READER_TYPE_NOTATION: - case XML_READER_TYPE_WHITESPACE: - case XML_READER_TYPE_SIGNIFICANT_WHITESPACE: - case XML_READER_TYPE_END_ENTITY: - case XML_READER_TYPE_XML_DECLARATION: - /* nothing to do, just read on */ - break; - - case XML_READER_TYPE_NONE: - case XML_READER_TYPE_ATTRIBUTE: - case XML_READER_TYPE_ENTITY_REFERENCE: - _dbus_assert_not_reached ("unexpected nodes in XML"); - } - - if (dbus_error_is_set (&tmp_error)) - goto reader_out; - } - - if (ret == -1) - _DBUS_MAYBE_SET_OOM (&tmp_error); - - reader_out: - xmlFreeTextReader (reader); - reader = NULL; - if (dbus_error_is_set (&tmp_error)) - { - dbus_move_error (&tmp_error, error); - goto failed; - } - - if (!bus_config_parser_finished (parser, error)) - goto failed; - _dbus_string_free (&dirname); - _dbus_string_free (&data); - if (is_toplevel) - xmlCleanupParser(); - _DBUS_ASSERT_ERROR_IS_CLEAR (error); - return parser; - - failed: - _DBUS_ASSERT_ERROR_IS_SET (error); - _dbus_string_free (&dirname); - _dbus_string_free (&data); - if (is_toplevel) - xmlCleanupParser(); - if (parser) - bus_config_parser_unref (parser); - _dbus_assert (reader == NULL); /* must go to reader_out first */ - return NULL; -} diff --git a/bus/desktop-file.c b/bus/desktop-file.c index ae441c5e..bfeb72e2 100644 --- a/bus/desktop-file.c +++ b/bus/desktop-file.c @@ -688,6 +688,12 @@ bus_desktop_file_load (DBusString *filename, else if (is_blank_line (&parser) || _dbus_string_get_byte (&parser.data, parser.pos) == '#') parse_comment_or_blank (&parser); + else if (parser.current_section < 0) + { + dbus_set_error(error, DBUS_ERROR_FAILED, + "invalid service file: key=value before [Section]"); + return NULL; + } else { if (!parse_key_value (&parser, error)) @@ -91,7 +91,10 @@ signal_handler (int sig) static const char message[] = "Unable to write to reload pipe - buffer full?\n"; - write (STDERR_FILENO, message, strlen (message)); + if (write (STDERR_FILENO, message, strlen (message)) != strlen (message)) + { + /* ignore failure to write out a warning */ + } } } break; @@ -113,7 +116,10 @@ signal_handler (int sig) "Unable to write termination signal to pipe - buffer full?\n" "Will exit instead.\n"; - write (STDERR_FILENO, message, strlen (message)); + if (write (STDERR_FILENO, message, strlen (message)) != strlen (message)) + { + /* ignore failure to write out a warning */ + } _exit (1); } } |