platform/upstream/dbus.git
5 years agoRevert "tizen: Add additional unit for "unified" user session" 19/212319/2 accepted/tizen_5.5_unified_mobile_hotfix tizen_5.5_mobile_hotfix tizen_5.5_tv accepted/tizen/5.5/unified/20191031.005930 accepted/tizen/5.5/unified/mobile/hotfix/20201027.063100 accepted/tizen/unified/20190822.045457 submit/tizen/20190820.090809 submit/tizen_5.5/20191031.000006 submit/tizen_5.5_mobile_hotfix/20201026.185106 tizen_5.5.m2_release
Yunmi Ha [Tue, 20 Aug 2019 08:09:07 +0000 (08:09 +0000)]
Revert "tizen: Add additional unit for "unified" user session"

This reverts commit 662187a7597aaf9c9ad2a635944951e6174a36da.

We've optimized systemd-user without unified system/session.
So, we revert the patch for unified system/session.

Change-Id: I70ee37ebeda65e549c5f544d37d511cb6d54b757

5 years agopolicy: modify complaint log to print out matched rule 91/211091/1 accepted/tizen/unified/20190816.112439 submit/tizen/20190812.022819
sanghyeok.oh [Tue, 30 Jul 2019 03:01:33 +0000 (12:01 +0900)]
policy: modify complaint log to print out matched rule

Reconstruct rule with xml format.

Change-Id: I760f5c89f519672743a10fa15b66ac14b7e819a1
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
5 years agopolicy: change complaint log format of bus_client_policy_check_can_own() to print... 11/210611/1
sanghyeok.oh [Tue, 23 Jul 2019 02:43:40 +0000 (11:43 +0900)]
policy: change complaint log format of bus_client_policy_check_can_own() to print out connection log

Change-Id: Ib0fc3be8b07577da687a024f5c39178dad387644
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
5 years agokdbus: fix computing bloom filters 65/210465/1 accepted/tizen/unified/20190722.074825 submit/tizen/20190719.104741
Adrian Szyndela [Fri, 19 Jul 2019 08:23:27 +0000 (10:23 +0200)]
kdbus: fix computing bloom filters

The bloom filters computing had been implemented in the past, basing
on systemd. However, the reimplementation introduced two bugs:
- no clearing of 'p' variable;
- clearing of hash_index variable in a wrong place.

This fixes the bugs.

The same applies to glib.

Change-Id: Ie7c602c6bc881e38c62f41d482ab3785b03c5503

5 years agoRevert "Fix for smack error when dbus-daemon(session) accesses proc/cmdline" 37/210237/2 accepted/tizen/unified/20190717.220434 submit/tizen/20190717.061730
Hyotaek Shim [Wed, 17 Jul 2019 06:11:50 +0000 (06:11 +0000)]
Revert "Fix for smack error when dbus-daemon(session) accesses proc/cmdline"

This reverts commit c7fbfc743059b3e9988a359106ad459511b5ea78.

Change-Id: I86742a428f372ff6988a13df12694c550e2a53c2

5 years agogvariant: fix UBSan related code 24/208924/1 accepted/tizen/unified/20190702.114943 submit/tizen/20190701.095512
sanghyeok.oh [Mon, 1 Jul 2019 08:42:36 +0000 (17:42 +0900)]
gvariant: fix UBSan related code

fix Undefined Behavior Sanitizer error.

Change-Id: If3b68e68d4de753d0e66c0eeb07f626431057cbf
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
5 years agopolicy: add complaint log for bus_client_policy_check_can_own() 34/208234/3
sanghyeok.oh [Thu, 20 Jun 2019 07:11:01 +0000 (16:11 +0900)]
policy: add complaint log for bus_client_policy_check_can_own()

Change-Id: I4e67ff2258b11bab764f51cfe7e2ae01f2a11d49
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
5 years agoMerge "Remove unused DbusError to avoid memory leak." into tizen accepted/tizen/unified/20190624.115337 submit/tizen/20190624.005319
sanghyeok oh [Mon, 24 Jun 2019 00:52:11 +0000 (00:52 +0000)]
Merge "Remove unused DbusError to avoid memory leak." into tizen

5 years agoremove unused DBusError in kdbus_read_message() 89/207789/2
Himanshu Maithani [Tue, 28 May 2019 08:48:27 +0000 (14:18 +0530)]
remove unused DBusError in kdbus_read_message()

The function defines and initializes  local DBusError.
It is not used in kdbus_decode_msg() and function relies on assert for error.
So, remove the DBusError variable in kdbus_decode_msg().

Change-Id: Ic726f2a161f06766b081f1a98e83ff4f3834f75b
Signed-off-by: Himanshu Maithani <himanshu.m@samsung.com>
Signed-off-by: Gaurav Gupta <g.gupta@samsung.com>
5 years agoRemove unused DbusError to avoid memory leak. 80/207880/1
Gaurav Gupta [Thu, 13 Jun 2019 10:57:07 +0000 (16:27 +0530)]
Remove unused DbusError to avoid memory leak.

Pass NULL as error argument to avoid setting error string in dbus_validate_bus_name(), thus avoid possible memory leak.
We expect the name to be valid bus name (utf8) as it is fetched from the connection.
It will also optimize stack usage as "local_error" variable & dbus_error_init() function are called in for loop.

Other fix could be to check free "error" if it is set.
Signed-off-by: Gaurav Gupta <g.gupta@samsung.com>
Reviewed-by: Himanshu Maithani <himanshu.m@samsung.com>
Change-Id: I773211edd76b6591369bbaae5464971894481a28

5 years agofix: missing dbus_error_free in kdbus_write_msg_internal 88/207788/1 submit/tizen/20190624.001018
himanshu.m@samsung.com [Tue, 28 May 2019 06:31:55 +0000 (12:01 +0530)]
fix: missing dbus_error_free in kdbus_write_msg_internal

free message/name from the error in kdbus_write_msg_internal

Change-Id: I7f03abc0fc3f7c81e3725b3325f9e15209906e35
Signed-off-by: Himanshu Maithani <himanshu.m@samsung.com>
Signed-off-by: Gaurav Gupta <g.gupta@samsung.com>
5 years agoapply default deny own policy 94/206094/1 accepted/tizen/unified/20190602.221846 submit/tizen/20190530.011453
sanghyeok.oh [Tue, 14 May 2019 07:38:22 +0000 (16:38 +0900)]
apply default deny own policy

Change default own policy from allow to deny.

Change-Id: Ifde07a31ea3e6b8c97a6b7aee093ff9bf67c301c
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
5 years agocoverity fix 13/205813/6
sanghyeok.oh [Thu, 9 May 2019 08:57:53 +0000 (17:57 +0900)]
coverity fix

Change-Id: Iac35795aaa9a0640c83b59ddb6fb5dc18435746f
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
5 years agotizen: Add additional unit for "unified" user session 32/204132/4 accepted/tizen/unified/20190510.111111 submit/tizen/20190509.015828
Mateusz Moscicki [Fri, 19 Apr 2019 10:53:02 +0000 (12:53 +0200)]
tizen: Add additional unit for "unified" user session

The unified user session is about moving user session units, managed by
systemd --user, to main systemd, where it's managed as part of newly
created user@.target.

user@.target will contain same units as previously available in user/,
with same UID and environment setup.  systemd instance is used for unit
to be able to specify UID (inherited from user@.target).

The rationale behind this work is following:

* VD requirement to remove user session support
* boot time optimization requirements, due to:

   + 'systemd --user' taking 1s its own startup that could be used for
     unit startup
   + ability to better rearrange units if these managed by one systemd
     instance

Unit installed by this commit will not be used till user login mechanism
will be changed in systemd package (via changing pam_systemd to start
user@.target, rather than user@.service).

Change-Id: I524768f116ca91d812ae0884adbb300e52817975

5 years agoRemove DefaultDependencies=no from dbus.socket 32/205132/1 accepted/tizen/unified/20190503.075041 submit/tizen/20190502.044443
INSUN PYO [Mon, 29 Apr 2019 09:59:33 +0000 (18:59 +0900)]
Remove DefaultDependencies=no from dbus.socket

Change-Id: I1f1b72c237451aa04da92195c696a0387cad9e18

5 years agodbus-daemon: Don't create /tmp/dbus_launch 52/204852/2 accepted/tizen/unified/20190430.113428 submit/tizen/20190429.043102
INSUN PYO [Mon, 29 Apr 2019 00:33:16 +0000 (09:33 +0900)]
dbus-daemon: Don't create /tmp/dbus_launch

VD only uses /tmp/dbus_launch
- VD target: use /tmp/dbus_launch generated by systemd in kdbus
- VD emulator: use /tmp/dbus_launch generated by dbus-daemon that uses VD plugin drop-in

Change-Id: If2120a016015ee76c589416dab7cc6c96ee21b05

5 years agoAdd dependency to security-manager.socket 51/204351/2 accepted/tizen/unified/20190429.103648 submit/tizen/20190426.023004
INSUN PYO [Tue, 23 Apr 2019 08:07:39 +0000 (17:07 +0900)]
Add dependency to security-manager.socket

dbus-daemon connect to security-manager.service to get getgrouplist.

(gdb) bt
0  security_manager_groups_get_for_user (uid=0, groups=groups@entry=0xfffef754, groups_count=groups_count@entry=0xfffef758) at /usr/src/debug/security-manager-1.5.3/src/client/client-security-manager.cpp:1391
1  0xf71faa14 in _nss_securitymanager_initgroups_dyn (user=0x443f70 "root", group_gid=<optimized out>, start=0xfffef7cc, size=0xfffef800, groupsp=0xfffef804, limit=-1, errnop=0xf77ea11c)
    at /usr/src/debug/security-manager-1.5.3/src/nss/nss_securitymanager.cpp:109
