summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-01-06kqueue: replace tab with spaceChengwei Yang1-51/+51
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69332 [altered commit message to not say it fixes memory leaks -smcv] Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2014-01-06Make sure tests run with a temporary XDG_RUNTIME_DIRSimon McVittie4-1/+15
We don't want the regression tests' "session" getting mixed up in system-wide "sessions". This doesn't actually matter yet, but it is likely to matter in future. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=61301 Reviewed-by: Chengwei Yang <chengwei.yang@intel.com> [merged with earlier line-wrapping of TESTS_ENVIRONMENT -smcv] Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2014-01-06Reload policy rules for completed connectionsChengwei Yang3-0/+50
The message bus which can monitor its conf dirs for changes and reload confs immediately if dir monitor enabled, for example, inotify in Linux, kqueue in *BSD. However, it doesn't apply policy rules change for completed connections, so to apply policy rules change, the client connection has to disconnect first and then re-connect to message bus. For imcomplete connections, it always has the latest review of policy rules. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39463 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-12-02_dbus_check_dir_is_private_to_user: check that we own itSimon McVittie1-0/+10
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=61303 Reviewed-by: Chengwei Yang <chengwei.yang@intel.com> Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-12-02specification: discuss "listenable" and "connectable" addressesSimon McVittie1-5/+86
The --with-dbus-session-bus-connect-address configure option and the DBUS_SESSION_BUS_CONNECT_ADDRESS CMake variable expect a connectable address, while the --with-dbus-session-bus-listen-address option and the DBUS_SESSION_BUS_LISTEN_ADDRESS variable expect a listenable address. DBUS_SYSTEM_BUS_DEFAULT_ADDRESS currently has to be an address that is simultaneously listenable and connectable. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=61303 Reviewed-by: Chengwei Yang <chengwei.yang@intel.com> [fixed name of DBUS_SESSION_BUS_CONNECT_ADDRESS as per review -smcv] Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-11-27NEWSSimon McVittie1-0/+13
2013-11-27cmake: update README.cmake a bitChengwei Yang1-0/+12
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66453 Signed-off-by: Chengwei Yang <chengwei.yang@intel.com> Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
2013-11-27cmake: fix code styleChengwei Yang1-3/+3
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66453 Signed-off-by: Chengwei Yang <chengwei.yang@intel.com> Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
2013-11-27_dbus_append_address_from_socket(): escape value got from socket fdChengwei Yang1-5/+12
So far, this bug can be triggered in systemd environment, if the configured ListenStream for dbus.socket has characters must be escaped first. Then we'll get an error like "In D-Bus address, character '%c' should have been escaped\n" Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46013 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-11-27spec: explicitly mention filtering messages with no INTERFACESimon McVittie1-0/+9
This is an important security measure. Without it, the system bus would not deliver its intended security properties. The actual implementation has always behaved like this, I think. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68597 Reviewed-by: Chengwei Yang <chengwei.yang@intel.com>
2013-11-27Do not require messages without INTERFACE to be dispatchedSimon McVittie1-6/+10
Previously, if we have interfaces: interface com.example.foo: method Ambiguous() interface com.example.bar: method Ambiguous() method Unambiguous() implementations were required to deliver a message with no INTERFACE and METHOD=Unambiguous to "bar". A message with no INTERFACE and METHOD=Ambiguous could either be delivered to "foo", delivered to "bar" or treated as an error. Relax this to allow an error for the unambiguous case, too, and strongly recommend specifying the interface (which is best-practice). Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68597 Reviewed-by: Chengwei Yang <chengwei.yang@intel.com> Vaguely-acked-by: Thiago Macieira, David Zeuthen [and desrt objected that it didn't go far enough] Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-11-27Support printing unix file descriptors in dbus-send/dbus-monitorRobert Ancell1-1/+9
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=70592 Reviewed-by: Chengwei Yang <chengwei.yang@intel.com> Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-11-27Remove duplicate checking for pkg-configChengwei Yang1-2/+0
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71985 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-11-27Fix api doc for _dbus_spawn_async_with_babysitterChengwei Yang1-1/+1
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71820 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-11-27Fix dbus_shutdown API document: returns --> freesChengwei Yang1-1/+1
https://bugs.freedesktop.org/show_bug.cgi?id=71627 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-11-27Fix for MinGW buildMatt Fischer1-0/+5
dbus-sysdeps-win.c makes use of a constant called PROCESS_QUERY_LIMITED_INFORMATION, which was added after Windows XP. There is code present to make sure the constant is not used when running on an XP system, but the constant is still required at build time. Unfortunately, the Windows headers provided by MinGW are old enough that they do not contain this constant, so building with MinGW fails. This patch adds a definition for the constant if one is not already present. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71366 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de> [altered comment to specify MinGW32 < 4, since mingw-w64 and MinGW 4.0+ do have this constant -smcv]
2013-11-12Merge branch 'dbus-1.6'Simon McVittie3-2/+5
2013-11-12NEWS for the SELinux changeSimon McVittie1-0/+4
2013-11-12NEWSSimon McVittie1-0/+3
2013-11-12fixed memory freeing if error during listing servicesRadoslaw Pajak2-2/+2
Signed-off-by: Radoslaw Pajak <r.pajak@samsung.com> Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71526
2013-11-07selinux: Use selinux_set_mapping() to avoid hardcoded constants for policyosmond sun2-4/+28
Previous to the introduction of selinux_set_mapping(), DBus pulled constants generated from the system's policy at build time. But this means it's impossible to replace the system policy without rebuilding userspace components. This patch maps from arbitrary class/perm indices used by D-Bus and the policy values and handles all the translation at runtime on avc_has_perm() calls. Bug: https://bugs.freedesktop.org/attachment.cgi?id=88719 Reviewed-By: Colin Walters <walters@verbum.org> Tested-By: Colin Walters <walters@verbum.org>
2013-11-04Merge branch 'dbus-1.6'Simon McVittie2-2/+9
Conflicts: NEWS
2013-11-04NEWSSimon McVittie1-0/+4
2013-11-04make_and_run_test_nodes: avoid undefined behaviourDreamNik1-2/+5
In code that looks like n[i] = v(&i), where v increments i, C leaves it undefined whether the old or new value of i is used to locate n[i]. As it happens, gcc used the pre-increment value of i, but MSVC used the post-increment value. Fix this by inserting a sequence point to disambiguate the intended order. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69924 Reviewed-by: Chengwei Yang <chengwei.yang@intel.com> Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> [wrote commit message, fixed whitespace -smcv] Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-11-01start on 1.7.10Simon McVittie2-1/+4
2013-11-01start dbus-specification 0.23Simon McVittie1-2/+10
2013-11-01Imported Upstream version 1.7.8upstream/1.7.8Simon McVittie28-2901/+2007
2013-11-011.7.8Simon McVittie2-3/+27
2013-11-01bus/selinux: Fix previous commit for CAP_AUDIT_WRITE retentionColin Walters1-1/+7
As soon as capng_clear() is called, we won't appear to have CAP_AUDIT_WRITE. Fix this by checking for it before resetting the libcap state. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=49062 Tested-by: Laurent Bigonville <bigon@debian.org> Reviewed-by: Laurent Bigonville <bigon@debian.org> Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Lennart Poettering <lennart@poettering.net>
2013-11-01Revert "start dbus-specification 0.23"Simon McVittie1-10/+2
This reverts commit c8bc5f24b721bc03679c44669cf5e655c1e99b5f. Nothing changed since 0.22.
2013-11-01Merge branch 'dbus-1.6'Simon McVittie1-1/+4
Conflicts: NEWS configure.ac
2013-11-01Start on 1.6.20Simon McVittie2-1/+4
2013-11-01Imported Upstream version 1.6.18upstream/1.6.18Simon McVittie4-16/+54
2013-11-011.6.18Simon McVittie2-3/+10
2013-11-01Close unused inherited file descriptorChengwei Yang1-0/+2
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68559 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-11-01Add comments describing how "compile with journald, run without" worksSimon McVittie1-2/+5
2013-11-01Handle activated child stdout/stderr correctly in systemd environmentChengwei Yang2-2/+36
In systemd environment, dbus-daemon will run as no-fork mode since this is the recommended practice of systemd. In that scenario, child activated by dbus-daemon will inherit dbus-daemon standard streams, includes stdin/stdout/stderr. stdin will be redirected to /dev/null by systemd and stdout/stderr will be catched by systemd log subsystem. Since the child inherit stdout/stderr from dbus-daemon, so from systemd journal log, the child log output will be identified with dbus-daemon identifier. So it's a little confusing. This patch redirects the child stdout/stderr to systemd journal stream, and with its owned service name as identifier. However, thing not fixed perfectly due to the socket ucred of the child is owned by dbus-daemon, so the pid isn't the real pid of the chile. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68559 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-11-01DBusBabysitter: change executable to log_nameChengwei Yang5-31/+57
DBusBabysitter->executable is defined as executable name to use in error messages. However, if servicehelper used, then the executable name is servicehelper. It's not much help because we couldn't figure out which service we're trying to activated if error happens. In the following patch, we'll use service name to be activated as the child log identifier and add a parameter to _dbus_spawn_async_with_babysitter() to pass the log identifier. Since this is not the case in test, so executable changed to log_name. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68559 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-11-01Update configurable elements for dbus-daemon manualChengwei Yang1-0/+31
Update three configurable elements for dbus-daemon manual, <syslog>, <pidfile> and <allow_anonymous>, all of them are undocumented so far. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69125 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-11-01Remove unnecessary dbus_setenv()Chengwei Yang1-6/+0
DBUS_ACTIVATION_ADDRESS changed to DBUS_STARTER_ADDRESS and DBUS_ACTIVATION_BUS_TYPE changed to DBUS_STARTER_BUS_TYPE since 2005 by this commit - 8873c90 So the dbus_setenv() which used to unset the above two wrong environment variables has no effect in fact. And giving that setenv(3) and putenv(3) are not threadsafe, so it's better to remove them. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68308 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de> Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Acked-by: Colin Walters <walters@verbum.org>
2013-11-01transaction_free: factor outSimon McVittie1-10/+12
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=60859 Reviewed-by: Chengwei Yang [removed unused variable based on review -smcv]
2013-11-01dbus-spawn: draw a diagramSimon McVittie1-0/+42
There are enough pipes, fds and processes here that it's important to keep track of them. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=60859
2013-11-01Use SIGHUP without check in UNIX environmentChengwei Yang1-4/+0
As Simon's comment https://bugs.freedesktop.org/show_bug.cgi?id=66068#c8 we can do this in UNIX environment. Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-11-01Test: add test cases for message parsingChengwei Yang1-0/+205
Add test cases for testing: * If more arguments than requested are present, the requested arguments are returned and the extra arguments are ignored. * If arguments parse failed, ensure we didn't leak any memory or unix fd Bug: https://bugs.freedesktop.org/show_bug.cgi?id=21259 [added a check for fd leaks around verify_test_message_args_ignored() -smcv] Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-11-01Fix memory or unix fd may leak in dbus_message_iter_get_args_valistChengwei Yang1-4/+67
This is an aged bug since 2009, so let's fix it. Say if a previous parsing for unix fd or array of string successfully but then a later element parsing fail, then the unix fd or array of string leaked. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=21259 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-11-01Correctly set number of arguments already handledChengwei Yang1-3/+4
At privous, which increments the number of arguments already handled in the last of loop, however, if there is any invalid argument, then it will "goto out" and the number of arguments already handled is now incorrect. A following patch will use the number of arguments already handled as a loop terminate condition, so it's good to fix it before. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=21259 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-10-23dbus-spawn: correct a comment that falsely claimed thread-safetySimon McVittie1-3/+8
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=60859 Reviewed-by: Chengwei Yang <chengwei.yang@intel.com>
2013-10-23_dbus_spawn_async_with_babysitter: correct documentationSimon McVittie1-1/+1
env is used as you'd expect now. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=60859 Reviewed-by: Chengwei Yang <chengwei.yang@intel.com>
2013-10-23Merge branch 'dbus-1.6'Simon McVittie1-1/+29
2013-10-23path_namespace='/' should match everythingSimon McVittie1-1/+29
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=70799 Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk> Reviewed-by: Ryan Lortie <desrt@desrt.ca>