platform/upstream/dbus.git
10 years agoFix debug output about dbus server ref count
Chengwei Yang [Fri, 23 Aug 2013 09:19:51 +0000 (17:19 +0800)]
Fix debug output about dbus server ref count

dbus_server_disconnect() invokes dbus_server_unref() at the end of
function, the latter will print a trace about server ref count decrease
1. However, it doesn't invoke dbus_server_ref(), so there isn't a trace
about server ref count increase in debug output.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68303
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoFix comment about atomic operations
Chengwei Yang [Fri, 23 Aug 2013 09:13:46 +0000 (17:13 +0800)]
Fix comment about atomic operations

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68303
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoCleanup: simplify assertion check
Chengwei Yang [Fri, 23 Aug 2013 08:57:30 +0000 (16:57 +0800)]
Cleanup: simplify assertion check

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68303
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agofix whitespace
Simon McVittie [Fri, 23 Aug 2013 10:54:01 +0000 (11:54 +0100)]
fix whitespace

10 years agoCleanup: polish inotify backend
Chengwei Yang [Fri, 23 Aug 2013 08:52:38 +0000 (16:52 +0800)]
Cleanup: polish inotify backend

At previous, it will do get pid and print a verbose string per inotify
event, and then do send signal to the daemon.

This patch changes the behavior to get pid and print a verbose string
one time.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68303
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoCleanup: polish verbose mode checking
Chengwei Yang [Fri, 23 Aug 2013 08:49:39 +0000 (16:49 +0800)]
Cleanup: polish verbose mode checking

Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoNEWS
Simon McVittie [Fri, 23 Aug 2013 10:46:36 +0000 (11:46 +0100)]
NEWS

Also belatedly mention dbus-run-session in 1.7.4.

10 years agoDBus Spec: fix examples namespace to com.example
Chengwei Yang [Fri, 23 Aug 2013 07:52:18 +0000 (15:52 +0800)]
DBus Spec: fix examples namespace to com.example

There are a lot of examples in DBus Spec, and some of them just use the
namespace org.freedesktop, and so as object namespace org/freedesktop.
However, this is quite confusing.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66481
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agodbus-run-session: remove various extra variables from the environment
Simon McVittie [Wed, 5 Jun 2013 18:58:33 +0000 (19:58 +0100)]
dbus-run-session: remove various extra variables from the environment

DBUS_SESSION_BUS_PID is not mandatory to set, but we should unset it
if present, since it points to a different session's bus. Likewise for
DBUS_SESSION_BUS_WINDOWID.

