platform/upstream/dbus.git
10 years ago[daemon-fix] fixed getting uid and pid when transport is not kdbus
Radoslaw Pajak [Thu, 7 Nov 2013 10:24:39 +0000 (11:24 +0100)]
[daemon-fix] fixed getting uid and pid when transport is not kdbus

Fixed getting uid and pid when damoen is compiled with kdbus transport, but sockets are used as transport.

Change-Id: I038920b03a352c44639d09284baa07f336dfd216
Signed-off-by: Radoslaw Pajak <r.pajak@samsung.com>
10 years ago[lib-fix] handling org.freedesktop.DBus.Hello fixed
Radoslaw Pajak [Wed, 6 Nov 2013 09:43:02 +0000 (10:43 +0100)]
[lib-fix] handling org.freedesktop.DBus.Hello fixed

- handling org.freedesktop.DBus.Hello method fixed and optimized
- removed commented (unused and no longer needed) code from library

Change-Id: I087addcd12988926e33607d186729d224a4d56ce
Signed-off-by: Radoslaw Pajak <r.pajak@samsung.com>
10 years ago[daemon-dev] Kdbus broadcasts translation moved from library into daemon
Radoslaw Pajak [Wed, 6 Nov 2013 07:19:09 +0000 (08:19 +0100)]
[daemon-dev] Kdbus broadcasts translation moved from library into daemon

- Kdbus broadcasts about names and ids changes from now are translated into DBus signals by daemon, not by the library.
Only dbus-daemons get them, than he translates them into DBus signals and sends again.
- some clean-ups and identation corrections

Change-Id: I9de3b3998b895c5c2288aecf447535666eb0b701
Signed-off-by: Radoslaw Pajak <r.pajak@samsung.com>
10 years ago[daemon-fix][daemon-opt] Fixed owner id when setting kdbus policy
Radoslaw Pajak [Tue, 5 Nov 2013 12:18:23 +0000 (13:18 +0100)]
[daemon-fix][daemon-opt] Fixed owner id when setting kdbus policy

- Fixed owner id in kdbus policy set by daemon for well-known name - was euid of daemon, is euid of process
  that asked for the name
- some optimalization - removing unnecessary function and repeated getters
- some identations corrected

Change-Id: I5c2295ec3c383c9bc67762f8c644bd880cee8e73
Signed-off-by: Radoslaw Pajak <r.pajak@samsung.com>
10 years agofix bug in parameter passing to dbus-daemon in dbus-launch
Semun Lee [Tue, 5 Nov 2013 08:38:28 +0000 (17:38 +0900)]
fix bug in parameter passing to dbus-daemon in dbus-launch

Change-Id: I7d097c15f8dfb72f832c08813e4931dc6c2555cb

10 years agoUse geteuid() to get effective user if of the process
Semun Lee [Tue, 5 Nov 2013 08:23:04 +0000 (17:23 +0900)]
Use geteuid() to get effective user if of the process

10 years ago[daemon-fix][opt] Name acquiring fixed and clean-ups
Radoslaw Pajak [Mon, 4 Nov 2013 12:37:12 +0000 (13:37 +0100)]
[daemon-fix][opt] Name acquiring fixed and clean-ups

- Name acquiring refactored to fix checking 'own' policy
- org.freedesktop.DBus.GetNameOwner refactored for clean-up purposes

Change-Id: Ice177286d9ae24b75f82da1dbd212369cadebc28
Signed-off-by: Radoslaw Pajak <r.pajak@samsung.com>
10 years ago[doc][daemon-fix][daemon-opt] Known limitations updated, code fixes, clean-ups, optim...
Radoslaw Pajak [Mon, 4 Nov 2013 07:39:36 +0000 (08:39 +0100)]
[doc][daemon-fix][daemon-opt] Known limitations updated, code fixes, clean-ups, optimizations, formatting

- org.freedesktop.DBus.GetNameOwner fixed
- added policy checking when acquiring well-known name
- dbus_connection_get_unix_user rewritten for kdbus
- dbus_connection_get_unix_process_id rewritten for kdbus
- bus_service_get_primary_owners_connection extended with kdbus support
- (kdbus_get_connection_unix_) user and process_id refactored for more universal usage
- kdbus_list_services optimized