2  0xf759f204 in internal_getgrouplist (user=0x1 <error: Cannot access memory at address 0x1>, user@entry=0x443f70 "root", group=124, group@entry=0, size=0xfffef800, size@entry=0xfffef7f8, groupsp=0xfffef804, groupsp@entry=0xfffef7fc,
    limit=limit@entry=-1) at initgroups.c:112
3  0xf759f45c in getgrouplist (user=user@entry=0x443f70 "root", group=0, groups=groups@entry=0x443f90, ngroups=ngroups@entry=0xfffef834) at initgroups.c:170
4  0xf778d940 in fill_user_info (info=info@entry=0x442ce0, uid=uid@entry=0, username=username@entry=0x0, error=0x1c, error@entry=0xfffef8b0) at dbus-sysdeps-unix.c:2410
5  0xf778db24 in _dbus_user_info_fill_uid (info=info@entry=0x442ce0, uid=uid@entry=0, error=error@entry=0xfffef8b0) at dbus-sysdeps-unix.c:2534
6  0xf7790b24 in _dbus_user_database_lookup (db=db@entry=0x4424c0, uid=<optimized out>, username=username@entry=0x0, error=error@entry=0xfffef8b0) at dbus-userdb.c:176
7  0xf7790d64 in _dbus_user_database_get_uid (db=db@entry=0x4424c0, uid=<optimized out>, info=0xfffef8ac, info@entry=0xfffef8a4, error=error@entry=0xfffef8b0) at dbus-userdb.c:662
8  0xf7790dc8 in init_system_db () at dbus-userdb.c:247
9  0xf7790f4c in init_system_db () at dbus-userdb.c:238
10 _dbus_user_database_get_system () at dbus-userdb.c:340
11 0x00421e58 in _dbus_get_user_id_and_primary_group (username=0xfffef928, uid_p=0x442584, gid_p=0x0) at dbus-userdb-util.c:210
12 0x0040f344 in start_busconfig_child (error=0xfffef9b8, attribute_values=0x0, attribute_names=0x4404f8, element_name=0x4399e0 "\250\230\003", parser=0x440d08) at config-parser.c:1048
13 bus_config_parser_start_element (parser=0x440d08, element_name=element_name@entry=0x442478 "policy", attribute_names=attribute_names@entry=0x4404f8, attribute_values=attribute_values@entry=0x442568, error=0xfffefc08) at config-parser.c:1919
14 0x0041ecc8 in expat_StartElementHandler (userData=0xfffefb18, name=0x442478 "policy", atts=0x440710) at config-loader-expat.c:107
15 0xf76c84a0 in doContent (parser=parser@entry=0x440518, startTagLevel=startTagLevel@entry=0, enc=enc@entry=0xf76e8a50 <utf8_encoding>,
    s=s@entry=0x4414d0 "<busconfig>\n\n  <type>accessibility</type>\n\n<servicedir>/usr/share/dbus-1/accessibility-services</servicedir>\n  <auth>EXTERNAL</auth>\n\n  <listen>unix:tmpdir=/tmp</listen>\n\n  <policy user=\"owner\">\n    <"...,
    end=end@entry=0x441957 "", nextPtr=nextPtr@entry=0x440530, haveMore=haveMore@entry=0 '\000') at xmlparse.c:2890
16 0xf76c8ca0 in contentProcessor (parser=parser@entry=0x440518,
    start=start@entry=0x4414d0 "<busconfig>\n\n  <type>accessibility</type>\n\n<servicedir>/usr/share/dbus-1/accessibility-services</servicedir>\n  <auth>EXTERNAL</auth>\n\n  <listen>unix:tmpdir=/tmp</listen>\n\n  <policy user=\"owner\">\n    <"..., end=end@entry=0x441957 "", endPtr=endPtr@entry=0x440530) at xmlparse.c:2552
17 0xf76c9d9e in doProlog (parser=parser@entry=0x440518, enc=0xf76e8a50 <utf8_encoding>,
    s=0x4414d0 "<busconfig>\n\n  <type>accessibility</type>\n\n<servicedir>/usr/share/dbus-1/accessibility-services</servicedir>\n  <auth>EXTERNAL</auth>\n\n  <listen>unix:tmpdir=/tmp</listen>\n\n  <policy user=\"owner\">\n    <"...,
    s@entry=0x441440 "<!DOCTYPE busconfig PUBLIC \"-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN\" \"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd\">\n<busconfig>\n\n  <type>accessibility</type>\n\n<servicedir>/"...,
    end=0x441957 "", tok=<optimized out>, next=<optimized out>,
    next@entry=0x441449 " busconfig PUBLIC \"-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN\" \"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd\">\n<busconfig>\n\n  <type>accessibility</type>\n\n<servicedir>/usr/share"...,
    nextPtr=nextPtr@entry=0x440530, haveMore=haveMore@entry=0 '\000') at xmlparse.c:4579
18 0xf76ca2da in prologProcessor (parser=0x440518,
    s=0x441440 "<!DOCTYPE busconfig PUBLIC \"-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN\" \"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd\">\n<busconfig>\n\n  <type>accessibility</type>\n\n<servicedir>/"...,
    end=<optimized out>, nextPtr=0x440530) at xmlparse.c:4293
19 0xf76cb678 in XML_ParseBuffer (parser=0x440518, len=<optimized out>, isFinal=1) at xmlparse.c:1988
20 0x0041eebc in bus_config_load (file=file@entry=0xfffefc18, is_toplevel=is_toplevel@entry=1, parent=parent@entry=0x0, error=0xfffefc08, error@entry=0x406824 <main+960>) at config-loader-expat.c:245
21 0x0040a890 in bus_context_new (config_file=0xfffefc18, flags=(BUS_CONTEXT_FLAG_FORK_NEVER | BUS_CONTEXT_FLAG_WRITE_PID_FILE), print_addr_pipe=0xfffefc00, print_pid_pipe=0xfffefc04, address=0x0, error=0xfffefc08) at bus.c:797
22 0x00406824 in main (argc=<optimized out>, argv=<optimized out>) at main.c:634

Change-Id: Ic1ee03c3e760506e72032247da36b2567d903ba3

5 years agokdbus: share fd and pool with libdbuspolicy 72/201472/6 accepted/tizen/unified/20190322.075523 submit/tizen/20190321.094448
Adrian Szyndela [Wed, 13 Mar 2019 15:39:26 +0000 (16:39 +0100)]
kdbus: share fd and pool with libdbuspolicy

This uses new functionality of libdbuspolicy: using client's pool and fd.
This way libdbuspolicy doesn't have to create its own connection,
and what is more important it doesn't have to create its own 1MB pool.
This is at the cost of using client's pool for receiving responses
to ioctl(KDBUS_CMD_GET_CONN_INFO), which are small.

Change-Id: I183a91196fead179a9fba22fa6418680305d3558

5 years agokdbus: add assert for non-NULL member 69/201669/2
Adrian Szyndela [Mon, 18 Mar 2019 14:05:19 +0000 (15:05 +0100)]
kdbus: add assert for non-NULL member

Trying to call an unnammed method on org.freedesktop.DBus is considered
a programming error.
This detects such errors.

Change-Id: Ic341df0eef0e7ef5ab8234aacc2c256c295327c3

5 years agokdbus: move dbuspolicy init to bus_register_kdbus 71/201471/2
Adrian Szyndela [Fri, 8 Mar 2019 11:33:02 +0000 (12:33 +0100)]
kdbus: move dbuspolicy init to bus_register_kdbus

This changes the moment of checking if user is allowed to connect to
the bus. Now, it reflects standard process a bit more.

The standard process is:
- open fd (e.g. socket);
- check authentication, if needed and possible;
- connect to the bus (say hello).

In kdbus, we have only:
- open kdbus fd;
- connect to the bus (ioctl KDBUS_CMD_HELLO).
Calling libdbuspolicy for authentication fits between the two.

Additionally, and most importantly, this is required to share
the connection between libdbus and libdbuspolicy in the future.

Change-Id: Id6fe1dbc1cdc6ec774316e13fe5d60d862949476

5 years agokdbus: Fix memory leakage in capture_org_freedesktop_DBus_StartServiceByName() 50/199750/3 accepted/tizen/unified/20190219.154258 submit/tizen/20190215.045528
sanghyeok.oh [Thu, 14 Feb 2019 11:04:56 +0000 (20:04 +0900)]
kdbus: Fix memory leakage in capture_org_freedesktop_DBus_StartServiceByName()

Change-Id: If4b04d0f287e199e809cdf183ce4ce779c0f4dd4
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
5 years agoDBusMessage: bugfix for wrong type specifier 14/199614/1 accepted/tizen/unified/20190214.154123 submit/tizen/20190213.080620
sanghyeok.oh [Wed, 13 Feb 2019 07:40:26 +0000 (16:40 +0900)]
DBusMessage: bugfix for wrong type specifier

Change-Id: I0743a3d67e3d6d58acc605ded013eedb6b0af9c5
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
5 years agodbus_message_iter_open_container: Don't leak signature on failure 22/199022/1 submit/tizen/20190211.015911
Simon McVittie [Tue, 4 Jul 2017 14:38:57 +0000 (15:38 +0100)]
dbus_message_iter_open_container: Don't leak signature on failure

If we run out of memory while calling _dbus_type_writer_recurse()
(which is impossible for most contained types, but can happen for
structs and dict-entries), then the memory we allocated in the call to
_dbus_message_iter_open_signature() will still be allocated, and we
have to free it in order to return to the state of the world prior to
calling open_container().