Similarly, if DBUS_STARTER_BUS_TYPE and DBUS_STARTER_ADDRESS
are set (as they would be under GNOME Terminal 3.8, see
<https://bugs.freedesktop.org/show_bug.cgi?id=63119>) then they
are likely to point to a different session's bus.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39196
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Colin Walters <walters@verbum.org>
10 years agodbus-daemon emulation improved and refactored
Radoslaw Pajak [Fri, 23 Aug 2013 10:40:57 +0000 (12:40 +0200)]
dbus-daemon emulation improved and refactored

- added handling of GetId method of org.freedesktop.DBus
- errors of org.freedesktop.DBus methods expanded to equal that of dbus-daemon
- org.freedesktop.DBus emulation refactored and optimized
- some minor fixes

Change-Id: I1d9e670e36d6bc568518feacb6b14efc052ce735

10 years agoExport dbus_setenv() as a utility function
Simon McVittie [Wed, 5 Jun 2013 18:58:22 +0000 (19:58 +0100)]
Export dbus_setenv() as a utility function

It's sufficiently portable that GLib has an equivalent, and I really
don't want to have to either open-code it in dbus-run-session or
link dbus-run-session statically. We have enough statically-linked
rubbish already.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39196
Reviewed-by: Colin Walters <walters@verbum.org>
10 years agoRevert "Factor out DBusAuthorization from DBusTransport"
Simon McVittie [Fri, 23 Aug 2013 10:09:35 +0000 (11:09 +0100)]
Revert "Factor out DBusAuthorization from DBusTransport"

This reverts commit 600621dbc8073527a958091316eddfbb490c1032.

10 years agoRevert "Actually use DBusAuthorization in DBusAuth EXTERNAL mech"
Simon McVittie [Fri, 23 Aug 2013 10:09:34 +0000 (11:09 +0100)]
Revert "Actually use DBusAuthorization in DBusAuth EXTERNAL mech"

This reverts commit d5d25b5efd35d8d9bbb9d58cae441debf8f7ded6.

10 years agoRevert "Add new files really."
Simon McVittie [Fri, 23 Aug 2013 10:09:33 +0000 (11:09 +0100)]
Revert "Add new files really."

This reverts commit 78c447173dfba167ac8082652c02e453e4b519ce.

10 years agoRevert "Rename authorized_identity in authenticated_identity for clarity sake."
Simon McVittie [Fri, 23 Aug 2013 10:09:32 +0000 (11:09 +0100)]
Revert "Rename authorized_identity in authenticated_identity for clarity sake."

This reverts commit ef82b381524d30684a30b32b3b9016ed4229290c.

10 years agoRevert "Fixed rejected hunk complete."
Simon McVittie [Fri, 23 Aug 2013 10:09:31 +0000 (11:09 +0100)]
Revert "Fixed rejected hunk complete."

This reverts commit 541063a3ab568db8302fbce3c15b22cdff154517.

10 years agoRevert "Enable anonymous authorization for tests"
Simon McVittie [Fri, 23 Aug 2013 10:09:31 +0000 (11:09 +0100)]
Revert "Enable anonymous authorization for tests"

This reverts commit 22fc03d274f186a788efbdbe6b6dfcff1ad474df.

10 years agoRevert "Remove refcounting from DBusAuth and DBusAuthorization"
Simon McVittie [Fri, 23 Aug 2013 10:09:30 +0000 (11:09 +0100)]
Revert "Remove refcounting from DBusAuth and DBusAuthorization"

This reverts commit 7f6d7229d8812d985d544cf5dd3636865c5abc81.

10 years agoRevert "dbus_connection_set_allow_anonymous(): fix doc"
Simon McVittie [Fri, 23 Aug 2013 10:09:29 +0000 (11:09 +0100)]
Revert "dbus_connection_set_allow_anonymous(): fix doc"

This reverts commit a4722d4480de77af6a0c8201882731dc35777d36.

10 years agoRevert "trivial: re-word authorization failure message"
Simon McVittie [Fri, 23 Aug 2013 10:09:28 +0000 (11:09 +0100)]
Revert "trivial: re-word authorization failure message"

This reverts commit 65cd1208e0559fffe4ba82ef10c6491744869b09.

10 years agoRevert "Remove transport's call to _dbus_authorization_do_authorization()."
Simon McVittie [Fri, 23 Aug 2013 10:09:21 +0000 (11:09 +0100)]
Revert "Remove transport's call to _dbus_authorization_do_authorization()."

This reverts commit 64e50dd167993fb2344d2d3be18bb0d5820b5b26.

10 years agoRemove transport's call to _dbus_authorization_do_authorization().
Cosimo Alfarano [Thu, 22 Aug 2013 23:56:48 +0000 (01:56 +0200)]
Remove transport's call to _dbus_authorization_do_authorization().

All mechs do authorization before answering OK/REJECT.
There is no reason to run a second round of authorization which will
return the same answer of the first time (when OK) or will never be
reched (if REJECTed).

Bug: http://bugs.freedesktop.org/show_bug.cgi?id=39720
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoManual rebase fix.
Ralf Habacker [Fri, 23 Aug 2013 01:10:15 +0000 (03:10 +0200)]
Manual rebase fix.

10 years agoAdd a test-case for trying to connect with the wrong GUID
Simon McVittie [Mon, 12 Mar 2012 13:13:55 +0000 (13:13 +0000)]
Add a test-case for trying to connect with the wrong GUID

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39720
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agotrivial: re-word authorization failure message
Simon McVittie [Fri, 23 Aug 2013 01:01:53 +0000 (03:01 +0200)]
trivial: re-word authorization failure message

Bug: http://bugs.freedesktop.org/show_bug.cgi?id=39720
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
10 years agoAdd a simple manual test for authentication/authorization.
Simon McVittie [Fri, 23 Aug 2013 00:57:27 +0000 (02:57 +0200)]
Add a simple manual test for authentication/authorization.

Bug: http://bugs.freedesktop.org/show_bug.cgi?id=39720
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
10 years agodbus_connection_set_allow_anonymous(): fix doc
Cosimo Alfarano [Tue, 18 Oct 2011 11:08:00 +0000 (12:08 +0100)]
dbus_connection_set_allow_anonymous(): fix doc

Bug: http://bugs.freedesktop.org/show_bug.cgi?id=39720
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
10 years agoRemove refcounting from DBusAuth and DBusAuthorization
Cosimo Alfarano [Fri, 23 Aug 2013 00:12:46 +0000 (02:12 +0200)]
Remove refcounting from DBusAuth and DBusAuthorization

Those structs are for DBusTransport internal use, they should not be
referenced outside it.
The transport needs only to allocate memory on initialization and free
it on finalization.
The lifecycle for the two allocated structs is DBusTransport lifecycle
and at DBusTransport's finalization its connection is already
disconnected.
The assumption is that the transport owns a reference for any object the
two structs holds a reference for (particularly DBusConnection)

Bug: http://bugs.freedesktop.org/show_bug.cgi?id=39720
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoEnable anonymous authorization for tests
Cosimo Alfarano [Fri, 7 Oct 2011 10:25:00 +0000 (11:25 +0100)]
Enable anonymous authorization for tests

Now that authorization is in SASL mechs, enable anonymous authorizations
when we are testing anonymous mechs functionality

Bug: http://bugs.freedesktop.org/show_bug.cgi?id=39720
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoFixed rejected hunk complete.
Ralf Habacker [Thu, 22 Aug 2013 23:46:56 +0000 (01:46 +0200)]
Fixed rejected hunk complete.

10 years agoRename authorized_identity in authenticated_identity for clarity sake.
Cosimo Alfarano [Thu, 22 Aug 2013 23:42:54 +0000 (01:42 +0200)]
Rename authorized_identity in authenticated_identity for clarity sake.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39720
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoAdd new files really.
Ralf Habacker [Thu, 22 Aug 2013 23:36:31 +0000 (01:36 +0200)]
Add new files really.

10 years agoActually use DBusAuthorization in DBusAuth EXTERNAL mech
Cosimo Alfarano [Thu, 22 Aug 2013 23:30:55 +0000 (01:30 +0200)]
Actually use DBusAuthorization in DBusAuth EXTERNAL mech

Also update the authentication script so that DBusAuthorization default
rules are used during testing.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39720
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoFactor out DBusAuthorization from DBusTransport
Cosimo Alfarano [Thu, 22 Aug 2013 23:11:10 +0000 (01:11 +0200)]
Factor out DBusAuthorization from DBusTransport

In order to authorize/reject a connection in a polite way, instead of
cutting it off after authentication succeed and Hello() is
sent, because authorization failed, we need to factor out some
authorization bits from DBusTransport and pass them to DBusAuth.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39720
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoFix confusion between "is it authenticated?" and "try to authenticate"
Simon McVittie [Thu, 22 Aug 2013 22:43:02 +0000 (00:43 +0200)]
Fix confusion between "is it authenticated?" and "try to authenticate"

Historically, _dbus_transport_get_is_authenticated() has had the
side-effect of trying to advance the authentication state machine (if
there's enough buffered input to do so). This seems an inappropriate
activity for what looks like a simple getter.

Split it into _dbus_transport_try_to_authenticate (which does what it
always used to do) and _dbus_transport_peek_is_authenticated (which
is the simple getter version).

To minimize the difference in behaviour for the stable branch of D-Bus,
I've only used _dbus_transport_peek_is_authenticated where it was used
in an assertion, which should clearly not have side effects (and I've
checked that the asserting function cannot be called until both
authentication and authorization have completed). Replacing most of the
calls to get_is_authenticated with try_to_authenticate is a possible
piece of future work.

Based on patches from Cosimo Alfarano, who noticed this
assertion-with-side-effects.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
https://bugs.freedesktop.org/show_bug.cgi?id=39720
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.com>
10 years agoUnset/free also windows user function, finalizing the connection
Cosimo Alfarano [Tue, 11 Oct 2011 15:41:31 +0000 (16:41 +0100)]
Unset/free also windows user function, finalizing the connection

It's currently not used, but it's safer to unset it and free user's
data for avoiding future head-aches

https://bugs.freedesktop.org/show_bug.cgi?id=39720
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoMore NEWS
Simon McVittie [Thu, 22 Aug 2013 19:46:51 +0000 (20:46 +0100)]
More NEWS

10 years agoFix reference doc in comments
Chengwei Yang [Tue, 16 Jul 2013 06:34:59 +0000 (14:34 +0800)]
Fix reference doc in comments

10 years agoMove function to the right place where it supposed to be used
Chengwei Yang [Fri, 12 Jul 2013 03:34:31 +0000 (11:34 +0800)]
Move function to the right place where it supposed to be used

Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoDBus Spec: Fix sample service file
Chengwei Yang [Tue, 2 Jul 2013 05:31:38 +0000 (13:31 +0800)]
DBus Spec: Fix sample service file

There are two errors in the sample service file.

First, a typo, Names should be Name.
Second, can not specify multiple names.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66481
Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoIgnore more unused staff if build with tests but without asserts
Chengwei Yang [Thu, 27 Jun 2013 04:56:20 +0000 (12:56 +0800)]
Ignore more unused staff if build with tests but without asserts

https://bugs.freedesktop.org/show_bug.cgi?id=66069
Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoDoc: fix incorrect param names, missing params, non-exist params
Chengwei Yang [Thu, 20 Jun 2013 14:03:49 +0000 (22:03 +0800)]
Doc: fix incorrect param names, missing params, non-exist params

Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=65755

10 years agoUse iface instead of interface in function parameters
Ivan Romanov [Thu, 22 Aug 2013 18:11:23 +0000 (19:11 +0100)]
Use iface instead of interface in function parameters

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66493
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoDocument GetAdtAuditSessionData and GetConnectionSELinuxSecurityContext
Simon McVittie [Wed, 27 Feb 2013 19:22:30 +0000 (19:22 +0000)]
Document GetAdtAuditSessionData and GetConnectionSELinuxSecurityContext

These are only part of the DBus interface because dbus-daemon didn't
previously support multiple interfaces. I don't know enough about
either of these security frameworks to know what they return, but
perhaps one day someone who knows about Solaris or SELinux will tell
us...

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54445
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
10 years agoGetConnectionCredentials: add
Simon McVittie [Thu, 22 Aug 2013 17:21:58 +0000 (18:21 +0100)]
GetConnectionCredentials: add

The initial set of credentials is just UnixUserID and ProcessID.
The rest can follow when someone is sufficiently interested to actually
test them.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54445
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
[rename a function that Ralf found unclear -smcv]
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoFix build with "--enable-stats"
Chengwei Yang [Fri, 19 Jul 2013 02:04:40 +0000 (10:04 +0800)]
Fix build with "--enable-stats"

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54445
Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoMerge branch 'dbus-1.6'
Simon McVittie [Thu, 22 Aug 2013 17:03:59 +0000 (18:03 +0100)]
Merge branch 'dbus-1.6'

Conflicts:
NEWS

10 years agoNEWS for 1.6
Simon McVittie [Thu, 22 Aug 2013 17:03:24 +0000 (18:03 +0100)]
NEWS for 1.6

10 years agoNEWS
Simon McVittie [Thu, 22 Aug 2013 17:02:42 +0000 (18:02 +0100)]
NEWS

10 years agoNext 2 org.freedesktop.DBus method, comments, cleanups
Radoslaw Pajak [Tue, 13 Aug 2013 10:17:36 +0000 (12:17 +0200)]
Next 2 org.freedesktop.DBus method, comments, cleanups

   - added handling of next 2 org.freedesktop.DBus methods: GetConnectionUnixUser, GetConnectionUnixProcessID
   - comments added
   - some cleanups

Change-Id: Ie840bfce48b849e037a128b2a76587d3e0f80197

10 years agoFixed compiler warning on windows.
Ralf Habacker [Mon, 19 Aug 2013 19:29:18 +0000 (21:29 +0200)]
Fixed compiler warning on windows.

https://bugs.freedesktop.org/show_bug.cgi?id=61874
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoDocumentation fix.
Ralf Habacker [Mon, 12 Aug 2013 15:46:48 +0000 (17:46 +0200)]
Documentation fix.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=29666
Reviewed-by: Chengwei Yang <chengwei.yang.cn@gmail.com>
10 years agoDocumentation expanded
Michal [Mon, 12 Aug 2013 15:10:54 +0000 (17:10 +0200)]
Documentation expanded

Change-Id: I91b6e1de13794e5fc585b16c08c1d4a85cb4f966

10 years agoFix for long id continued, iprovements, comments
Radoslaw Pajak [Tue, 13 Aug 2013 07:58:55 +0000 (09:58 +0200)]
Fix for long id continued, iprovements, comments

 - fix for long id continued (in next lines)
 - bloom size changed from define to actual value sent by bus
 - unnecessary parameters removed from functions
 - some comments added

Change-Id: I8547b7253ef1a518a950d290bb07f3a5b257c212

10 years agoMemfd: fix big messages receiving.
Michal [Mon, 12 Aug 2013 13:24:32 +0000 (15:24 +0200)]
Memfd: fix big messages receiving.

Memory buffer needs to be bigger

Change-Id: Ibb19986c267a7e80bcbfe47c74f270e7acd47ea2

10 years agoFixed error with id >0x7FFFFFFFFFFFFFFF and others
Radoslaw Pajak [Mon, 12 Aug 2013 12:10:42 +0000 (14:10 +0200)]
Fixed error with id >0x7FFFFFFFFFFFFFFF and others

 - fixed error with id > 0x7FFFFFFFFFFFFFFF because of wrong string to unsigned long long int conversion
 - KDBUS_MSG_REPLY_DEAD reply error mapped to dbus reply error
 - removed unused function parameters
 - another part of currently unused authentication related code put into #ifdef DBUS_AUTHENTICATION
 - some comments added
 - removed unnecesery code commented out in past

Change-Id: I19012c23e4afc808ff3e2607a237303bd5552822

10 years agoFixed remaining issues.
Ralf Habacker [Fri, 9 Aug 2013 14:14:35 +0000 (16:14 +0200)]
Fixed remaining issues.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66060
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoAdd debug messages to load_ex_ip_helper_procedures().
Ralf Habacker [Thu, 8 Aug 2013 21:23:11 +0000 (23:23 +0200)]
Add debug messages to load_ex_ip_helper_procedures().

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66060
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoRefactored get_pid_from_extended_tcp_table() and get_pid_from_tcp_ex_table() to be...
Ralf Habacker [Thu, 8 Aug 2013 20:53:40 +0000 (22:53 +0200)]
Refactored get_pid_from_extended_tcp_table() and get_pid_from_tcp_ex_table() to be more equal.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66060
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoFix for broken wine AllocateAndGetTcpExTableFromStack() implementation.
Ralf Habacker [Thu, 8 Aug 2013 20:42:35 +0000 (22:42 +0200)]
Fix for broken wine AllocateAndGetTcpExTableFromStack() implementation.

On wine (tested with 1.5.6) the mentioned function could not be located in
iphlpapi.dll using LoadLibrary()/GetProcAddress(), which is the prefered
method to get a tcp peer pid on WinXP <= SP2.
To workaround this limitation we use GetExtendedTcpTable() first to get the peer pid.
If this fails (which happens at least on real WinXP SP2) we then use
AllocateAndGetTcpExTableFromStack() to get the pid.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66060
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoAdd doc to load_ex_ip_helper_procedures().
Ralf Habacker [Thu, 8 Aug 2013 14:52:54 +0000 (16:52 +0200)]
Add doc to load_ex_ip_helper_procedures().

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66060
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoOnly take process id of localhost client connection entries.
Ralf Habacker [Thu, 8 Aug 2013 14:48:04 +0000 (16:48 +0200)]
Only take process id of localhost client connection entries.

This patch makes sure, that the process id is fetched only from localhost
 client address connections fetched from the tcp table.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66060
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoFixed bug of unsupported GetExtendTcpTable() on Windows XP SP2 and earlier.
Ralf Habacker [Wed, 7 Aug 2013 18:47:55 +0000 (20:47 +0200)]
Fixed bug of unsupported GetExtendTcpTable() on Windows XP SP2 and earlier.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66060
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoAdded NameList method handling, small improvemnets and cleanups
Radoslaw Pajak [Thu, 8 Aug 2013 08:19:59 +0000 (10:19 +0200)]
Added NameList method handling, small improvemnets and cleanups

 - Addded handling of org.freedesktop.DBus method "NameList"
 - Element not found added to error messages
 - in hello message commented out flags for sending unnecessary kdbus message parts
 - change in kdbus message decoding - if part size is incorrect, stop decoding
 - some small cleanups and improvements

Change-Id: I8ee4cf8301f1f3876f614c25798abc63c4ebe634

10 years agoDump fetched sid on return of _dbus_getsid().
Ralf Habacker [Sat, 29 Jun 2013 11:46:53 +0000 (13:46 +0200)]
Dump fetched sid on return of _dbus_getsid().

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66060
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoAdd WINXP <= SP3 support to _dbus_getsid().
Ralf Habacker [Sat, 29 Jun 2013 11:45:41 +0000 (13:45 +0200)]
Add WINXP <= SP3 support to _dbus_getsid().

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66060
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoAdded fd passing and small corrections
Radoslaw Pajak [Tue, 6 Aug 2013 13:27:20 +0000 (15:27 +0200)]
Added fd passing and small corrections

 - added passing fd through kdbus
 - fixed sizes of mapped area when receiving memfd and receive pool
 - unnecessary authentication code disabled by definition DBUS_AUTHENTICATION
 - small fixes and cleanups

Change-Id: Ibe505c5ccb2790a054eb37a3f899ed5b2a378bc6

10 years agoFix_for_32bit: added data alignment for some kdbus structures
Jacek Janczyk [Tue, 6 Aug 2013 13:49:28 +0000 (15:49 +0200)]
Fix_for_32bit: added data alignment for some kdbus structures

Added alignments required by kdbus architecture in structures
passed to ioctl.

Change-Id: I4ab48709a4f6f43091f3fffa299e75ee1801ccc1
Signed-off-by: Jacek Janczyk <j.janczyk@samsung.com>
10 years agorefactored memfd
Michal Eljasiewicz [Tue, 6 Aug 2013 11:28:37 +0000 (13:28 +0200)]
refactored memfd

setup at every message. Pool sizes changed

Change-Id: Ia0bc93ceb0928fb241f6ed0c638c7b89e8cca73f

10 years agoPool sizes redefined and cleanup
Radoslaw Pajak [Mon, 5 Aug 2013 06:50:06 +0000 (08:50 +0200)]
Pool sizes redefined and cleanup

 - POOL_SIZE split into RECEIVE_POOL_SIZE and MEMFD_POOL_SIZE
 - deleted some unused lines already commented out
 - fixed dbus_bus_register

Change-Id: I981e00b795856e83000445bc68df208e01257594

10 years ago - fixed detecting whether emulate org.freedesktop.DBus interface (dbus daemon)
Radoslaw Pajak [Wed, 24 Jul 2013 13:17:26 +0000 (15:17 +0200)]
 - fixed detecting whether emulate org.freedesktop.DBus interface (dbus daemon)
   when sending message
 - improved dbus_bus_add_match for kdbus - now distinguish sender key (mapped to src_name),
   interface key (mapped to bloom) and detects org.freedesktop.DBus's name related members
 - bloom filled in kdbus_write... functions because of above dbus_bus_add_match improvement
 - added dbus_bus_remove_match - but it ignire rules and deletes everythig for given connection id

Change-Id: I09e658f748ba9230601c128c3e67a0cb6ce8340d

10 years agotest/marshal: Ensure we use suitably aligned buffers
Colin Walters [Wed, 24 Jul 2013 20:48:58 +0000 (21:48 +0100)]
test/marshal: Ensure we use suitably aligned buffers

This test was failing on s390; though it could fail
on other platforms too.  Basically we need to be sure
we're passing at least word-aligned buffers to the
demarshalling code.  malloc() will do that for us.

https://bugs.freedesktop.org/show_bug.cgi?id=67279

10 years agokdbus_write_msg refactored.
Michal Eljasiewicz [Tue, 23 Jul 2013 10:30:49 +0000 (12:30 +0200)]
kdbus_write_msg refactored.
kdbus_write_msg_encoded merged into single
function kdbus_write_msg.
added MEMFD handling.
FIX refactored out concatenating msg header & body
FIX encoded data is sent with memfd too

10 years ago- fixed dbus_bus_request_name
Radoslaw Pajak [Fri, 19 Jul 2013 13:38:17 +0000 (15:38 +0200)]
- fixed dbus_bus_request_name
- fixed error handling when writing to not existinig recipient
- added handling of org.freedesktop.DBus methods: GetNameOwner and NameHasOwner
- some small optimizations

Change-Id: I4ffdce1a7b089bedb065efe2247a22c44ccf9d86

10 years agoMinor fixes and improvements. Deleted some not needed debug verboses.
Radoslaw Pajak [Tue, 16 Jul 2013 11:39:29 +0000 (13:39 +0200)]
Minor fixes and improvements. Deleted some not needed debug verboses.

Change-Id: I43ed82dd0f103d96e7df48ee7e6cd859dcb640af

10 years ago - fixed sending messages without body
Radoslaw Pajak [Thu, 11 Jul 2013 12:57:19 +0000 (14:57 +0200)]
 - fixed sending messages without body
 - fixed sending messages without requesting name

Change-Id: Ib2c5de13829b51b1a2ddac78511f6e4c83dc6c22

10 years ago- kdbus reply timeout translated to DBus message
Radoslaw Pajak [Wed, 10 Jul 2013 13:14:22 +0000 (15:14 +0200)]
- kdbus reply timeout translated to DBus message
- kdbus message sending error ENXIO (no recipient on the bus) translated to corresponding DBus error message ServiceU$
- compatibility with 32bit machines improved

10 years agorefactoring: function prototypes unnecessary
Michal Eljasiewicz [Tue, 9 Jul 2013 13:37:58 +0000 (15:37 +0200)]
refactoring: function prototypes unnecessary

Change-Id: Ib41be287421d45c0ba284fd88cb9dff59c85eccc
Signed-off-by: Michal Eljasiewicz <m.eljasiewic@samsung.com>
10 years agoOnly comments - commit needed to overcome git/gerrit problems
Radoslaw Pajak [Tue, 9 Jul 2013 11:31:48 +0000 (13:31 +0200)]
Only comments - commit needed to overcome git/gerrit problems

10 years agoAdded translation of system broadcast (new id, id remove, new name, name removed)
Radoslaw Pajak [Tue, 9 Jul 2013 07:37:37 +0000 (09:37 +0200)]
Added translation of system broadcast (new id, id remove, new name, name removed)
from kdbus format to dbus messages(signals).
do_io_error in do_reading don't need to be commented out any more.

todo message replay timeout to be translated form kdbus to dbus

10 years agoWorking - send method call and reply with serverClient
Radoslaw Pajak [Fri, 5 Jul 2013 12:46:33 +0000 (14:46 +0200)]
Working - send method call and reply with serverClient
added sender to message header when kdbus
header aligned by upper layers - do not need to align in kdbus
do_io_error stil must be commented out in do reading when bytes_read == 0

todo - translate kdbus "system" broadcasts into dbus messages

10 years agoWorking - simple message passing with serverClient signal send-receive
Radoslaw Pajak [Fri, 5 Jul 2013 08:01:13 +0000 (10:01 +0200)]
Working - simple message passing with serverClient signal send-receive
BUT do_io_error must be commented out in do_reading when bytes_read == 0 to filter out kdbus "system" broadcasts (new id, new name, name remove, id remove)

TODO - translate kdbus "system" broadcasts into dbus messages
     - test messages with header not aligned

10 years agoWorking: - dbus authorization replaced by kdbus policies
Radoslaw Pajak [Wed, 3 Jul 2013 07:47:11 +0000 (09:47 +0200)]
Working: - dbus authorization replaced by kdbus policies
         - sending message
To do: dbus authorization replaced by kdbus policies to be refactored when kdbus policies will be documented

10 years agoNEWS for 1.7.x
Simon McVittie [Mon, 1 Jul 2013 11:24:53 +0000 (12:24 +0100)]
NEWS for 1.7.x

10 years agocmake: do not bind to any particular POSIX C standard
Chengwei Yang [Fri, 28 Jun 2013 12:26:28 +0000 (20:26 +0800)]
cmake: do not bind to any particular POSIX C standard

This caused build failures on FreeBSD. Defining _POSIX_C_SOURCE to
a particular version will disable common non-POSIX extensions like
PF_UNIX, and on some systems will also disable features of later
POSIX versions, like IPv6. If we don't ask for a specific version,
we'll get some sort of sensible default.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66257
Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
[made the commit message more concise -smcv]
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoMerge branch 'dbus-1.6'
Simon McVittie [Mon, 1 Jul 2013 11:16:05 +0000 (12:16 +0100)]
Merge branch 'dbus-1.6'

Conflicts:
NEWS

10 years agoNEWS for 1.6.x
Simon McVittie [Mon, 1 Jul 2013 11:15:04 +0000 (12:15 +0100)]
NEWS for 1.6.x

10 years agoMake the test for #53499 more obviously correct
Simon McVittie [Mon, 1 Jul 2013 11:14:02 +0000 (12:14 +0100)]
Make the test for #53499 more obviously correct

10 years agoTest: add a test case for escaping byte > 127
Chengwei Yang [Sat, 29 Jun 2013 04:21:27 +0000 (12:21 +0800)]
Test: add a test case for escaping byte > 127

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=53499
Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoFix: a non ascii byte will trigger BadAddress error
Chengwei Yang [Sat, 29 Jun 2013 03:56:20 +0000 (11:56 +0800)]
Fix: a non ascii byte will trigger BadAddress error

If a byte in DBusString *unescaped isn't a ascii byte, which will be
cast to char (signed char on most of platform), so that's the issue
unsigned char cast to signed char. e.g. "\303\266" is a valid unicode
character, if everything goes right, it will be escaped to "%c3%b6".
However, in fact, it escaped to "%<garbage-byte>3%<garbage-byte>6".

_dbus_string_append_byte_as_hex() take an int parameter, so negative
byte is valid, but cause get a negative index in array. So garbage value
will get. e.g. '\303' --> hexdigits[((signed byte)(-61)) >> 4] is
hexdigits[-4].

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=53499
Sgne-off-by: Chengwei Yang <chengwei.yang@intel.com>
[fixed whitespace -smcv]
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agotests to embedded tests: replaced in cmake files
Chengwei Yang [Fri, 28 Jun 2013 08:23:03 +0000 (16:23 +0800)]
tests to embedded tests: replaced in cmake files

Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66291

10 years agotests to embedded tests: replaced in automake files
Chengwei Yang [Fri, 28 Jun 2013 08:06:41 +0000 (16:06 +0800)]
tests to embedded tests: replaced in automake files

Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66291

10 years agotests to embedded tests: replaced in libdbus
Chengwei Yang [Fri, 28 Jun 2013 08:25:54 +0000 (16:25 +0800)]
tests to embedded tests: replaced in libdbus

Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66291

10 years agotests to embedded tests: replaced in tools
Chengwei Yang [Fri, 28 Jun 2013 08:26:27 +0000 (16:26 +0800)]
tests to embedded tests: replaced in tools

Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66291

10 years agotests to embedded tests: replaced in dbus-daemon
Chengwei Yang [Fri, 28 Jun 2013 08:24:37 +0000 (16:24 +0800)]
tests to embedded tests: replaced in dbus-daemon

Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66291

10 years agoDBusString: fix a typo
Chengwei Yang [Fri, 28 Jun 2013 06:40:42 +0000 (14:40 +0800)]
DBusString: fix a typo

Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
[separated out of a larger patch -smcv]
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66300

10 years agoNEWS for 33001
Simon McVittie [Fri, 28 Jun 2013 11:03:05 +0000 (12:03 +0100)]
NEWS for 33001

10 years agocmake: align dir watch backend detection with autotools
Chengwei Yang [Fri, 28 Jun 2013 02:48:15 +0000 (10:48 +0800)]
cmake: align dir watch backend detection with autotools

Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66257

10 years agocmake: terminate to generate makefiles due to fatal error
Chengwei Yang [Fri, 28 Jun 2013 02:27:08 +0000 (10:27 +0800)]
cmake: terminate to generate makefiles due to fatal error

FATAL isn't a valid key for message according to cmake document here.
http://www.cmake.org/cmake/help/v2.8.8/cmake.html#command%3amessage

Due to the real fatal error, FATAL_ERROR should be used to terminate
cmake from continue generating makefiles.

Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66257

10 years agocmake: get rid of useless commented out code
Chengwei Yang [Fri, 28 Jun 2013 02:23:12 +0000 (10:23 +0800)]
cmake: get rid of useless commented out code

Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66257