Change-Id: I90896df7bebafe05869778da1aef2a22a24722fe
Signed-off-by: Radoslaw Pajak <r.pajak@samsung.com>
10 years agoadd missing configuration files
Semun Lee [Thu, 31 Oct 2013 02:31:35 +0000 (11:31 +0900)]
add missing configuration files

10 years agoedit spec file for the rpm packaging
Semun Lee [Tue, 29 Oct 2013 10:35:39 +0000 (19:35 +0900)]
edit spec file for the rpm packaging

Change-Id: I8cc27cba98316e5f97c2d379a4a129650603e3d7

10 years agohow-to and autogen.sh fixed
Radoslaw Pajak [Mon, 28 Oct 2013 13:15:06 +0000 (14:15 +0100)]
how-to and autogen.sh fixed

Change-Id: I5da77fd129a1a683d9284d61c4d097ecfdde52a2
Signed-off-by: Radoslaw Pajak <r.pajak@samsung.com>
10 years ago[doc] Separated status, known limitations
Jacek Janczyk [Mon, 28 Oct 2013 12:50:53 +0000 (13:50 +0100)]
[doc] Separated status, known limitations

* Development status moved from architecture to separate file for
  easier maintenance
* "Known limitations" section added in architecture description

Change-Id: I9ed323a392c865d4e9c1fad3cf8ac96b426b7f88

10 years agoMerge "[daemon-fix][dev] address to start kdbus bus changed to 'kdbus:', kdbus added...
Jacek Janczyk [Mon, 28 Oct 2013 11:15:30 +0000 (20:15 +0900)]
Merge "[daemon-fix][dev] address to start kdbus bus changed to 'kdbus:', kdbus added to dbus-launch and autolaunch"

10 years ago[doc] Initial docs for kdbus transport
Jacek Janczyk [Mon, 28 Oct 2013 10:17:35 +0000 (11:17 +0100)]
[doc] Initial docs for kdbus transport

* Brief architecture description
* mini HOWTO run the code with kdbus

Change-Id: Icb7c9da648f1d4aeea26d3a1402136cca2dd05c0

10 years ago[daemon-fix][dev] address to start kdbus bus changed to 'kdbus:', kdbus added to...
Radoslaw Pajak [Mon, 28 Oct 2013 09:03:38 +0000 (10:03 +0100)]
[daemon-fix][dev] address to start kdbus bus changed to 'kdbus:', kdbus added to dbus-launch and autolaunch

- address to start kdbus bus changed from 'kdbus' to 'kdbus:'
- added kdbus bus creation option "--kdbus" to dbus-launch tool
- added kdbus bus creation option to autolauch by adding scope=kdbus
 ("autolaunch:scope=kdbus" compiled as default when --enabel-kdbus-transport is given)
- "Building kdbus support: yes/no" info  added to configure

Change-Id: I681d319733d067e7fc9d002ad370984ba469a342
Signed-off-by: Radoslaw Pajak <r.pajak@samsung.com>
10 years agoComments added and corrected
Radoslaw Pajak [Fri, 25 Oct 2013 12:54:05 +0000 (14:54 +0200)]
Comments added and corrected

Change-Id: I33da8fd0535f5735d25597d71501288552911d63
Signed-off-by: Radoslaw Pajak <r.pajak@samsung.com>
10 years ago[daemon-dev][lib-opt] Fix in freeing memory, cleanup, comments, renames
Radoslaw Pajak [Fri, 25 Oct 2013 09:57:34 +0000 (11:57 +0200)]
[daemon-dev][lib-opt] Fix in freeing memory, cleanup, comments, renames

- fixed transaction freeing
- removed unused functions from daemon code
- comments fixed in library
- renames in library to improve code readability