One might reasonably worry that this change can break callers that use
this (incorrect) pattern:

    if (!dbus_message_iter_open_container (outer, ..., inner))
      {
        dbus_message_iter_abandon_container (outer, inner);
        goto fail;
      }
    /* now we know inner is open, and we must close it later */

However, testing that pattern with _dbus_test_oom_handling()
demonstrates that it already dies with a DBusString assertion failure
even before this commit.

This is all concerningly fragile, and I think the next step should be
to zero out DBusMessageIter instances when they are invalidated, so
that a "double-free" is always detected.

Change-Id: I2ccd4b516c7714f64c4543dd8d2e5c99633733a5
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101568

5 years agodbus_message_append_args_valist: Don't leak memory on inappropriate type 21/199021/1
Simon McVittie [Tue, 4 Jul 2017 12:31:38 +0000 (13:31 +0100)]
dbus_message_append_args_valist: Don't leak memory on inappropriate type

Found by source code inspection while trying to debug an unrelated
leak.

Change-Id: I0726c57bb4b0ccdadee2263b14f9fe3fe4ebc99a
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101568

5 years agoDBusMessage: Fix UB (misaligned access) in call to _dbus_header_set_field_basic() 20/199020/1
Marc Mutz [Mon, 3 Oct 2016 20:19:45 +0000 (22:19 +0200)]
DBusMessage: Fix UB (misaligned access) in call to _dbus_header_set_field_basic()

The const void* 'value' pointer that is passed the address of a
uint32_t here eventually ends up in _dbus_marshal_write_basic(), which
casts it to a DBusBasicValue, a union type that has an alignment of
eight on 64-bit platforms and is therefore more-aligned than the
uint32.

The read of a value of a more-aligned type through a pointer to a less
-aligned type is undefined behaviour.

Fix by storing the uint32 in a DBusBasicValue and passing that instead.

Found by UBSan:

  dbus/dbus/dbus-marshal-basic.c:832:14: runtime error: member access within misaligned address 0x7fdb8dac3a04 for type 'const union DBusBasicValue', which requires 8 byte alignment
  0x7fdb8dac3a04: note: pointer points here
    4a 87 b5 71 01 00 00 00  40 7d 01 00 00 61 00 00  10 3b ac 8d db 7f 00 00  2c 2a 3e 94 db 7f 00 00
                ^
    #0 0x7fdb9444a2c3 in _dbus_marshal_write_basic dbus/dbus/dbus-marshal-basic.c:832
    #1 0x7fdb943d22fb in _dbus_type_writer_write_basic_no_typecode dbus/dbus/dbus-marshal-recursive.c:1605
    #2 0x7fdb943d64e9 in _dbus_type_writer_write_basic dbus/dbus/dbus-marshal-recursive.c:2327
    #3 0x7fdb943c52a6 in write_basic_field dbus/dbus/dbus-marshal-header.c:318
    #4 0x7fdb943c919e in _dbus_header_set_field_basic dbus/dbus/dbus-marshal-header.c:1321
    #5 0x7fdb943e1349 in dbus_message_set_reply_serial dbus/dbus/dbus-message.c:1173

Change-Id: I0149da4ebbead9b4b38c8c62af1ea892e24ec95e
Signed-off-by: Marc Mutz <marc@kdab.net>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98035

5 years agodbus_message_iter_append_basic: Don't leak signature if appending fd fails 19/199019/1
Simon McVittie [Tue, 4 Jul 2017 13:13:15 +0000 (14:13 +0100)]
dbus_message_iter_append_basic: Don't leak signature if appending fd fails

Change-Id: I37ac4d243832476772ffbd822bbf4598e6f8f9a5
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101568

5 years agodbus-hash: Fix a potential shift by a negative integer 18/199018/1
Philip Withnall [Thu, 2 Feb 2017 10:14:55 +0000 (10:14 +0000)]
dbus-hash: Fix a potential shift by a negative integer

As a hash table becomes unbelievably large and full, the down_shift
tends towards 0. The overflow detection code in rebuild_table() does not
prevent down_shift becoming negative, which then causes undefined
behaviour in RANDOM_INDEX for int-keyed tables.

Note that this can only happen with approaching INT_MAX entries in the
hash table, at which point we’ve almost certainly hit OOM somewhere, so
this is vanishingly unlikely to happen. This is why I can’t add a test
for the bug.

As always, thanks to Coverity.

Coverity ID: 54682
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99641
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Change-Id: Iac3047fc0bff11b3d08c2938c0fda292bddb1466

5 years agoDisplay thread id in _dbus_verbose to be able to see threading issues. 17/199017/1
Ralf Habacker [Tue, 10 May 2016 14:51:25 +0000 (16:51 +0200)]
Display thread id in _dbus_verbose to be able to see threading issues.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=95191
Change-Id: I16b39c8c3123436d54655a67f9d00aa090933aba
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
5 years agotools: modify execute label of dbus-monitor 56/198756/1 accepted/tizen/unified/20190201.061340 submit/tizen/20190131.021840 submit/tizen/20190131.080207
sanghyeok.oh [Tue, 29 Jan 2019 07:13:19 +0000 (16:13 +0900)]
tools: modify execute label of dbus-monitor

Unable to read 'fd passing messages' due to permission.
Set execute label as "System"

Change-Id: I765081a58cc285951216fdb63f8cf9a5c68e39de
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
5 years agodbus-connection: Add _dbus_string_free to deallocate memory 23/197923/1 accepted/tizen/unified/20190128.061345 submit/tizen/20190117.090745 submit/tizen/20190121.055508
sanghyeok.oh [Thu, 17 Jan 2019 07:08:51 +0000 (16:08 +0900)]
dbus-connection: Add _dbus_string_free to deallocate memory

The string must eventually be freed with _dbus_string_free().

Change-Id: I4041940684dd1dc7099bf823b22fabc357f17901
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
5 years agoFix missing dbus_message_unref() in error reply path 15/197915/1
Shin-ichi MORITA [Sat, 17 Jun 2017 11:35:30 +0000 (20:35 +0900)]
Fix missing dbus_message_unref() in error reply path

The error message was leaked when blocking on a pending call after
the connection was disconnected.

Change-Id: Icc95bcef32b2fd1d2b4d4a7db3bdf2936579c52c
Reviewed-by: Philip Withnall <withnall@endlessm.com>
[smcv: re-word commit message]
Reviewed-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101481

5 years agodbus-connection: Remove a duplicate _dbus_list_clear() call 14/197914/1
Philip Withnall [Tue, 17 Jan 2017 08:35:07 +0000 (08:35 +0000)]
dbus-connection: Remove a duplicate _dbus_list_clear() call

This was doing no harm (clearing an already-cleared list is a no-op),
but it was also pointless.

Change-Id: I21b580f01439ef2113183a116f208bf91e09ac76
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99435

5 years agodbus-daemon: add send_destination_prefix support 68/194868/3 accepted/tizen/unified/20190110.060340 submit/tizen/20190109.021130
Adrian Szyndela [Wed, 28 Nov 2018 14:15:16 +0000 (15:15 +0100)]
dbus-daemon: add send_destination_prefix support

Change-Id: Iaa1eff400c045ec46465f248e8460c97bb183e5b

5 years agokdbus: fixed memory leak in process_connection_info_cmd() 84/196684/1 accepted/tizen/unified/20190105.054101 submit/tizen/20190104.021452
sanghyeok.oh [Thu, 3 Jan 2019 12:31:45 +0000 (21:31 +0900)]
kdbus: fixed memory leak in process_connection_info_cmd()

Change-Id: I67e577761e7596eac400bc8c35386f4c0cbf840a
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
5 years agoMerge "Revert "Add RequiresMountsFor=/opt to dbus.service"" into tizen accepted/tizen/unified/20181205.063348 submit/tizen/20181204.070128
Hyotaek Shim [Tue, 4 Dec 2018 04:14:22 +0000 (04:14 +0000)]
Merge "Revert "Add RequiresMountsFor=/opt to dbus.service"" into tizen

5 years agospec: fixed compilation options to reduce warnings 50/194150/1
Adrian Szyndela [Thu, 29 Nov 2018 09:23:44 +0000 (10:23 +0100)]
spec: fixed compilation options to reduce warnings

If -mimplicit-it option is set to thumb while compiling to ARM,
then it shows lots of:
Warning: conditional outside an IT block for Thumb.

This commit removes -mimplicit-it from the compilation options on ARM32 arch.

Change-Id: I6eea9ef65e61b8ec7afa16035d4a14d6d7f870e4

5 years agoRevert "Add RequiresMountsFor=/opt to dbus.service" 75/193975/1
Hyotaek Shim [Wed, 28 Nov 2018 04:54:15 +0000 (04:54 +0000)]
Revert "Add RequiresMountsFor=/opt to dbus.service"

This reverts commit 1c9ed8666fcbae5076022fdf6d0f177d7e464ce4.

Change-Id: Ic15fcd3ace518c180910f43cc18b40c6de478d92

5 years agoDo not auto-activate services if we could not send a message 07/193007/2 accepted/tizen/unified/20181115.151616 submit/tizen/20181115.015729
Simon McVittie [Mon, 21 Nov 2016 20:56:55 +0000 (20:56 +0000)]
Do not auto-activate services if we could not send a message

We specifically do not check recipient policies, because
the recipient policy is based on properties of the
recipient process (in particular, its uid), which we do
not necessarily know until we have already started it.

