summaryrefslogtreecommitdiff
path: root/bus
Commit message (Collapse)AuthorAgeFilesLines
* internals: Decouple logging an error from exiting unsuccessfullySimon McVittie2017-07-051-1/+5
| | | | | | | | | | | | This lets _dbus_warn() and _dbus_warn_check_failed() fall through to flushing stderr and calling _dbus_abort(), meaning that failed checks and warnings can result in a core dump as intended. By renaming the FATAL severity to ERROR, we ensure that any code contributions that assumed the old semantics will fail to compile. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101568
* bus_driver_send_ack_reply: Make available to other modulesSimon McVittie2017-06-292-13/+14
| | | | | | Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101567
* driver: Use a data-driven approach to marking methods as privilegedSimon McVittie2017-06-291-18/+15
| | | | | | Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101567
* driver: Share bus_driver_get_conn_helper with other modulesSimon McVittie2017-06-293-27/+36
| | | | | | | | | Now that we're starting to implement methods in more places, it makes sense to share this code. The Stats interface can already benefit. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101567
* driver: Make eavesdropping a privileged actionSimon McVittie2017-06-291-3/+10
| | | | | | | | | | | | Eavesdropping on unicast messages to other processes is not something that should be done by processes in containers, or on the system bus by users other than root or the bus owner. bus/system.conf.in does not enable eavesdropping, but adding inadvisable configuration could. This brings it into line with Monitoring. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101567
* Install a systemd tmpfiles.d snippet to create /var/lib/dbus/machine-idSimon McVittie2017-06-282-1/+12
| | | | | | | | | | | | | On systemd systems, /etc/machine-id is guaranteed to exist and has the same format as the D-Bus machine ID. The major D-Bus implementations read /etc/machine-id if it exists, but some less up-to-date implementations still only read /var/lib/dbus/machine-id. We can be nice to those implementations by ensuring /var/lib/dbus/machine-id is a symlink; this way, the two files can never get out of sync. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101570
* Return the dbus-daemon SELinux context when asking about org.freedesktop.DBusLaurent Bigonville2017-06-123-2/+18
| | | | | | | | | | | | | | | | | | | Currently when asked the SELinux context of the owner of org.freedesktop.DBus, the dbus-daemon is returning an error. In the same situation when asked about the Unix user or the PID, the daemon would return its own user or pid. Do the same for the SELinux context by returning the daemon one. In particular this avoids an issue seen with systemd --user, where dbus-daemon responds to UpdateActivationEnvironment() by passing on the new environment to systemd with o.fd.systemd1.Manager.SetEnvironment(), but systemd cannot get the caller's SELinux context and so rejects the SetEnvironment() call. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101315 [smcv: Extend commit message to describe the symptom this fixes] Reviewed-by: Simon McVittie <smcv@collabora.com>
* tests: Don't exercise GetMachineId() or autolaunch if no machine IDSimon McVittie2017-06-081-0/+11
| | | | | | | | | | | | | | | | | | | | At the moment there is a hack in the implementation of GetMachineId() to stop tests from failing during "make check" on a system where dbus has never been installed, by silently generating a new unique fake "machine ID" for each process. I'm about to change that behaviour to report errors properly; skip affected test-cases if we can't read the real machine ID. The shell scripts to test dbus-launch are run both as "make check" tests (for which it is valid for dbus to be not correctly installed) and as installed-tests (for which that is not valid), so make them pass during "make check" but fail during installed testing. The tests in bus/ and test/name-test/ are only run during "make check" so they only have the code path where they are skipped. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=13194
* driver: Implement the Peer interface, for completenessSimon McVittie2017-06-081-1/+80
| | | | | | Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101257
* driver: Implement Properties, with Features and Interfaces propertiesSimon McVittie2017-06-081-2/+375
| | | | | | | | | | | | | We recommend using Properties for this sort of thing when designing D-Bus APIs, so it's a bit hypocritical that the reference message bus didn't. The Features and Interfaces properties can be used for feature-discovery as we add new larger features, while the Properties support can be used for finer-grained properties, for example in the interface planned for #100344. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101257
* driver: Generate child node elements in introspectionSimon McVittie2017-06-083-4/+28
| | | | | | | | This makes the /org/freedesktop/DBus path discoverable. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101257
* bus/driver: Only allow specific methods to be called at wrong pathsSimon McVittie2017-06-022-63/+74
| | | | | | | | | | | | | | | | | | | The default for the future should be that new functionality should only be available at /org/freedesktop/DBus, which is the canonical path of the "bus driver" object that represents the message bus. The disallowed methods are still in Introspect() output, and raise AccessDenied instead of UnknownMethod, to preserve the invariant that the o.fd.DBus interface has constant contents. test/dbus-daemon.c already asserts that UpdateActivationEnvironment() still raises AccessDenied when invoked on a non-canonical path; this has been in place since 1.8.14. Reviewed-by: Philip Withnall <withnall@endlessm.com> [smcv: Adjust comments, enum order, variable naming as per Philip's review] Signed-off-by: Simon McVittie <smcv@collabora.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101256
* bus/driver: Make non-core interfaces unavailable on most object pathsSimon McVittie2017-06-024-18/+41
| | | | | | | | | | | | | | | The o.fd.DBus interface needs to remain available on arbitrary object paths for backwards compatibility, and the Introspectable interface is genuinely useful, but everything else can be skipped. This is arguably an incompatible change for the undocumented Verbose interface, and for the GetAllMatchRules method on the undocumented Stats interface: previously those were available at all object paths. Reviewed-by: Philip Withnall <withnall@endlessm.com> [smcv: Adjust comments, enum order, variable naming as per Philip's review] Signed-off-by: Simon McVittie <smcv@collabora.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101256
* Remove unnecessary cast, bus_sid is already of type security_id_tLaurent Bigonville2017-05-311-1/+1
| | | | Reviewed-by: Simon McVittie <smcv@collabora.com>
* Remove calls to sidget/sidputLaurent Bigonville2017-05-313-60/+1
| | | | | | | | | sidget and sidput functions are noop and deprecated since libselinux 2.0.86. Also use pkg-config to detect libselinux and force version >= 2.0.86 Bug: https://bugs.freedesktop.org/show_bug.cgi?id=100912 Reviewed-by: Simon McVittie <smcv@collabora.com>
* build: Remove indirection from uses of ExpatSimon McVittie2017-04-101-5/+4
| | | | | | | | We haven't supported XML libraries other than Expat since 2013. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69801 Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com>
* Autotools build: Use pkg-config to find libexpatSimon McVittie2017-04-101-3/+3
| | | | | | | | The version of expat that added the .pc file was released in 2012. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69801 Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com>
* bus policy: assert that no invalid rule types are seenSimon McVittie2017-04-071-0/+10
| | | | | | | | | | This silences -Wswitch-default. Based on part of a patch from Thomas Zimmermann. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98191
* config-parser tests: explicitly skip non-comparable elementsSimon McVittie2017-04-071-1/+22
| | | | | | | | | | | For these types, the tagged union in the Element struct does not store anything we could usefuly compare. Based on part of a patch from Thomas Zimmermann. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98191
* config-parser: assert elements are of a known typeSimon McVittie2017-04-071-0/+2
| | | | | | | | | | This silences -Wswitch-default. Based on part of a patch from Thomas Zimmermann. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98191
* config-parser: treat impossible policy type as IGNOREDSimon McVittie2017-04-071-0/+1
| | | | | | | | | | This silences -Wswitch-default. Based on part of a patch from Thomas Zimmermann. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98191
* dbus-daemon: silence -Wswitch-defaultSimon McVittie2017-04-071-0/+5
| | | | | | | | | | | There should be no way signal_handler() can be called for a signal we didn't ask for. If it somehow happens, ignore it. Based on a patch from Thomas Zimmermann. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98191
* bus dispatch tests: treat impossible message_kind as GOT_SOMETHING_ELSESimon McVittie2017-04-071-0/+4
| | | | | | | | | | | | check_got_service_info() can't actually return an invalid GotServiceInfo, but if it somehow does, we want to fail the test. GOT_SOMETHING_ELSE already has that effect, and a similar meaning. Based on a patch from Thomas Zimmermann. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98191
* config-parser: Add transient service directoriesSimon McVittie2017-02-211-8/+71
| | | | | | | | | | | For configuration purposes these are treated as part of the standard session service directories, to avoid having to add new configuration syntax which would prevent an old dbus-daemon from reloading successfully. From an API perspective, they're separate, though. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99825 Reviewed-by: Philip Withnall <withnall@endlessm.com> Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* activation: Add support for enforcing strict naming on .service filesSimon McVittie2017-02-212-4/+78
| | | | | | | | | | | This is done on a per-directory basis. The use of the BusContext here means we have to make the activation test a little more realistic, by providing a non-NULL BusContext. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99825 Reviewed-by: Philip Withnall <withnall@endlessm.com> Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* config-parser: Store service directories in structsSimon McVittie2017-02-213-29/+202
| | | | | | | | | | | | | | This lets us give them a flags word, which we immediately use to track whether this directory should be watched with inotify or equivalent. The struct name is unfortunately a bit odd, because I had aimed to use BusServiceDir, but activation.c already has BusServiceDirectory so that would have been too confusing. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99825 Reviewed-by: Philip Withnall <withnall@endlessm.com> Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* activation-helper: Rename bus_config_parser_get_service_dirsSimon McVittie2017-02-213-4/+7
| | | | | | | | | | I'm about to change the version in the full-fat parser to return BusServiceDir structs. Name this one with "paths" instead, to avoid confusion. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99825 Reviewed-by: Philip Withnall <withnall@endlessm.com> Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* bus_config_parser_get_watched_dirs: Turn into a helper functionSimon McVittie2017-02-213-29/+79
| | | | | | | | | | This means we can test it more easily. At the moment it just contains service directories, because this config file is so cut-down that it doesn't have any config.d directories. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99825 Reviewed-by: Philip Withnall <withnall@endlessm.com> Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* config-parser test: Exercise the full config-parserSimon McVittie2017-02-201-19/+35
| | | | | | | | | Don't just exercise _dbus_get_standard_session_servicedirs(), but also its integration into the BusConfigParser. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99825 Reviewed-by: Philip Withnall <withnall@endlessm.com> Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* config-parser: Don't use dbus_setenv() to test service directoriesSimon McVittie2017-02-201-19/+55
| | | | | | | | | | | | | | | We can rely on the Autotools build system to pass in some safe values for XDG_DATA_HOME and XDG_DATA_DIRS that match DBUS_TEST_BUILDDIR. This test will now be skipped when running test-bus manually, or under the CMake build system. Under CMake it could be reinstated by setting the right environment variables. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99825 Reviewed-by: Philip Withnall <withnall@endlessm.com> [smcv: add missing newline as requested] [smcv: align DBUS_TEST_BUILDDIR with G_TEST_BUILDDIR] Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* config-parser: Simplify test for standard session service dirsSimon McVittie2017-02-201-21/+0
| | | | | | | | | | | There's little point in asserting that the defaults (without setting XDG_DATA_HOME, etc.) end with share/dbus-1/services, because we are about to re-test with known values for XDG_DATA_HOME etc., at which point we can check exact values which is more strict. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99825 Reviewed-by: Philip Withnall <withnall@endlessm.com> Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* config-parser: Remove dead code from system service dirs testSimon McVittie2017-02-201-40/+0
| | | | | | | | | | | | | | | | | progs was never used, because it was originally only used on Windows, where this test makes no sense and so is no longer run. It is unnecessary to check that the system service directories end with dbus-1/system-services, because we are going to check their exact values a short time later anyway. It is also unnecessary to set XDG_DATA_HOME and XDG_DATA_DIRS, because those variables are no longer respected for system service directories, only for session service directories. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99825 Reviewed-by: Philip Withnall <withnall@endlessm.com> Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* activation test: Use more realistic bus names for servicesSimon McVittie2017-02-201-3/+3
| | | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99825 Reviewed-by: Philip Withnall <withnall@endlessm.com> Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* activation: Put activation directories in an ordered listSimon McVittie2017-02-201-20/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | There are two circumstances in which we load .service files. The first is bus_activation_reload(), which is given an ordered list of directory paths, and reads each one in its correct order, highest-precedence first (normally ~/.local/share > /usr/local/share > /usr/share). This seems correct. However, if we are asked to activate a service for which we do not know of a .service file, we opportunistically reload the search path and try again, in the hope that it was recently-installed and not yet discovered by inotify. Prior to this commit, this would iterate through the hash table in arbitrary hash order, so we might load a service from /usr/share even though it was meant to be masked by a higher-priority service file in ~/.local/share or /usr/local/share. Before I add more elements to the search path, we should make sure it is always searched in the expected order. We do not actually make use of the hash table's faster-than-O(n) lookup by directory path anywhere, so there is no point in using a hash table, and we can safely replace it with an ordered data structure. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99825 Reviewed-by: Philip Withnall <withnall@endlessm.com> Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* config-parser: Fix indentationSimon McVittie2017-02-171-4/+4
| | | | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99825 Reviewed-by: Philip Withnall <withnall@endlessm.com> [smcv: also correct the same thing for system service directories] Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* config-parser: Eliminate duplicate functionalitySimon McVittie2017-02-171-14/+7
| | | | | | | | | We had two ways to append a path to the list of service directories. Collapse them into one. Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99825 Reviewed-by: Philip Withnall <withnall@endlessm.com>
* Merge branch 'dbus-1.10'Simon McVittie2017-02-161-15/+5
|\
| * activation test: Fix time-of-check/time-of-use bug waiting to happenSimon McVittie2017-02-161-15/+5
| | | | | | | | | | | | | | | | | | Creating a directory is atomic, stat'ing it to see whether to remove it is very much not. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99828 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Philip Withnall <withnall@endlessm.com>
| * Make uid 0 immune to pending_fd_timeout limitSimon McVittie2016-11-281-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a workaround for <https://bugs.freedesktop.org/show_bug.cgi?id=95263>. If a service sends a file descriptor sufficiently frequently that its queue of messages never goes down to 0 fds pending, then it will eventually be disconnected. logind is one such service. We do not currently have a good solution for this: the proposed patches either don't work, or reintroduce a denial of service security vulnerability (CVE-2014-3637). Neither seems desirable. However, we can avoid the worst symptoms by trusting uid 0 not to be malicious. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=95263 Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1591411 Reviewed-by: Ɓukasz Zemczak Tested-by: Ivan Kozik Tested-by: Finn Herpich Tested-by: autostatic Tested-by: Ben Parafina Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> (cherry picked from commit d5fae1db789d741295ca4746b84915d4bec591fd) [smcv: omit the test/dbus-daemon.c part, which does not apply unless a363822f5f58e5513e30dc2f84a30ae03cd91e07 is also applied]
| * Log to syslog when pending_fd_timeout is exceededSimon McVittie2016-11-281-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | This is either a denial-of-service attempt, a pathological performance problem or a dbus-daemon bug. Sysadmins should be told about any of these. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=86442 [smcv: add units to timeout: it is in milliseconds] Signed-off-by: Simon McVittie <smcv@debian.org> (cherry picked from commit 05cb619f0a6a4c9997832cb4acbb26f7a0be66c3)
| * Ignore ActivationFailure if not using systemd activationSimon McVittie2016-10-101-0/+8
| | | | | | | | | | | | | | | | | | | | | | This isn't security-related, just defensive programming: if dbus-daemon wasn't run with --systemd-activation, then there is no reason why systemd would legitimately send us this signal, and if it does we should just ignore it. Signed-off-by: Simon McVittie <smcv@debian.org> Reviewed-by: Colin Walters <walters@verbum.org> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98157
| * bus_driver_handle_message: reject ActivationFailure if unprivilegedSimon McVittie2016-10-101-0/+9
| | | | | | | | | | | | | | | | | | | | | | Specifically, this will allow ActivationFailure messages from our own uid or from root, but reject them otherwise, even if the bus configuration for who can own org.freedesktop.systemd1 is entirely wrong due to something like CVE-2014-8148. Signed-off-by: Simon McVittie <smcv@debian.org> Reviewed-by: Colin Walters <walters@verbum.org> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98157
| * dbus_activation_systemd_failure: do not use non-literal format stringSimon McVittie2016-10-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In principle this could lead to arbitrary memory overwrite via a format string attack in the message received from systemd, resulting in arbitrary code execution. This is not believed to be an exploitable security vulnerability on the system bus in practice: it can only be exploited by the owner of the org.freedesktop.systemd1 bus name, which is restricted to uid 0, so if systemd is attacker-controlled then the system is already doomed. Similarly, if a systemd system unit mentioned in the activation failure message has an attacker-controlled name, then the attacker likely already has sufficient access to execute arbitrary code as root in any case. However, prior to dbus 1.8.16 and 1.9.10, due to a missing check for systemd's identity, unprivileged processes could forge activation failure messages which would have gone through this code path. We thought at the time that this was a denial of service vulnerability (CVE-2015-0245); this bug means that it was in fact potentially an arbitrary code execution vulnerability. Bug found using -Wsuggest-attribute=format and -Wformat-security. Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Colin Walters <walters@verbum.org> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98157
| * dbus-daemon, dbus-launch: cope with callers having closed standard fdsSimon McVittie2016-08-121-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Debian bug <https://bugs.debian.org/829348>, lightdm appears to have been starting dbus-launch with at least one of the three standard fds 0, 1, 2 (stdin, stdout, stderr) closed. This resulted in the dbus-daemon's epoll_create1() returning a fd less than 3. Later, _dbus_become_daemon() replaces fds 0-2 with /dev/null. As a result, a subsequent call to _dbus_loop_add_watch() for the reload pipe resulted in calling epoll_ctl on the non-epoll fd pointing to /dev/null, which fails with EINVAL, resulting in the dbus-daemon exiting unsuccessfully. Unix programs are not normally expected to behave correctly when launched with the standard fds not already open; but at the same time, X11 autolaunching means that dbus-launch (and hence the dbus-daemon) can get started from an arbitrarily precarious situation. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=97008 Signed-off-by: Simon McVittie <smcv@debian.org> Reviewed-by: Thiago Macieira <thiago@kde.org> (cherry picked from commit c8f73a2a3a9d9d10587f596a62ebb64e8963197e)
| * Do not require systemd to have a service file if using it for activationSimon McVittie2015-12-021-12/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With --systemd-activation we special-case the name org.freedesktop.systemd1 by assuming that it will eventually connect to the bus. With that in mind, we can ignore whether it has a .service file, and let it be "activated" regardless. This fixes a regression test failure on non-systemd systems such as the Ubuntu 14.04 OS on travis-ci.org: UpdateActivationEnvironment failed, because it tried to update the (fake) systemd environment, but because systemd was not actually installed, there was no service file for it in the system's search paths. We could address this by placing a dummy service file with Exec=/bin/false in our search path like the real systemd does, but it seems cleaner to not require this; this would eventually enable the real systemd to stop installing that dummy service file. This would not happen outside the regression tests, because there is no sense in using --systemd-activation without systemd installed. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93194 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
| * embedded tests: accept and ignore --tap argumentSimon McVittie2015-12-023-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes them semi-command-line-compatible with a way we can invoke the GLib-based tests to get more useful debug logs. These tests still do not actually produce TAP output yet; I tried implementing that, but it requires changing a lot of noise on stdout to come out of stderr, and there was something weird going on with subprocesses restarting the test numbering which will need further investigation before making that change. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93194 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
| * Avoid -Wunused-label when compiling with libselinux but no libauditSimon McVittie2015-12-021-0/+2
| | | | | | | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93194 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
* | signals: Add some missing assertions to inline unit testsPhilip Withnall2017-02-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | check_parse() can return NULL on OOM, which we might as well handle gracefully in the tests with an assertion, rather than an explosion. At least it will shut Coverity up. Coverity ID: 54724 Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99643 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* | driver: Remove unnecessary NULL checkPhilip Withnall2017-02-131-1/+1
| | | | | | | | | | | | | | | | | | | | context is definitely non-NULL at this point, and has been dereferenced already on all paths leading to it. Coverity ID: 141062 Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99642 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* | systemd: add sysusers.d snippet for booting up with unpopulated /etcLennart Poettering2017-02-132-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | This adds a "sysusers.d" snippet for creating the system user "dbus" at boot, if it is missing, in order to support stateless systems that boot up with an empty /etc and need static information for determining which system users to create. This is only installed on systemd-based systems. Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99162