Change-Id: Ied2609be7ebd646100d5d544885545b78d8dc348
Signed-off-by: Radoslaw Pajak <r.pajak@samsung.com>
10 years agoMerge "Optional autogen.sh flag --enable-kdbus-transport added allowing to compile...
Jacek Janczyk [Fri, 25 Oct 2013 11:22:01 +0000 (20:22 +0900)]
Merge "Optional autogen.sh flag --enable-kdbus-transport added allowing to compile with or without kdbus transport. - Required #ifdef ENABLE_KDBUS_TRANSPORT added to code - Makefile.am and configure.ac modified"

10 years agoSimple optimization on the buffer allocation
Semun Lee [Mon, 21 Oct 2013 12:10:54 +0000 (21:10 +0900)]
Simple optimization on the buffer allocation

Change-Id: Idea8d97865033637650bd01117a9ae53e9f592b4

10 years agoOptional autogen.sh flag --enable-kdbus-transport added allowing to compile with...
Lukasz Stempien [Thu, 24 Oct 2013 09:37:54 +0000 (11:37 +0200)]
Optional autogen.sh flag --enable-kdbus-transport added allowing to compile with or without kdbus transport.
- Required #ifdef ENABLE_KDBUS_TRANSPORT added to code
- Makefile.am and configure.ac modified

Change-Id: Ief9c7036c68e1d4ee9ff090d8a67be979a4b6262
Signed-off-by: Lukasz Stempien <l.stempien@samsung.com>
10 years agoaddress for daemon changed to "kdbus:", licencses and copyrights added
Radoslaw Pajak [Wed, 23 Oct 2013 13:53:01 +0000 (15:53 +0200)]
address for daemon changed to "kdbus:", licencses and copyrights added

Change-Id: I9877a81b59f5c90d5510ae3cfa218e7ac414e9cf
Signed-off-by: Radoslaw Pajak <r.pajak@samsung.com>
10 years ago[daemon-fix] Fixed daemon creation, services activation and little more
Radoslaw Pajak [Tue, 22 Oct 2013 13:53:00 +0000 (15:53 +0200)]
[daemon-fix] Fixed daemon creation, services activation and little more

- fixed registering org.freedesktop.DBus name by daemon
- fixed auto activating services and activation messages delivering
- from now starters are not listed by ListQueuedOwners method
- fixed error handling during daemon creation process
- fixed updating kdbus starters

Change-Id: Ide8384b7e2c9b5feb56f1b11f9738f536b9d7338
Signed-off-by: Radoslaw Pajak <r.pajak@samsung.com>
10 years ago[daemon-dev][lib-opt] Bus making in daemon distinguishes bus type, lib optimalization
Radoslaw Pajak [Fri, 18 Oct 2013 09:42:21 +0000 (11:42 +0200)]
[daemon-dev][lib-opt] Bus making in daemon distinguishes bus type, lib optimalization

- daemon now distinguish type of the bus when he creates it
- library (transport) optimalization

Change-Id: I55fa7a1c283a16e8b97cb747bf557a8358de9927
Signed-off-by: Radoslaw Pajak <r.pajak@samsung.com>
10 years ago[daemon-dev] Update kdbus starters for dbus activatable service names functionality...
Lukasz Stempien [Wed, 16 Oct 2013 11:29:33 +0000 (13:29 +0200)]
[daemon-dev] Update kdbus starters for dbus activatable service names functionality added.

Change-Id: If3225a6795467392cedeac3a791871f1c984a836
Signed-off-by: Lukasz Stempien <l.stempien@samsung.com>
10 years ago[daemon-fix] Registering starters: unwanted release_kdbus_name when no error was...
Lukasz Stempien [Tue, 15 Oct 2013 09:52:19 +0000 (11:52 +0200)]
[daemon-fix] Registering starters: unwanted release_kdbus_name when no error was found fixed.

Change-Id: I87bd16de5cde1f19c0e5ed739cdb15ed5ca6c6bc
Signed-off-by: Lukasz Stempien <l.stempien@samsung.com>
10 years ago[daemon-dev][daemon-fix] Registering starters extended and error set in make_kdbus_bus
Radoslaw Pajak [Mon, 14 Oct 2013 09:13:14 +0000 (11:13 +0200)]
[daemon-dev][daemon-fix] Registering starters extended and error set in make_kdbus_bus