In this initial implementation we do not check LSMs either,
because we cannot know what LSM context the recipient process
is going to have. However, LSM support will need to be added
to make this feature useful, because StartServiceByName is
normally allowed in non-LSM environments, and is more
powerful than auto-activation anyway.

The StartServiceByName method does not go through this check,
because if access to that method has been granted, then
it's somewhat obvious that you can start arbitrary services.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98666

Change-Id: I53ff4f6d02e631fcd09bf1c5c306b8828f075963

5 years agoAdd tests for activation when message send/receive is denied 06/193006/2
Simon McVittie [Fri, 16 Oct 2015 16:33:36 +0000 (17:33 +0100)]
Add tests for activation when message send/receive is denied

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98666

Change-Id: I7339c1a6de69a751cbe0b9047c980c4aea53750b

5 years agodbus-daemon: prepare activation for async security checks 05/193005/2
Adrian Szyndela [Wed, 7 Nov 2018 10:26:11 +0000 (11:26 +0100)]
dbus-daemon: prepare activation for async security checks

This commit prepares activation function (bus_activation_acivate_service())
for returning BUS_RESULT_LATER from security check introduced
in next commits.

Change-Id: I5b37d06fc5f7e563d52ed7207b5e416bedd666e6

6 years agoRemove kdbus interface header 47/192447/1 accepted/tizen/unified/20181107.082204 submit/tizen/20181106.112838
Michal Bloch [Mon, 5 Nov 2018 15:18:55 +0000 (16:18 +0100)]
Remove kdbus interface header

kdbus.h is now provided with other linux kernel headers.

Change-Id: Ida7d06aa1f27d88040f949fffd73f0d6cfd5f244
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoRemove build warnings 53/189353/3 accepted/tizen/5.0/unified/20181102.025209 accepted/tizen/unified/20180919.061631 submit/tizen/20180918.043057 submit/tizen_5.0/20181101.000006
pr.jung [Mon, 17 Sep 2018 07:09:50 +0000 (16:09 +0900)]
Remove build warnings

Change-Id: Ia1676731696d446a3511efb700dd89c1a1100b08
Signed-off-by: pr.jung <pr.jung@samsung.com>
6 years agoSet the smack label of executable binary tools 90/188490/2 accepted/tizen/unified/20180906.144209 submit/tizen/20180906.020620
Hyotaek Shim [Wed, 5 Sep 2018 09:20:00 +0000 (18:20 +0900)]
Set the smack label of executable binary tools

Apps (3rd party and even in-house Apps) are not permitted to run dbus tools directly.
User System::Tools rx
User::Shell System::Tools rx
System::TEF System::Tools rx
System::Privileged System::Tools rx
System System::Tools rx

Change-Id: Ica6d587d2516da8241590f3cf090a91ed8d3ff75
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
6 years agoAdd RequiresMountsFor=/opt to dbus.service 31/186331/1
INSUN PYO [Thu, 9 Aug 2018 04:21:10 +0000 (13:21 +0900)]
Add RequiresMountsFor=/opt to dbus.service

In order to apply User/Group to .service, we need /opt/etc/{passwd,group}.

Signed-off-by: INSUN PYO <insun.pyo@samsung.com>
Change-Id: I585503d0dc180f21bd9594327b87b80204876005

6 years agoservice: add dependecy to tmp.mount 97/185197/2 accepted/tizen/unified/20180810.132525 submit/tizen/20180810.001302
INSUN PYO [Fri, 27 Jul 2018 02:09:01 +0000 (11:09 +0900)]
service: add dependecy to tmp.mount

Until tmp.mount is run, dbus-daemon fails because /tmp is RO.

Signed-off-by: INSUN PYO <insun.pyo@samsung.com>
Change-Id: I6bfb47f2d14d95c440efc56e3ca2fd8b1b75c6ad

6 years agoBoost dbus.service and dbus.socket for boot optimization 25/182625/1 accepted/tizen/unified/20180703.062053 submit/tizen/20180702.065056
Hyotaek Shim [Mon, 25 Jun 2018 07:29:21 +0000 (16:29 +0900)]
Boost dbus.service and dbus.socket for boot optimization

