Commit graph

3817 commits

Author SHA1 Message Date
Chengwei Yang
00993d3702 Remove duplicate checking for pkg-config
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71985
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-11-27 15:05:01 +00:00
Chengwei Yang
ac502b5cdd Fix api doc for _dbus_spawn_async_with_babysitter
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71820
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-11-27 15:03:32 +00:00
Chengwei Yang
951b9700d5 Fix dbus_shutdown API document: returns --> frees
https://bugs.freedesktop.org/show_bug.cgi?id=71627
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-11-27 14:43:08 +00:00
Matt Fischer
eca9a5a29e Fix for MinGW build
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-27 14:29:04 +00:00
Simon McVittie
6173ba221a Merge branch 'dbus-1.6' 2013-11-12 10:55:43 +00:00
Simon McVittie
7c86eb023b NEWS for the SELinux change 2013-11-12 10:55:39 +00:00
Simon McVittie
4f1ed05afc NEWS 2013-11-12 10:47:55 +00:00
Radoslaw Pajak
03aeaccbff fixed memory freeing if error during listing services
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-12 10:42:31 +00:00
osmond sun
ba088208bc selinux: Use selinux_set_mapping() to avoid hardcoded constants for policy
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-07 14:52:27 -05:00
Simon McVittie
4cf2df1355 Merge branch 'dbus-1.6'
Conflicts:
	NEWS
2013-11-04 12:00:24 +00:00
Simon McVittie
c9ebd602c1 NEWS 2013-11-04 11:44:34 +00:00
DreamNik
7c00ed22d9 make_and_run_test_nodes: avoid undefined behaviour
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-04 11:42:04 +00:00
Simon McVittie
c92dffe6ab start on 1.7.10 2013-11-01 20:17:52 +00:00
Simon McVittie
727349248f start dbus-specification 0.23 2013-11-01 20:17:17 +00:00
Simon McVittie
fc7f0fa642 1.7.8 2013-11-01 19:17:02 +00:00
Colin Walters
983237258d bus/selinux: Fix previous commit for CAP_AUDIT_WRITE retention
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-01 19:13:21 +00:00
Simon McVittie
6b3a169bb0 Revert "start dbus-specification 0.23"
This reverts commit c8bc5f24b7.
Nothing changed since 0.22.
2013-11-01 18:49:48 +00:00
Simon McVittie
be19c7133a Merge branch 'dbus-1.6'
Conflicts:
	NEWS
	configure.ac
2013-11-01 18:49:13 +00:00
Simon McVittie
ba7b857118 Start on 1.6.20 2013-11-01 18:44:21 +00:00
Simon McVittie
f4606cf307 1.6.18 2013-11-01 16:24:22 +00:00
Chengwei Yang
1504b281e9 Close unused inherited file descriptor
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68559
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-11-01 12:54:06 +00:00
Simon McVittie
e326e762e9 Add comments describing how "compile with journald, run without" works 2013-11-01 12:43:07 +00:00
Chengwei Yang
5be1e77829 Handle activated child stdout/stderr correctly in systemd environment
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-01 12:41:02 +00:00
Chengwei Yang
ec6ea1a6a8 DBusBabysitter: change executable to log_name
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-01 12:40:41 +00:00
Chengwei Yang
f110f00116 Update configurable elements for dbus-daemon manual
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-01 12:14:48 +00:00
Chengwei Yang
1e52889d2e Remove unnecessary dbus_setenv()
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-01 12:08:33 +00:00
Simon McVittie
7c540d743d transaction_free: factor out
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=60859
Reviewed-by: Chengwei Yang
[removed unused variable based on review -smcv]
2013-11-01 11:48:40 +00:00
Simon McVittie
c3f20a67e6 dbus-spawn: draw a diagram
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-01 11:43:57 +00:00
Chengwei Yang
aa4b9d39bd Use SIGHUP without check in UNIX environment
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-01 11:35:58 +00:00
Chengwei Yang
5852f76cb9 Test: add test cases for message parsing
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-01 11:27:29 +00:00
Chengwei Yang
4ea6eb76f4 Fix memory or unix fd may leak in dbus_message_iter_get_args_valist
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-01 11:25:37 +00:00
Chengwei Yang
576c34dbc0 Correctly set number of arguments already handled
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-11-01 11:24:18 +00:00
Simon McVittie
8b8bbe4c8b dbus-spawn: correct a comment that falsely claimed thread-safety
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=60859
Reviewed-by: Chengwei Yang <chengwei.yang@intel.com>
2013-10-23 17:41:36 +01:00
Simon McVittie
33fcec4a47 _dbus_spawn_async_with_babysitter: correct documentation
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-23 17:20:07 +01:00
Simon McVittie
db8a1b053c Merge branch 'dbus-1.6' 2013-10-23 17:15:56 +01:00
Simon McVittie
cdff3bc41b path_namespace='/' should match everything
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>
2013-10-23 17:14:21 +01:00
Simon McVittie
880209788c $(in_data) is meant to contain the .in files
Reviewed-by: Colin Walters
2013-10-10 16:59:49 +01:00
Colin Walters
5618696768 test: Update build for previous commit
It should now be in in_data so we find it in $(srcdir).
2013-10-10 11:55:36 -04:00
Ralf Habacker
9f0366019d Use TEST_LISTEN in incoming-listen.conf.in instead of unix only hardcoded address
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68506
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-10-10 15:38:50 +02:00
Simon McVittie
c8bc5f24b7 start dbus-specification 0.23 2013-10-10 13:14:01 +01:00
Simon McVittie
bb024108b2 start 1.7.8 2013-10-09 18:47:14 +01:00
Simon McVittie
9e4f0bf0e1 D-Bus 1.7.6, spec 0.22 2013-10-09 11:34:14 +01:00
Simon McVittie
dc4d60d4a8 yet more NEWS 2013-10-09 11:27:55 +01:00
Chengwei Yang
faaa092f20 dbus-monitor: keep backwards compatibility
eavesdropping as a match rule key introduced in DBus 1.5.6, and the
privous implementation doesn't keep backwards compatibility with older
dbus-daemon.

And the reference dbus-daemon implementation just fail if unknwon key
found in match rule, this is undefined hehavior in DBus Sepcification.

Also there is a feature request for change this hehavior to
"ignore unknown key in match rule", See
https://bugs.freedesktop.org/show_bug.cgi?id=66114

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66107
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-10-09 11:26:46 +01:00
Andrey Mazo
b994830c7f dbus-send: replace --address with --peer and --bus.
--peer is a direct substitute for --address.
With --bus dbus-send registers on bus given by ADDRESS, thus allowing
messages to be sent to the bus.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48816
[adjusted to apply to current master -smcv]
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-10-09 11:18:20 +01:00
Simon McVittie
39673b945c Revert "dbus-send: replace --address"... to fix attribution
This reverts commit 5b74af796c.
2013-10-09 11:17:20 +01:00
Chengwei Yang
d842e6edd1 Remove unused key-word of DBus .service file
Key-word "Group" of DBus .service file hasn't been used since it was
introduced in 2007, so it's fine to remove it.

https://bugs.freedesktop.org/show_bug.cgi?id=19158
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-10-09 10:53:38 +01:00
Chengwei Yang
867bdd890f launch-helper: fix error code parsing
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66728
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-10-09 10:51:39 +01:00
Simon McVittie
76c5deff5c Merge branch 'dbus-1.6'
Conflicts:
	NEWS
	configure.ac
2013-10-08 18:42:12 +01:00
Simon McVittie
a96207da08 1.6.17 2013-10-08 17:33:56 +01:00