- registering activatable services as starters fixed and extended to allow easy updating them
- fixed errors previously not set in make_kdbus_bus when returning NULL

Change-Id: I4471d574dc7ebf2ed4a912129e21eddc8711a688
Signed-off-by: Radoslaw Pajak <r.pajak@samsung.com>
10 years ago[daemon-fix] Unique session bus names for kdbus
Jacek Janczyk [Fri, 11 Oct 2013 06:53:07 +0000 (15:53 +0900)]
[daemon-fix] Unique session bus names for kdbus

Daemon pid is appended to session bus name (for kdbus) to allow
to run several sessions in parallel

Signed-off-by: Jacek Janczyk <j.janczyk@samsung.com>
10 years ago[daemon-fix] Session and system bus differentiate
Michal Eljasiewicz [Fri, 11 Oct 2013 04:39:13 +0000 (13:39 +0900)]
[daemon-fix] Session and system bus differentiate

Change-Id: I2b03b9e682178dae938c039428ba4c60155c6d73

10 years ago[daemon-fix] fixed daemon crashing when some clients disconnects
Radoslaw Pajak [Tue, 8 Oct 2013 11:02:00 +0000 (13:02 +0200)]
[daemon-fix] fixed daemon crashing when some clients disconnects

Change-Id: Ie1ee6f6c4efba33d6640ab4c343cdf8e3399ea33
Signed-off-by: Radoslaw Pajak <r.pajak@samsung.com>
10 years ago[daemon-fix] Fixes for creating and removing phantom connections and sending NameLost...
Radoslaw Pajak [Tue, 8 Oct 2013 07:07:46 +0000 (09:07 +0200)]
[daemon-fix] Fixes for creating and removing phantom connections and sending NameLost signal

- Now phantom connection is created once for unique name, not for each well-known name,
- Fixed sending NameLost signal to disconected client

Change-Id: I33f856c56a8fbb8c865b023aa1e773ffd1f3343e
Signed-off-by: Radoslaw Pajak <r.pajak@samsung.com>
10 years ago[daemon-dev][daemon-fix][lib-dev] Added sending NameLost and NameAcquired messages...
Radoslaw Pajak [Fri, 4 Oct 2013 14:52:51 +0000 (16:52 +0200)]
[daemon-dev][daemon-fix][lib-dev] Added sending NameLost and NameAcquired messages and fixes

- added sending NameLost and NameAcquired signals/messages
- added removing phantom connections when owner has disconnected
- added possibility to match against Id Added and Id removed kdbus signals
- ReleaseName  method fixed and cleaned
- fixed phantom connection disconnecting (cleaning)
- some comments enhanced
- removed unnecessary comments and debugs

Change-Id: I2e1d7bde924c9312f77f8d3ef76a4be9287feadd
Signed-off-by: Radoslaw Pajak <r.pajak@samsung.com>
10 years ago[daemon-dev][daemon-fix] starting services by direct message (autostart) and some...
Radoslaw Pajak [Wed, 2 Oct 2013 12:38:17 +0000 (14:38 +0200)]
[daemon-dev][daemon-fix] starting services by direct message (autostart) and some fixes

- added auto starting services (by directly addressed message) - daemon starts the service and then pass a pending message to it
this needs appropiriate kdbus changes - KDBUS_NAME_STARTER must be handled by kdbus (since 02.10.2013)
- fixes for name aquiring and releasing

Change-Id: Ied7746233132a9ab3bd3377fb563c85558486650
Signed-off-by: Radoslaw Pajak <r.pajak@samsung.com>
10 years agodaemon fix: bus_context_new function failure behavior fixed:
Lukasz Stempien [Wed, 2 Oct 2013 11:35:25 +0000 (13:35 +0200)]
daemon fix: bus_context_new function failure behavior fixed:

- dbus_daemon_as_client: connection type changed to private
- dbus_server_init_mini: vtable, refcount, watches, timeouts init added.