Change-Id: Ie47ca8ea5fbf3b1deee98ebcdcd644b021531713
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
6 years agoDbus policy: apply default deny rules in the global conf file (system.conf - system... 56/178156/5 accepted/tizen/unified/20180619.142057 submit/tizen/20180619.052936
sanghyeok.oh [Tue, 8 May 2018 10:18:16 +0000 (19:18 +0900)]
Dbus policy: apply default deny rules in the global conf file (system.conf - system bus)
This is requirement from SR, MCD, and VD Security.

Change-Id: I5ec22cd70d15fdd07c4fd3d7ad7e9289bb4ef770
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
6 years agokdbus: check policy first, only then open kdbus 50/178150/4
Aleksy Barcz [Tue, 8 May 2018 09:21:10 +0000 (11:21 +0200)]
kdbus: check policy first, only then open kdbus

A process shouldn't hold an open kdbus descriptor, if according to
security policy this process has no rights to open the bus at all.
Corrected error message and code to be consistent with dbus-daemon.

Change-Id: I8c138438a21736f9241addc9ed5a616f6be19442

6 years agodbus: a couple of corrections after static analysis 84/180884/1
Adrian Szyndela [Tue, 5 Jun 2018 07:33:47 +0000 (09:33 +0200)]
dbus: a couple of corrections after static analysis

dbus-transport-kdbus.c:900
SVACE 19383: Assignment of a signed value which has type 'int'
to a variable of a bigger integer type 'dbus_uint64_t'

dbus-transport-kdbus.c:2464
SVACE 2044: Checking return value of dbus_message_get_interface().

Change-Id: Ic793c2d414aa77273b9ff3eff83a72b4f3e4d815

6 years agoGVariant: fix alignment of elements in array 31/179931/5
Adrian Szyndela [Wed, 23 May 2018 10:49:48 +0000 (12:49 +0200)]
GVariant: fix alignment of elements in array

This patch fixes two related bugs:
1. off-by-one in checking size and alignment of the next element
   in_dbus_reader_get_signature_fixed_size()
2. alignment requirements were not considered at all while iterating
   over array of variable size elements in array_reader_next().

Change-Id: Ibd9e1f3d11fbcd3ef0e6dbaa024e66b2568709d5

6 years agodbus-marshal-gvariant: a couple of additional checks 25/180025/4
Adrian Szyndela [Thu, 24 May 2018 08:34:59 +0000 (10:34 +0200)]
dbus-marshal-gvariant: a couple of additional checks

Change-Id: I8c5bd10512682ac2df53c9b9ab89f4d4d669cd3f

6 years agogvariant: handle immediate iteration with empty body 42/175942/1 accepted/tizen/unified/20180418.143529 submit/tizen/20180418.024038 submit/tizen/20180420.022505
Adrian Szyndela [Fri, 13 Apr 2018 14:07:53 +0000 (16:07 +0200)]
gvariant: handle immediate iteration with empty body

With GVariant, we had to do a trade-off. libdbus API does not provide
any function that would state that a message is "finished".
While creating dbus-1 messages, they are always complete.
On additions header fields can change, and all the data is simply
appended. With GVariant it is different. The format does not have
signature field anymore in the header, but it is at the end
of a message, as a part of body variant. After a body variant,
there is also a body offset appended. These values are added to a body
when a message is considered "finished". We have chosen function
dbus_message_lock() as a signal that a message is finished.
This function is always called when a message is added to output queue.

Now, what does actually happen in case of immediate iteration after
creating a message with empty body? The length of the body is zero.
This is not possible for valid GVariant as it has at least one NUL byte,
signature (minimal is '()') and a body offset. It breaks
_dbus_message_gvariant_get_body_length(). However, it can be done with
public interface, therefore this patch:

1. fixes _dbus_message_gvariant_get_body_length() to return 0 in case
of empty body, instead of computing "negative" value.
2. warns users when they try to iterate over a GVariant message
that is not locked.

Change-Id: Ie7dc331f5ea278502df02a976e555a2c7d249197

6 years agogvariant: fix recursing into empty array 80/175480/1
Adrian Szyndela [Tue, 10 Apr 2018 13:58:13 +0000 (15:58 +0200)]
gvariant: fix recursing into empty array

In GVariant, arrays of variable size values have offsets at the end.
We need to know how many offsets are in an array when we recurse
into it. To count the offsets we need to have offsets size and
the start and end of the offsets. The start of the offsets
is computed from the value of the last offset.

On the other hand, empty arrays have size equal to zero. In other words,
they have no offsets. Function _dbus_reader_count_array_elems missed it.

This commit fixes _dbus_reader_count_array_elems() by ensuring returning 0
when an array is empty.

Change-Id: I5f93ea89e490b321b2c2528e7bae838a1af0ec75

6 years agoApply Full RELRO linker options ("-Wl,-z,relro,-z,now") to dbus-daemon 62/174562/2 accepted/tizen/unified/20180404.063322 submit/tizen/20180403.053920
Hyotaek Shim [Tue, 3 Apr 2018 04:47:23 +0000 (13:47 +0900)]
Apply Full RELRO linker options ("-Wl,-z,relro,-z,now") to dbus-daemon
In addition to Partial RELRO, Full RELRO means "GOT Table becomes read-only."

Change-Id: Iaed328906e23d526f3e05209d949f3e39f76a738
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
6 years agoRemove unused dbus socket. 73/164773/1 accepted/tizen/unified/20180206.064117 submit/tizen/20171222.095816 submit/tizen/20180123.014737 submit/tizen/20180205.070337
INSUN PYO [Thu, 21 Dec 2017 03:50:04 +0000 (12:50 +0900)]
Remove unused dbus socket.

/run/user/%UID/dbus/user_bus_socket has been temporarilly remained
for previous version support.

Nobody uses this for now.
/run/user/%UID/bus is used instead.

Signed-off-by: INSUN PYO <insun.pyo@samsung.com>
Change-Id: I10a5c4153201e5a620b9460f3b5f938bbbedcea7

6 years agospec: Change useradd/groupadd to handle in security-manager. 29/161229/2 accepted/tizen/unified/20171124.172644 submit/tizen/20171123.061702
INSUN PYO [Wed, 22 Nov 2017 07:38:15 +0000 (16:38 +0900)]
spec: Change useradd/groupadd to handle in security-manager.

I left useradd/groupadd to make this package available from open source
without security-manager.

Signed-off-by: INSUN PYO <insun.pyo@samsung.com>
Change-Id: I3348c321a44df01c082c36bc09844a122adb669a

6 years agospec: remove unused /var/lib/dbus directory 05/161205/1 accepted/tizen/unified/20171123.184043 submit/tizen/20171122.065618
INSUN PYO [Wed, 22 Nov 2017 06:19:47 +0000 (15:19 +0900)]
spec: remove unused /var/lib/dbus directory

Signed-off-by: INSUN PYO <insun.pyo@samsung.com>
Change-Id: Iee10a2a4b58f69f8bc90d7209fa6a11762fb11ad

7 years agoswitch compilation mode from Thumb to ARM 37/156437/3 accepted/tizen/unified/20171019.145715 submit/tizen/20171019.034316
Adrian Szyndela [Wed, 18 Oct 2017 09:27:57 +0000 (11:27 +0200)]
switch compilation mode from Thumb to ARM

This is needed to be able to put uprobes in the library code as
the uprobes in current kernel versions work only with ARM code.

Change-Id: I5e2ee2ac37fda354fa93f080e5553d2c823144ec

7 years agokdbus: default allow receive_type=signal for session bus 97/155097/2
sanghyeok.oh [Thu, 12 Oct 2017 05:31:28 +0000 (14:31 +0900)]
kdbus: default allow receive_type=signal for session bus

Change-Id: Id6077d3f10567df5e1320cc66b9048160a2995a4
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
7 years agoRemove Apache-2.0 in the dbus.spec 75/149675/1
Hyotaek Shim [Wed, 13 Sep 2017 01:58:13 +0000 (10:58 +0900)]
Remove Apache-2.0 in the dbus.spec

Change-Id: I91791d0efa0c2e42fb715c03293675da4fb7a4a3
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
7 years agoChange the license of test-runner.c from the Apache-2.0 to the MIT license to avoid... 91/149191/1
Hyotaek Shim [Tue, 12 Sep 2017 01:33:35 +0000 (10:33 +0900)]
Change the license of test-runner.c from the Apache-2.0 to the MIT license to avoid conflict with LGPL-2.1+/GPL-2.0+

Change-Id: I2f1ac40f78c692571bc11b1b9e5262bdd1c6c125
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
7 years agoGVariant: fix for not having offset for empty arrays 05/142905/2 accepted/tizen/4.0/unified/20170828.222508 accepted/tizen/unified/20170808.171336 accepted/tizen/unified/20170811.021149 submit/tizen/20170808.013620 submit/tizen/20170810.123503 submit/tizen_4.0/20170828.100005
Adrian Szyndela [Mon, 7 Aug 2017 14:38:00 +0000 (16:38 +0200)]
GVariant: fix for not having offset for empty arrays

GVariant requires offsets for variable length struct
members. Empty variable-size arrays which are at the beginning
of a struct have offset 0. However, 0 was used as
the indicator that there should be no offset added.
This patch changes 0 to the impossible value.

Change-Id: Icbc18e87831a20727f142a1218e6736e76bcce82
Signed-off-by: INSUN PYO <insun.pyo@samsung.com>
7 years agokdbus: check policy only for method call or unicast signal 95/139295/1 accepted/tizen/4.0/unified/20170816.012441 accepted/tizen/unified/20170727.190334 submit/tizen/20170719.103604 submit/tizen/20170725.023005 submit/tizen_4.0/20170811.094300
sanghyeok.oh [Tue, 18 Jul 2017 08:28:16 +0000 (17:28 +0900)]
kdbus: check policy only for method call or unicast signal

Otherwise just send it. It will checked by receiver.

Change-Id: I9652f7548adf9605111d28cdc236f36fbe319c97
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
7 years agokdbus: libdbuspolicy: To perform policy check, pass unique name to libdbuspolicy 38/138938/3
sanghyeok.oh [Fri, 14 Jul 2017 09:09:05 +0000 (18:09 +0900)]
kdbus: libdbuspolicy: To perform policy check, pass unique name to libdbuspolicy

In case of signal broadcasting, message has null destination,
To perform policy check correctly, libdbus should pass unique name to libdbuspolicy as destination.

Change-Id: I62704ed838432823c0c11951bbb6234905167716
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
7 years agoRemove legacy smack support, keep upstream smack support 70/133270/7 accepted/tizen/unified/20170712.164836 submit/tizen/20170707.072404 submit/tizen/20170710.061501
Adrian Szyndela [Fri, 9 Jun 2017 09:32:40 +0000 (11:32 +0200)]
Remove legacy smack support, keep upstream smack support

This commit reverts four commits.
There was a need for additional minor changes to make it work.

Revert "GetConnectionCredentials - add smack support"
This reverts commit 13d888ca95c75c14a4919b36cc0a15979fb1d42b.

Revert "packaging: enable Smack support"
This reverts commit 54f95c99cf4d53f5566511fc0cdc21b230909b29.

Revert "Enforce smack policy from conf file"
This reverts commit 1d028039f5d34de8a1224d2ad0d8bc75b3da3ca4.

Revert "Enable checking of smack context from DBus interface"
This reverts commit 7af23db240c54e9923c76234b7e9c7a243d2d428.

Change-Id: I4bf7ce8d43717e1deb5d980f87be39220922b422

7 years agospec: remove unused files 84/135584/1 submit/tizen/20170707.050724
INSUN PYO [Fri, 23 Jun 2017 07:49:08 +0000 (16:49 +0900)]
spec: remove unused files

Signed-off-by: INSUN PYO <insun.pyo@samsung.com>
Change-Id: Idbeb2980bb1ee7c1f5989ba6dc487b20f72c93b8

7 years agocynara: add exception code for cynara_session_id retriving 03/121303/3 accepted/tizen/unified/20170629.085739 submit/tizen/20170622.043014
INSUN PYO [Mon, 27 Mar 2017 12:53:16 +0000 (21:53 +0900)]
cynara: add exception code for cynara_session_id retriving

If client exit as soon as  async call, cynara_session_from_pid return null.
cynara_session_from_pid checks /proc/pid to verify client id.

===== reproduce =====
su - owner

dbus-send  --type=method_call  --system --dest=org.tizen.system.deviced  /Org/Tizen/System/DeviceD/Display  org.tizen.system.deviced.display.CustomBrightness
=====================

Signed-off-by: INSUN PYO <insun.pyo@samsung.com>
Change-Id: Ic313e9d4f9531135865824d8512b9eb1ac6f4c9e

7 years agokdbus:pass sender to dbuspolicy1_check_out 55/131155/2 submit/tizen/20170612.054403
sanghyeok.oh [Thu, 25 May 2017 13:12:07 +0000 (22:12 +0900)]
kdbus:pass sender to dbuspolicy1_check_out

Change-Id: I23894a2e44484a896df441caa6dd3e86bbae9d78
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
7 years agokdbus: assure that GVariant footer is not split 64/131364/3 accepted/tizen/unified/20170608.184708 submit/tizen/20170608.074009
Adrian Szyndela [Fri, 26 May 2017 14:16:22 +0000 (16:16 +0200)]
kdbus: assure that GVariant footer is not split

Change-Id: I4a92adaf91c3205274be5d87302908ad35cb2dbf

7 years agokdbus: make error messages more consistent with glib 99/132199/2 accepted/tizen/unified/20170608.072404 submit/tizen/20170607.081757
Adrian Szyndela [Thu, 1 Jun 2017 11:41:09 +0000 (13:41 +0200)]
kdbus: make error messages more consistent with glib

Change-Id: Iccb88417fc83290ed70a32e86bc80c4a5c44c6ee

7 years agokdbus: bugfix for return codes on call to non-existing destination 72/128372/4
Adrian Szyndela [Tue, 9 May 2017 12:45:26 +0000 (14:45 +0200)]
kdbus: bugfix for return codes on call to non-existing destination

Calling a method on non-existing destination with auto start disabled
caused error org.freedesktop.DBus.ServiceUnknown.
Non-kdbus implementation gives org.freedesktop.DBus.NameHasNoOwner.
This patch makes kdbus return the same error as non-kdbus implementation.

Change-Id: Iadbf060159e91d5c4e10ea9a26abb50d02154a5f

7 years agochange user socket address from %t/dbus/user_bus_socket to %t/bus 74/121974/3 accepted/tizen/unified/20170605.150455 submit/tizen/20170531.022017
INSUN PYO [Wed, 29 Mar 2017 16:04:52 +0000 (01:04 +0900)]
change user socket address from %t/dbus/user_bus_socket to %t/bus

Sync to upstream.
Upstream uses %d/bus, but tizen uses %t/dbus/user_bus_socket.

Some application use hard coded address %d/dbus/user_bus_socket.
So, I remain SymLinks temporary.
Later changing all application, I will remove SymLinks.

Signed-off-by: INSUN PYO <insun.pyo@samsung.com>
Change-Id: I7d00fc96fdbae28a6bd610ced0adfdcc52ec8987

7 years agoremove unused code 87/118487/2 accepted/tizen/unified/20170518.190013 submit/tizen/20170518.093222 tizen_4.0.m1_release
INSUN PYO [Sat, 11 Mar 2017 14:56:27 +0000 (23:56 +0900)]
remove unused code

Signed-off-by: INSUN PYO <insun.pyo@samsung.com>
Change-Id: I1192579e02963b0246bb99d54f415cab673abbe6

7 years agolicense:rearrange license from each packages 05/125205/3 accepted/tizen/unified/20170418.072751 submit/tizen/20170417.044225
sanghyeok.oh [Fri, 14 Apr 2017 06:26:46 +0000 (15:26 +0900)]
license:rearrange license from each packages

Change-Id: I6ec1d0ff94b9e237bb158d5c49031d0463ec3bc2
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
7 years agosvace:fix leak 17/124817/2 accepted/tizen/unified/20170413.164657 submit/tizen/20170413.042936
sanghyeok.oh [Wed, 12 Apr 2017 11:24:27 +0000 (20:24 +0900)]
svace:fix leak

Change-Id: Ifce97dae8b9390d492708bfd7d7467c1af1ed132
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
7 years agoGVariant: don't remove padding from no field 37/123937/1 accepted/tizen/unified/20170410.155846 submit/tizen/20170410.050637
Adrian Szyndela [Fri, 7 Apr 2017 16:35:58 +0000 (18:35 +0200)]
GVariant: don't remove padding from no field

When a message is created with dbus_message_new() it gets no fields.
Then, while appending some values, but before setting path, interface,
etc. a single field appears - signature. If there would be more fields,
then after deleting the last field we would need to remove padding
from second-to-last field. In case of a single field, we have
no second-to-last field, only empty dictionary. Empty dictionaries do
not have padding at the end, so we do not need to remove it.

Change-Id: Idb15f3999a3ff0117f906ec632f462eb5cdaab09

7 years agoIncrease release version for MCD. 47/122547/1 accepted/tizen_common accepted/tizen_ivi accepted/tizen_mobile accepted/tizen_tv accepted/tizen_wearable accepted/tizen/common/20170403.190202 accepted/tizen/ivi/20170403.124913 accepted/tizen/mobile/20170403.124829 accepted/tizen/tv/20170403.124840 accepted/tizen/unified/20170403.124934 accepted/tizen/wearable/20170403.124855 submit/tizen/20170403.034150
INSUN PYO [Mon, 3 Apr 2017 03:36:45 +0000 (12:36 +0900)]
Increase release version for MCD.

Signed-off-by: INSUN PYO <insun.pyo@samsung.com>
Change-Id: I8f115a821731b01727bc19510962f9b7720f3d89

7 years agoMerge "License: add license files - add COPYING" into tizen accepted/tizen/common/20170331.152722 accepted/tizen/ivi/20170331.083016 accepted/tizen/mobile/20170331.083052 accepted/tizen/tv/20170331.082921 accepted/tizen/unified/20170331.083229 accepted/tizen/wearable/20170331.083033 submit/tizen/20170331.032259
INSUN PYO [Fri, 31 Mar 2017 03:17:31 +0000 (20:17 -0700)]
Merge "License: add license files - add COPYING" into tizen

7 years agoLicense: add license files - add COPYING 60/122260/1
INSUN PYO [Fri, 31 Mar 2017 02:58:09 +0000 (11:58 +0900)]
License: add license files - add COPYING

Signed-off-by: INSUN PYO <insun.pyo@samsung.com>
Change-Id: Ib7372970eb1a1e24154de189848cd0ca2faa2563

7 years agoReplace user dbus.socket and dbus.service file. 40/119940/5 accepted/tizen/common/20170330.151521 accepted/tizen/ivi/20170330.223726 accepted/tizen/mobile/20170330.223629 accepted/tizen/tv/20170330.223645 accepted/tizen/unified/20170330.223742 accepted/tizen/wearable/20170330.223657 submit/tizen/20170329.152406
INSUN PYO [Mon, 20 Mar 2017 16:36:32 +0000 (01:36 +0900)]
Replace user dbus.socket and dbus.service file.

The dbus source includes dbus.socket and dbus.service for user session.
But tizen uses its own files.

Signed-off-by: INSUN PYO <insun.pyo@samsung.com>
Change-Id: Ied720b0fd5e792845ab626f680d01cbb3e9b2db9

7 years agoLicense: add license files 06/121306/2 accepted/tizen/common/20170329.172212 accepted/tizen/ivi/20170329.222504 accepted/tizen/mobile/20170329.222402 accepted/tizen/tv/20170329.222415 accepted/tizen/unified/20170329.222508 accepted/tizen/wearable/20170329.222431 submit/tizen/20170329.022248
INSUN PYO [Mon, 27 Mar 2017 13:17:42 +0000 (22:17 +0900)]
License: add license files

Change-Id: I2e1785ef0d14c2d5a9aa1d49904064b4fe80f9ee

7 years agocynara: add exception code for disconnection code. 71/120571/3 accepted/tizen/common/20170327.142517 accepted/tizen/ivi/20170327.052332 accepted/tizen/mobile/20170327.052243 accepted/tizen/tv/20170327.052301 accepted/tizen/unified/20170327.052349 accepted/tizen/wearable/20170327.052316 submit/tizen/20170327.014124
INSUN PYO [Thu, 23 Mar 2017 07:49:21 +0000 (16:49 +0900)]
cynara: add exception code for disconnection code.

For disconnection connections, _dbus_connection_get_dispatch_status_unlocked always returns DBUS_DISPATCH_DATA_REMAINS.
So __bus_loop_dispatch is going around in an infinite loop.
If _dbus_loop_dispatch is out of the loop, _dbus_connection_get_dispatch_status_unlocked returns DBUS_DISPATCH_COMPLETE as normal.

It is dead-lock.

======================  reproduce ==================
su - owner
dbus-send  --type=method_call  --system --dest=org.tizen.system.deviced  /Org/Tizen/System/DeviceD/Display  org.tizen.system.deviced.display.CustomBrightness
dbus-send  --type=method_call  --system --dest=org.tizen.system.deviced  /Org/Tizen/System/DeviceD/Display  org.tizen.system.deviced.display.CustomBrightness
dbus-send  --type=method_call  --system --dest=org.tizen.system.deviced  /Org/Tizen/System/DeviceD/Display  org.tizen.system.deviced.display.CustomBrightness
dbus-send  --type=method_call  --system --dest=org.tizen.system.deviced  /Org/Tizen/System/DeviceD/Display  org.tizen.system.deviced.display.CustomBrightness
dbus-send  --type=method_call  --system --dest=org.tizen.system.deviced  /Org/Tizen/System/DeviceD/Display  org.tizen.system.deviced.display.CustomBrightness
===================================================

Signed-off-by: INSUN PYO <insun.pyo@samsung.com>
Change-Id: I8565a757a62b50a27d2c6b6931e125af452ff74e

7 years agoChange bus connection check code : bus_connection_is_active () ==> dbus_connection_ge... 06/117406/4 accepted/tizen/common/20170320.173720 accepted/tizen/ivi/20170320.222436 accepted/tizen/mobile/20170320.222346 accepted/tizen/tv/20170320.222401 accepted/tizen/unified/20170320.222501 accepted/tizen/wearable/20170320.222419 submit/tizen/20170320.071222
INSUN PYO [Sun, 5 Mar 2017 00:30:23 +0000 (09:30 +0900)]
Change bus connection check code : bus_connection_is_active () ==> dbus_connection_get_is_connected ()

Since dbus-daemon uses asynchronous cynara functions, some cynara functions are delayed.
In the cynara delay function, check if connection is valid or not.

If the connection is lost, the "connection->slot_list" is cleared. So bus_connection_is_active() will cause crash.
Since dbus_connection_get_is_connected() only checks for "connection->transport->disconnected" variables, it works fine if only the reference count is valid.

====================================================================================================================================
0  bus_connection_is_active (connection=<optimized out>) at connection.c:1291
1  0xb6f08134 in bus_deferred_message_dispatch (deferred_message=0xb7c93668) at check.c:498
2  0xb6f0c7ce in bus_connection_dispatch_deferred (connection=0xb7ca0008) at connection.c:2677
3  0xb6f0826a in bus_check_queued_message_reply_callback (deferred_message=0xb7cb5870, result=<optimized out>) at check.c:188
4  0xb6f0cdda in bus_cynara_check_response_callback (check_id=<optimized out>, cause=<optimized out>, response=<optimized out>, user_response_data=0xb7cb5870) at cynara.c:333
5  0xb6db2994 in Cynara::Logic::processCheckResponse (this=this@entry=0xb7c0cdb8, checkResponse=...) at /usr/src/debug/cynara-0.14.7/src/client-async/logic/Logic.cpp:277
6  0xb6db3a8e in Cynara::Logic::processResponses (this=this@entry=0xb7c0cdb8) at /usr/src/debug/cynara-0.14.7/src/client-async/logic/Logic.cpp:324
7  0xb6db4578 in Cynara::Logic::processIn (this=this@entry=0xb7c0cdb8) at /usr/src/debug/cynara-0.14.7/src/client-async/logic/Logic.cpp:348
8  0xb6db45d8 in Cynara::Logic::process (this=0xb7c0cdb8) at /usr/src/debug/cynara-0.14.7/src/client-async/logic/Logic.cpp:175
9  0xb6daf35a in operator() (this=<optimized out>) at /usr/lib/gcc/armv7l-tizen-linux-gnueabi/4.9.2/include/c++/functional:2439
10 Cynara::tryCatch(std::function<int ()> const&) (func=...) at /usr/src/debug/cynara-0.14.7/src/common/exceptions/TryCatch.h:42
11 0xb6dafa5e in cynara_async_process (p_cynara=0xb7c0c7a0) at /usr/src/debug/cynara-0.14.7/src/client-async/api/client-async-api.cpp:236
12 0xb6f0cdb4 in bus_cynara_watch_callback (watch=<optimized out>, flags=<optimized out>, data=<optimized out>) at cynara.c:288
13 0xb6f14f5a in _dbus_loop_iterate (loop=loop@entry=0xb7c0b618, block=block@entry=1) at dbus-mainloop.c:819
14 0xb6f1506c in _dbus_loop_run (loop=0xb7c0b618) at dbus-mainloop.c:883
15 0xb6f046f6 in main (argc=<optimized out>, argv=<optimized out>) at main.c:661

(gdb) info locals
d = 0x0

(gdb) f 1

(gdb) p *deferred_message->sender
$27 = {refcount = {value = 1}, mutex = 0xb7c41c70, dispatch_mutex = 0xb7c41cb0, dispatch_cond = 0xb7c41cd0, io_path_mutex = 0xb7c41c90, io_path_cond = 0xb7c41d08, outgoing_messages = 0x0, incoming_messages = 0x0, expired_messages = 0x0, message_borrowed = 0x0,
  n_outgoing = 0, n_incoming = 0, outgoing_counter = 0xb7c41df8, transport = 0xb7c41778, watches = 0xb7c41b20, timeouts = 0xb7c41b40, filter_list = 0x0, slot_mutex = 0xb7c41d40, slot_list = {slots = 0xb7c41fc0, n_slots = 1}, pending_replies = 0xb7c41b60,
  client_serial = 10, disconnect_message_link = 0x0, wakeup_main_function = 0x0, wakeup_main_data = 0x0, free_wakeup_main_data = 0x0, dispatch_status_function = 0x0, dispatch_status_data = 0x0, free_dispatch_status_data = 0x0, last_dispatch_status = DBUS_DISPATCH_COMPLETE,
  objects = 0xb7c41f20, server_guid = 0x0, peer_smack_label = 0xb7c41c60 "System", dispatch_acquired = 0, io_path_acquired = 0, dispatch_disabled = 0, shareable = 0, exit_on_disconnect = 0, route_peer_messages = 1, disconnected_message_arrived = 1,
  disconnected_message_processed = 1, have_connection_lock = 0, generation = 1}

(gdb) p deferred_message->sender->slot_list
$28 = {slots = 0xb7c41fc0, n_slots = 1}

(gdb) p *deferred_message->sender->slot_list->slots
$31 = {data = 0x0, free_data_func = 0x0}

(gdb) p connection_data_slot
$32 = 0

(gdb) p deferred_message->sender->slot_list->slots[0]
$35 = {data = 0x0, free_data_func = 0x0}

(gdb) p deferred_message->sender->transport->disconnected
$33 = 1
====================================================================================================================================

Signed-off-by: INSUN PYO <insun.pyo@samsung.com>
Change-Id: Iab2abfb63030d15e380e11c057ee1f99124e102e
(cherry picked from commit 62fd017b7dbf577f736de7f8d44e6a94b4334472)

7 years agokdbus: fix build error for emulator64-wayland. 58/118958/1 accepted/tizen/common/20170315.124804 accepted/tizen/ivi/20170315.104419 accepted/tizen/mobile/20170315.104335 accepted/tizen/tv/20170315.104348 accepted/tizen/unified/20170315.104435 accepted/tizen/wearable/20170315.104408 submit/tizen/20170315.023445
INSUN PYO [Wed, 15 Mar 2017 02:12:18 +0000 (11:12 +0900)]
kdbus: fix build error for emulator64-wayland.

After applying unify build, all profiles build kdbus unconditionally even if you do not use kdbus.
Before unify build, kdbus was not enabled in emulator64-wayland environment.

Signed-off-by: INSUN PYO <insun.pyo@samsung.com>
Change-Id: I22f8dd17cdfeed17a3ef7aa8da5c738fc677f0ad

7 years ago[4.0] Remove OBS Project Dependency (kdbus/TV) 46/117746/7 submit/tizen/20170314.043113
Geunsik Lim [Tue, 7 Mar 2017 08:53:38 +0000 (17:53 +0900)]
[4.0] Remove OBS Project Dependency (kdbus/TV)

- Please add "dbus-libs-extension-kdbus" for TV/arm-wayland images via JIRA-TRE issue.

- Without this commit, this package won't be built correctly in Tizen 4.0.

Change-Id: I94d98f44cad637af2acc22898c74a806e74f73bb
Signed-off-by: Geunsik Lim <geunsik.lim@samsung.com>
Reviewed-by: Insun Pyo <insun.pyo@samsung.com>
7 years agoRemove unused code (Don't use pgrep) 73/117473/1 accepted/tizen/common/20170306.165254 accepted/tizen/ivi/20170306.222710 accepted/tizen/mobile/20170306.222608 accepted/tizen/tv/20170306.222625 accepted/tizen/unified/20170309.035205 accepted/tizen/wearable/20170306.222650 submit/tizen/20170306.075427 submit/tizen_unified/20170308.100411
INSUN PYO [Mon, 6 Mar 2017 07:27:32 +0000 (16:27 +0900)]
Remove unused code (Don't use pgrep)

Signed-off-by: INSUN PYO <insun.pyo@samsung.com>
Change-Id: I8809374f28baae65606b679b3ef15fc71a91f98d

7 years agochange socket.target.wants/dbus.service ==> socket.target.wants/dbus.socket 05/117405/1 submit/tizen/20170306.064529
INSUN PYO [Mon, 6 Mar 2017 01:46:23 +0000 (10:46 +0900)]
change socket.target.wants/dbus.service ==> socket.target.wants/dbus.socket

Signed-off-by: INSUN PYO <insun.pyo@samsung.com>
Change-Id: Iad33b6770458d2e3e4e8507cfae5b1489da5bf0c
(cherry picked from commit e1a4cf929e2095ae0bd1e503a59388791e18e1cb)

7 years agopatch: bus: Fix timeout restarts 01/116801/2 accepted/tizen/ivi/20170306.102902 accepted/tizen/mobile/20170306.102816 accepted/tizen/tv/20170306.102834 accepted/tizen/wearable/20170306.102849 submit/tizen/20170306.031610
sanghyeok.oh [Tue, 28 Feb 2017 09:00:42 +0000 (18:00 +0900)]
patch: bus: Fix timeout restarts

patch from upstream
https://cgit.freedesktop.org/dbus/dbus/commit/?id=529600397bcab47b9bed5da9208c2df05c8b86b4

author Michal Koutn? <mkoutny@suse.com> 2016-05-24 09:14:11 (GMT)
committer Simon McVittie <smcv@debian.org> 2017-02-01 10:42:50 (GMT)
commit 529600397bcab47b9bed5da9208c2df05c8b86b4 (patch)
tree 17e9af27f973a4e0132ee23e405ed7d52fdb0771
parent befd186c0b005f1e1130cb3e4923c689085a8dbc (diff)

bus: Fix timeout restarts
The code counting pending fds relied on restart of timeouts when they are
enabled. This patch adds function that ensures that such enabled timeouts
have their timekeeping data reset (and not only when timeout is
registered into event loop processing).

When timeouts weren't reset, they'd fire at rather random and mainly
incorrect moments leading to interruption of connections of dbus-daemon.

Every time we reset the interval, we also need to re-enable the timeout
and mark its end time to be recalculated by the event loop, so combine
the old set_enabled(TRUE) with set_interval() as a new restart() method.
This leaves all the set_enabled() calls having a FALSE parameter, so
remove the parameter and rename the method to disable().

[smcv: fix minor coding style issues]
[smcv: replace set_reenabled()/set_interval() pair with restart()]
[smcv: replace set_enabled(FALSE) with disable()]
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=95619

Change-Id: Ia80641554800ae09ae22d4615b87eda0697c5f3e
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
7 years agoMerge changes Icf330ba3,I7354c21e into tizen
Hyotaek Shim [Wed, 1 Mar 2017 05:44:33 +0000 (21:44 -0800)]
Merge changes Icf330ba3,I7354c21e into tizen

* changes:
  tests: general fix for tests setup
  tests: generating coverage version of the library

7 years agomake link : /usr/lib/systemd/user/dbus.socket ==> /usr/lib/systemd/user/sockets.targe... 63/116063/1 accepted/tizen/common/20170227.042931 accepted/tizen/ivi/20170224.064811 accepted/tizen/mobile/20170224.064744 accepted/tizen/tv/20170224.064751 accepted/tizen/wearable/20170224.064806 submit/tizen/20170223.222428
INSUN PYO [Wed, 22 Feb 2017 02:38:43 +0000 (11:38 +0900)]
make link : /usr/lib/systemd/user/dbus.socket ==> /usr/lib/systemd/user/sockets.target.wants/dbus.socket

Until now, dbus.socket of user session  was not running in the sockets.target.
dbus.socket has been triggered by dbus.service's dependencies.
The dbus.service is included in basic.target.

Therefore, there are some dependency issues.
If a service runs before dbus.service, the service can not accesses dbus system.
(Since dbus.socket is not yet activated, so you can not make a dbus connection.)

I have modified dbus.service to be explicitly run in sockets.target.
On the session bus, sockets.target is guaranteed to run before all services.

Signed-off-by: INSUN PYO <insun.pyo@ubuntu1604.playinsun.pe.kr>
Change-Id: Ic46f1a46b458e2017b0025c6e564ac1204eb8cc8
(cherry picked from commit 1beb067e73478b3948980eb19e379a8986dc365a)

7 years agoMerge "tizen: notify service readyness after successful config file parsing" into... accepted/tizen/common/20170222.124446 accepted/tizen/ivi/20170222.094831 accepted/tizen/mobile/20170222.094741 accepted/tizen/tv/20170222.094757 accepted/tizen/wearable/20170222.094813 submit/tizen/20170222.041734
Hyotaek Shim [Wed, 22 Feb 2017 00:04:31 +0000 (16:04 -0800)]
Merge "tizen: notify service readyness after successful config file parsing" into tizen

7 years agotizen: notify service readyness after successful config file parsing 57/115757/1
Karol Lewandowski [Fri, 10 Feb 2017 15:16:55 +0000 (16:16 +0100)]
tizen: notify service readyness after successful config file parsing

This commit works around systemd -> dbus -> (nss) -> systemd deadlock
occuring in Tizen.

Situation is depicted on diagram below:

  systemd               dbus               nss
    |                     .                  .
    |                     .                  .
    1> reads config       .                  .
    |                     .                  .
    2> reg. nofification  .                  .
    |  for dbus.service   .                  .
    |                     .                  .
    |                     .                  .
    3> exec. services     .                  .
    |    |                .                  .
    |    (start srv...)   .                  .
    |    |                .                  .
    |    4>------------(exec)                .
    |                     |                  .
    *-<---(notification)=<|                  .
    \                     |                  .
    .\> call dbus.serv    |                  .
    .   handler           |                  .
    .    |                4a> read config    .
    .    |> conn. to bus  |                  .
    .    |                4b> resolve user   .
    .    |> call dbus     .   and groups     .
    .       \             .   initgroups()   .
    .        ------------>.    |             .
    .         (blocking)  .    \---------->select module
    .                     .    (blocking)  based on conf.
    .                     .                  |
  (below not executed)    .                  |> security-manager
    .                     .                  |  module selected
    .                     .                  |
    .                     .                  |
  [sec-manager.socket]<---------------------<| call security-manager
    .                     .  (DEADLOCK)      . on unix socket
    .                     .                  .

Solid line (|) means active thread of execution, dot (.) means
code not executed (blocked).

The root cause of the problem is that systemd calls external
API in blocking manner, which, due to system configuration, requires
systemd to handle its request for successful completion.
(systemd should start security-manager service via sec-manager.socket
 activation).

The exact place this situation is triggered is in dbus' initialization.

This commits works around this problem by delaying dbus.service readyness
notification - effectively - resolving the problem.

Situation becomes:

 systemd               dbus               nss                          security-manager
    |                     .                  .                           .
    |                     .                  .                           .
    1> reads config       .                  .                           .
    |                     .                  .                           .
    2> reg. nofification  .                  .                           .
    |  for dbus.service   .                  .                           .
    |                     .                  .                           .
    |                     .                  .                           .
    3> exec. services     .                  .                           .
    |    |                .                  .                           .
    |    (start srv...)   .                  .                           .
    |    |                .                  .                           .
    |    4>------------(exec)                .                           .
    |                     |                  .                           .
    |                     |                  .                           .
    |                     |                  .                           .
    |                     |                  .                           .
    |                     |                  .                           .
    |                     4a> read config    .                           .
    |                     |                  .                           .
    |                     4b> resolve user   .                           .
    |                     .   and groups     .                           .
    |                     .   initgroups()   .                           .
    |                     .    |             .                           .
    |                     .    \---------->select module                 .
    |                     .    (blocking)  based on conf.                .
    |                     .                  |                           .
    |                     .                  |> security-manager         .
    |                     .                  |  module selected          .
    |                     .                  |                           .
    |                     .                  |                           .
  [sec-manager.socket]<---------------------<| call security-manager     .
    .  |                  .                  . on unix socket            .
    .  |                  .                  .
    .  |> exec service ----------------------------------------------->(exec)
    .  |                  .                  .                           |
    <--|                  .                  |<-------------------------<| handle call
    |                     .                  |                           |
    |                     |<-----------------|                           |
    |                     |                  .                           |
    |                     |                  .                           |
    .\> call dbus.serv    |>finish conf. file.                           |
    .   handler           | parsing          .                           |
    .    |                |                  .                           |
    *-<---(notification)-<|> explicitly      .                           |
    .\   |                |  notify startup  .                           |
    . \> call dbus.serv   |  finished        .                           |
    |    handler          |                  .                           |
    .    |                |                  .                           |
    .    |> conn. to bus  |                  .                           |
    .    |                |                  .                           |
    .    |> call dbus     |                  .                           |
    .       \             |                  .                           |
    .        ------------>* dispatch loop    .                           |
    .         (blocking)  |                  .                           |
    .                     |                  .                           |
    |<--------------------< handle call      .                           |
    |                     |                  .                           |

Change-Id: Ifeaf299fc8653b583cd06ca9fd4f9f8045a2bde0

7 years agoChange the method to get DBUS addres when changing user with "su -" command. 16/115216/1
INSUN PYO [Fri, 17 Feb 2017 02:19:31 +0000 (11:19 +0900)]
Change the method to get DBUS addres when changing user with "su -" command.

The adbd's privilege has been changed form "System::Privileged" to "User::Shell".
So, pgrep does not work with smack errors when accessing /proc.
If it fails to find DBUS address, the fixed address is used.

Signed-off-by: INSUN PYO <insun.pyo@ubuntu1604.playinsun.pe.kr>
Change-Id: I4f9e0bc0939de2ecd7b866df8a2f266b4258338b
(cherry picked from commit 4f11f164f44d78ec6a54892e5d4095ca52e7117d)

7 years agotests: general fix for tests setup 52/115152/1
Adrian Szyndela [Thu, 16 Feb 2017 11:47:41 +0000 (12:47 +0100)]
tests: general fix for tests setup

Before this patch tests were installed into custom directory
  /usr/lib/dbus-tests/test-suites/dbus-tests
Originally, dbus wants its installed tests in
  /usr/lib/dbus/installed-tests/dbus
This path seems to be partially hardcoded in the configuration
files - it relies on defined datadir. As datadir is used
also for something else than tests, we don't want to change it.

This commit switches installation directory to the original,
and adds symbolic links in our custom directory.

Change-Id: Icf330ba3b5be59ee941d51b15a8f78a082297846

7 years agotests: generating coverage version of the library 27/114927/2
Adrian Szyndela [Mon, 6 Feb 2017 11:17:24 +0000 (12:17 +0100)]
tests: generating coverage version of the library

Additionally:
- immediate output of test results instead of caching and printing
  at the end;
- removed manual-authz test, because it is not meant to be run
  automatically.

Change-Id: I7354c21e0fa457ad7e2a4a53e1c898e5039b7f73

7 years agogbs incremental build support 73/112973/1
Konrad Lipinski [Fri, 3 Feb 2017 12:40:29 +0000 (13:40 +0100)]
gbs incremental build support

Change-Id: Ic1960a3b70df234a3e9ad141d6c335d373c331ec

7 years agoMerge tizen_3.0 into tizen 60/109760/1 accepted/tizen/common/20170201.171632 accepted/tizen/ivi/20170201.090245 accepted/tizen/mobile/20170201.090153 accepted/tizen/tv/20170201.090209 accepted/tizen/wearable/20170201.090229 submit/tizen/20170201.023443
Adrian Szyndela [Wed, 11 Jan 2017 11:54:07 +0000 (12:54 +0100)]
Merge tizen_3.0 into tizen

This merge commit adds integration tests.

Change-Id: I2b0ecb3c48fec72a6be1a7d6406b5580bbb38ec8

7 years agoModify from APACHE-2.0 to Apache-2.0 03/107403/1
Hyotaek Shim [Wed, 28 Dec 2016 01:53:31 +0000 (10:53 +0900)]
Modify from APACHE-2.0 to Apache-2.0

Change-Id: I2e509fe1a4f275c9f5b35290bdd2d218c4b3692a
(cherry picked from commit 4f9a3114261606c3edf84655b2e5752dee33585f)

7 years agoModify from APACHE-2.0 to Apache-2.0 01/107401/1 accepted/tizen_3.0.m2_mobile accepted/tizen_3.0.m2_tv accepted/tizen_3.0.m2_wearable tizen_3.0.m2 accepted/tizen/3.0.m2/mobile/20170105.023936 accepted/tizen/3.0.m2/tv/20170105.024027 accepted/tizen/3.0.m2/wearable/20170105.024524 accepted/tizen/3.0/common/20161229.112552 accepted/tizen/3.0/ivi/20161229.054231 accepted/tizen/3.0/mobile/20161229.054149 accepted/tizen/3.0/tv/20161229.054154 accepted/tizen/3.0/wearable/20161229.054210 submit/tizen_3.0.m2/20170104.093752 submit/tizen_3.0/20161228.020339
Hyotaek Shim [Wed, 28 Dec 2016 01:53:31 +0000 (10:53 +0900)]
Modify from APACHE-2.0 to Apache-2.0

Change-Id: I2e509fe1a4f275c9f5b35290bdd2d218c4b3692a

7 years agoAdd .spec description about LICENSE.APACHE2.0 98/107398/1
Hyotaek Shim [Wed, 28 Dec 2016 01:43:22 +0000 (10:43 +0900)]
Add .spec description about LICENSE.APACHE2.0

Change-Id: I127f90398b4fe33b3c3b412ef84a42ab2683efd5
(cherry picked from commit 44c73590bab90e63b21fadfffadbfa1d745d9613)