Change-Id: Iaeb7476888f5f5774d0d4943cf39bb8368513035
Signed-off-by: Lukasz Stempien <l.stempien@samsung.com>
10 years ago[daemon-fix][daemon-dev] Fixed crashing when name is primary owned again
Radoslaw Pajak [Fri, 27 Sep 2013 12:54:05 +0000 (14:54 +0200)]
[daemon-fix][daemon-dev] Fixed crashing when name is primary owned again

 - Fixed daemon crashing when the name is primary_owned after being completely released.
 - Begin of development of starting services by direct message.

Change-Id: Ib4968e10ad5effdf4ca56da5fd85ca95c5325cf7
Signed-off-by: Radoslaw Pajak <r.pajak@samsung.com>
10 years ago[daemon-dev][lib-fix][lib-dev] ListQueuedOwners method in daemon, fixed strcpy issue...
Radoslaw Pajak [Fri, 27 Sep 2013 09:16:33 +0000 (11:16 +0200)]
[daemon-dev][lib-fix][lib-dev] ListQueuedOwners method in daemon, fixed strcpy issue, added kdbus priority on opening transpot

- ListQueuedOwners method handling added to daemon
- GetAdtAuditSessionData method now passed to daemon, but still can not return anything interesting for
  kdbus transport (neither it does for std socket and std authentication method)
- fixed issue with strcpy causing buffer overflow on foxp - strcpy replaced with memcpy
- set kdbus precendence when opening transport, thus with kdbus and unix transport both present in
  DBUS_SESSION_BUS_ADDRESS, modified library will try to use kdbus first

Change-Id: If481bbd446bf64bc40b767ccdec177cce5f1e719

10 years agodaemon fix and development
Radoslaw Pajak [Thu, 19 Sep 2013 06:43:55 +0000 (08:43 +0200)]
daemon fix and development

 - 2 fixes in original dbus daemon - iterations when error in bus_activation_list_services and
bus_registry_list_services
 - daemon on kdbus development, status:

Hello method must be implemented in library (not posssible to be done by daemon)

NOT WORKING org.freedesktop.DBus methods:
- ListQueuedOwners - corresponding functionality not present in kdbus
- GetAuditSessionData - to be investigated
- StartServiceByName - work in progress

WORKING org.freedesktop.DBus methods:
- RequestName
- ReleaseName
- UpdateActivationEnvironment
- NameHasOwner
- ListNames
- ListActivatableNames
- AddMatch
- RemoveMatch
- GetNameOwner
- GetConnectionUnixUser
- GetConnectionUnixProcessID
- GetConnectionSELinuxSecurityContext
- ReloadConfig
- GetId
- GetConnectionCredentials

Change-Id: Ife35a51f7bc934fda12a647011d9eeeaf6285f70

10 years ago[daemon-dev][lib-fix] ListNames in libdbus fix, daemon development
Radoslaw Pajak [Tue, 10 Sep 2013 10:41:25 +0000 (12:41 +0200)]
[daemon-dev][lib-fix] ListNames in libdbus fix, daemon development

 - ListNames method of org.freedesktop.DBus fixed in libdbus
 - daemon on kdbus development: connects to bus and listens, and receives messages and broadcasts

Change-Id: I4648a6ce06a1b2678b7b56f1bdefb4e014c45bb5

10 years ago[lib-fix] libdbus refactored to eliminate "is kdbus" queries and branches in non...
Radoslaw Pajak [Mon, 9 Sep 2013 12:42:59 +0000 (14:42 +0200)]
[lib-fix] libdbus refactored to eliminate "is kdbus" queries and branches in non-kdbus files

 - mentioned above
 - methods of org.freedesktop.DBus will be handled also if sent by hand not by dedicated lib functions

Change-Id: Ied3b11b1082d993898ff5bf47c2c4e9dbca97fae

10 years ago[lib-opt] optimization of kdbus add-on to libdbus
Radoslaw Pajak [Fri, 6 Sep 2013 08:22:02 +0000 (10:22 +0200)]
[lib-opt] optimization of kdbus add-on to libdbus

Change-Id: I0f79fe0f1514e7ddbc7354a3e35b641257c15723

10 years ago[daemon-dev][lib-fix] Daemon with kdbus early development
Radoslaw Pajak [Fri, 6 Sep 2013 06:59:16 +0000 (08:59 +0200)]
[daemon-dev][lib-fix] Daemon with kdbus early development

 - dbus-daemon with kdbus development continues
 - fix in library for sending messages locally generated during kdbus reading/decoding

Change-Id: I8a13b1b820d44be69f4a03228a8a2c97493e7c6d

10 years ago[daemon-dev] Start of daemon with kdbus
Lukasz Stempien [Thu, 5 Sep 2013 13:23:23 +0000 (15:23 +0200)]
[daemon-dev] Start of daemon with kdbus

- make_kdbus_bus function implementation added
- KDBUS_PART_HEADER_SIZE definition moved from dbus-transport-kdbus.c to kdbus.h

Change-Id: I49644cf38affad7b74e60338f9e2e807612fd451

10 years agoOptimization: message sender created once at bus_register
Michal Eljasiewicz [Thu, 5 Sep 2013 11:53:33 +0000 (13:53 +0200)]
Optimization: message sender created once at bus_register

Change-Id: Iaeaaff2707db69154df9a0377642ca73eb3f4cba

10 years agoOptimization: transport_is_kdbus parses address once
Michal Eljasiewicz [Thu, 5 Sep 2013 10:50:46 +0000 (12:50 +0200)]
Optimization: transport_is_kdbus parses address once

Change-Id: Ic9a1afbd2ee2da175b2e100543af2fcfef0db126

10 years ago[daemon-dev][lib-fix] Start of daemon with kdbus and fix in match rules in libdbus
Radoslaw Pajak [Thu, 5 Sep 2013 06:58:13 +0000 (08:58 +0200)]
[daemon-dev][lib-fix] Start of daemon with kdbus and fix in match rules in libdbus

 - start of dbus-daemon supporting kdbus (bus making and services starting)
 - fix in match rules translating into kdbus in libdbus

Change-Id: I4e60472af75b3f6735a4ea498ce1b65604c6a161

10 years agoMerge remote-tracking branch 'freedesktop/master'
Jacek Janczyk [Wed, 4 Sep 2013 09:29:31 +0000 (11:29 +0200)]
Merge remote-tracking branch 'freedesktop/master'

Conflicts:
dbus/dbus-connection.c
dbus/dbus-transport.c

Change-Id: Ifb1872f1317bb1fa656d7088c1985ff778b76eba

10 years agoAdding spec file for gbs build.
Lukasz Stempien [Wed, 4 Sep 2013 09:08:19 +0000 (11:08 +0200)]
Adding spec file for gbs build.

Change-Id: I3e0cdbf3095973c7419a448138b67407aa93e167

10 years agoTests: allow dbus-glib to be replaced with use of libdbus-internal
Simon McVittie [Mon, 2 Sep 2013 15:32:31 +0000 (16:32 +0100)]
Tests: allow dbus-glib to be replaced with use of libdbus-internal

We only use dbus-glib for its main loop; within dbus, DBusLoop is
available as an alternative, although it isn't thread-safe and
isn't public API.

For tests that otherwise only use libdbus public API, it's desirable to
be able to avoid DBusLoop, so we can run them against an installed
libdbus as an integration test. However, if we don't have dbus-glib,
we're going to have to use an in-tree main loop, which might as well
be DBusLoop.

The major disadvantage of using dbus-glib is that it isn't safe to
link both dbus-1 and dbus-internal at the same time. This is awkward
for a future test case that wants to use _dbus_getsid() in dbus-daemon.c,
but only on Windows (fd.o #54445). If we use the same API wrapper around
both dbus-glib and DBusLoop, we can compile that test against dbus-glib
or against DBusLoop, depending on the platform.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68852
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
10 years agoDefine DBUS_COMPILATION externally for all tests that use internal stuff
Simon McVittie [Fri, 30 Aug 2013 16:45:52 +0000 (17:45 +0100)]
Define DBUS_COMPILATION externally for all tests that use internal stuff

It might as well go in the AM_CPPFLAGS rather than in the source code.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68852
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
10 years agocorrupt test: close connection before releasing GSocket
Simon McVittie [Mon, 2 Sep 2013 16:14:38 +0000 (17:14 +0100)]
corrupt test: close connection before releasing GSocket

GSocket takes responsibility for closing the fd, and there doesn't
seem to be any way to tell it not to. When this test is adapted to run
under DBusLoop as an alternative to dbus-glib, that becomes a problem,
because DBusLoop/DBusSocketSetEpoll do not tolerate that. Work around it.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68852
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
10 years ago_dbus_become_daemon: don't pretend it worked
Simon McVittie [Thu, 29 Aug 2013 10:51:45 +0000 (11:51 +0100)]
_dbus_become_daemon: don't pretend it worked

This function is meaningless (and possibly unimplementable) on Windows.
We shouldn't call it; if we do, it should raise an error.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68852
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
10 years agoAllow dbus-daemon --nofork on Windows
Simon McVittie [Thu, 29 Aug 2013 10:49:00 +0000 (11:49 +0100)]
Allow dbus-daemon --nofork on Windows

On Windows, the dbus-daemon is not able to fork (daemonize). If someone
explicitly requests forking, it should fail, but if someone
explicitly requests *not* forking, there seems no harm in allowing it.

A few of the regression tests specifically require a dbus-daemon that
will not fork, so allowing this option on Windows means those tests
don't need an extra OS condition.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68852
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
10 years agoFix declaration of _dbus_win_startup_winsock
Simon McVittie [Mon, 2 Sep 2013 16:31:56 +0000 (17:31 +0100)]
Fix declaration of _dbus_win_startup_winsock

This regressed in commit b7a91bfd.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68610
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
10 years agoFix: added missing line after cleanup
Michal Eljasiewicz [Tue, 3 Sep 2013 09:41:00 +0000 (11:41 +0200)]
Fix: added missing line after cleanup

Change-Id: Id062ee61ba0a0ae3ba3fa02425fdc793da7afa0f

10 years agoCleanup: repeating code replaced with macro
Michal Eljasiewicz [Tue, 3 Sep 2013 08:20:07 +0000 (10:20 +0200)]
Cleanup: repeating code replaced with macro

Change-Id: Ic64367577c886333ecb70b606e29e169d1ec1118

10 years agoSmall fixes for dbus-kdbus translations
Radoslaw Pajak [Mon, 2 Sep 2013 06:37:52 +0000 (08:37 +0200)]
Small fixes for dbus-kdbus translations
 - autostart flag from dbus message translated to kdbus
 - errno EADDRNOTAVAIL handled when sending message
 - fixed KDBUS_MSG_REPLY_DEAD translation to dbus error

Change-Id: Ia4a31adc1cb3a956efc515a94114dad3d7ba1026

10 years agoFix unused function when SELinux is not enabled
Simon McVittie [Fri, 30 Aug 2013 15:23:22 +0000 (16:23 +0100)]
Fix unused function when SELinux is not enabled

It must be one of the "only smcv tests this" configurations...

10 years agoMove some sysdeps stuff only used by the dbus-daemon outside libdbus
Simon McVittie [Thu, 29 Aug 2013 12:16:14 +0000 (13:16 +0100)]
Move some sysdeps stuff only used by the dbus-daemon outside libdbus

This means we don't need to worry about whether it's thread-safe,
and makes libdbus a little smaller.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68610
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
10 years ago_dbus_check_setuid: comment on thread-safety
Simon McVittie [Thu, 29 Aug 2013 11:51:26 +0000 (12:51 +0100)]
_dbus_check_setuid: comment on thread-safety

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68610
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
10 years ago_dbus_win_startup_winsock: be thread-safe
Simon McVittie [Thu, 29 Aug 2013 11:51:14 +0000 (12:51 +0100)]
_dbus_win_startup_winsock: be thread-safe

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68610
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
10 years agoComment some suspicious uses of static variables
Simon McVittie [Thu, 29 Aug 2013 11:50:39 +0000 (12:50 +0100)]
Comment some suspicious uses of static variables

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68610
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
10 years ago_dbus_get_autolaunch_address: don't make argv static
Simon McVittie [Thu, 29 Aug 2013 11:50:16 +0000 (12:50 +0100)]
_dbus_get_autolaunch_address: don't make argv static

This function could be accessed from any thread, which would mean it
scribbles on argv twice.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68610
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
10 years ago_dbus_file_path_extract_elements_from_tail: don't misuse static variable
Simon McVittie [Thu, 29 Aug 2013 11:49:35 +0000 (12:49 +0100)]
_dbus_file_path_extract_elements_from_tail: don't misuse static variable

If we _dbus_verbose() from more than one thread at the same time,
we don't want to get into trouble with static variables (and I don't
think micro-optimizing this function is really worth it anyway).

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68610
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
10 years agoRevert "Add a statically-initialized implementation of _dbus_lock() on glibc systems"
Simon McVittie [Fri, 30 Aug 2013 16:24:20 +0000 (17:24 +0100)]
Revert "Add a statically-initialized implementation of _dbus_lock() on glibc systems"

This reverts commit 83aaa9f359e90d3b8cae5d17f6d9ba4600cff68b.

This wasn't right: because it looked for a symbol from pthread.h,
modules could end up disagreeing about whether threading was enabled or
not.

10 years ago_dbus_get_tmpdir: be thread-safe
Simon McVittie [Tue, 27 Aug 2013 13:35:47 +0000 (14:35 +0100)]
_dbus_get_tmpdir: be thread-safe

Sharing a static variable between threads is not safe in general,
and this function is used in the shared libdbus (for nonce files),
so it can't rely on being single-threaded.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68610
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
10 years agolibdbus-1.la: have proper dependencies on Windows
Simon McVittie [Tue, 27 Aug 2013 12:53:42 +0000 (13:53 +0100)]
libdbus-1.la: have proper dependencies on Windows

Assigning to libdbus_1_la_DEPENDENCIES defeats Automake's normal
dependency logic, which makes libdbus-1.la depend on all the
static libraries that will go into it (it still had a corrct dependency
on the other objects, which go through a separate variable).
This meant libdbus-init-win wasn't necessarily built first.

Use EXTRA_libdbus_1_la_DEPENDENCIES to avoid that problem.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68505
Acked-by: Ralf Habacker <ralf.habacker@freenet.de>
10 years agoGenerate autotools provided PACKAGE_.. and VERSION defines by a cmake macro.
Ralf Habacker [Wed, 28 Aug 2013 12:16:21 +0000 (14:16 +0200)]
Generate autotools provided PACKAGE_.. and VERSION defines by a cmake macro.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=67072
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoFixed mingw gcc 4.8.1 complains about double defined macros.
Ralf Habacker [Sat, 29 Jun 2013 10:45:22 +0000 (12:45 +0200)]
Fixed mingw gcc 4.8.1 complains about double defined macros.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=67072
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agoFixed gcc 4.8.1 -Wformat warnings on windows.
Ralf Habacker [Tue, 27 Aug 2013 15:32:56 +0000 (17:32 +0200)]
Fixed gcc 4.8.1 -Wformat warnings on windows.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=67072
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10 years agodbus daemon emulation exteneded
Radoslaw Pajak [Mon, 26 Aug 2013 12:40:55 +0000 (14:40 +0200)]
dbus daemon emulation exteneded

 - added handling of dbus daemon method GetConnectionSELinuxSecurityContext
 - added error reply for not supported method GetAdtAuditSessionData

Change-Id: I5efeb6d1fe15c6ff86e56a8393a3ff8caa101a6e

10 years agoAdded latency pingpong dbus test and script
Michal Eljasiewicz [Mon, 26 Aug 2013 08:21:27 +0000 (10:21 +0200)]
Added latency pingpong dbus test and script

Script for automatic Foxp testing adapted for latency tests.

Change-Id: Icee320ec1a6d40e88ad3de335eee5a65803bd6eb

10 years agoMemfd memory leak fix
Michal Eljasiewicz [Fri, 23 Aug 2013 13:54:24 +0000 (15:54 +0200)]
Memfd memory leak fix

memfd file descriptors were not closed, thats why memory was not free'd

Change-Id: I553e91d8caf8ba5a21578f88aa8d21a644c7e505

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>