platform/core/system/sessiond.git
6 months agoservice: Set MemoryLimit to 20MB 51/300351/1 accepted/tizen_7.0_unified tizen_7.0 accepted/tizen/7.0/unified/20231025.025802
Unsung Lee [Mon, 23 Oct 2023 03:00:10 +0000 (12:00 +0900)]
service: Set MemoryLimit to 20MB

Change-Id: I2d7387f6d273e2d4628ca528c389e3840a695ffc
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
12 months agoMerge branch 'tizen' into tizen_7.0 92/291892/1 accepted/tizen/7.0/unified/20230426.045636
Karol Lewandowski [Mon, 24 Apr 2023 14:41:43 +0000 (16:41 +0200)]
Merge branch 'tizen' into tizen_7.0

Change-Id: I9dbac55e67b7b732c1ad436c0a0b859cc1b40aa9

12 months agolibsessiond: fix unchecked return value in `subsession_get_user_list` 85/291885/2
Adam Michalski [Mon, 12 Dec 2022 15:02:29 +0000 (16:02 +0100)]
libsessiond: fix unchecked return value in `subsession_get_user_list`

`getpwuid_r`s semantics is a bit tricky: normally it returns 0 and sets
the output parameter (struct passwd **result) accordingly. If no
matching password record was found, it returns 0 and `*result` is set
to NULL. In case of error, an error number is returned, but the
`*result` is also set to NULL. Since for the API client the reason does
not matter, not checking the return value from the `getpwuid_r` syscall
is not an issue (we're returning `SUBSESSION_ERROR_IO_ERROR` in both
cases). However, to satisfy static analysers we have, it's not
necessarily a bad idea to perform an explicit return value check.

Change-Id: Iefaeccd09331cff977b7cc2a449367de7d5c7db1
(cherry picked from commit f111fc670eee90e54ce2e395bb655c5935079d29)

12 months agosubsession-client-example: Move the call to bus unwatch to the callback 84/291884/1
Adam Michalski [Tue, 6 Dec 2022 12:27:18 +0000 (13:27 +0100)]
subsession-client-example: Move the call to bus unwatch to the callback

Change-Id: I8e54fa4aff6fb92ff0fe8e8f00f2c663cf73a93c
(cherry picked from commit da996b00efab7c63e94bbcf811c7d890f0d2c3d7)

12 months agoMerge "libsessiond: Add `sessiond_free_user_list()` API function" into tizen_7.0
Karol Lewandowski [Mon, 24 Apr 2023 11:24:27 +0000 (11:24 +0000)]
Merge "libsessiond: Add `sessiond_free_user_list()` API function" into tizen_7.0

12 months agolibsessiond: Add `sessiond_free_user_list()` API function 80/291880/1
Adam Michalski [Tue, 18 Apr 2023 13:51:34 +0000 (15:51 +0200)]
libsessiond: Add `sessiond_free_user_list()` API function

Even though it was explicitly stated that one needs to call free()
function after `subsession_get_user_list` to deallocate the user list
array, the addition of the above routine makes the libsessiond
interface more natural, since the API consumer does not need to
reach out to a lower layer (glibc) function.

Change-Id: I1897c05adf4cd1b759ef0bc7ecf25ef966ac5327
(cherry picked from commit 7c9c65b3344cae9177830c83b6ace8f70404f070)

12 months agolibsession: update doxygen API documentation 79/291879/1
Adam Michalski [Mon, 17 Apr 2023 15:02:22 +0000 (17:02 +0200)]
libsession: update doxygen API documentation

Provided doxgen API documentation wasn't complete and accurate:
not all possible error codes were listed as well as the description for
the `unregister_event_callback` API call was inaccurate.

Change-Id: Ib3da4e8f1ad6f50f9b14ac84f25b8d3b6b07c543
(cherry picked from commit 34911f815589051d1006480bd670b8dbfb5a933f)

12 months agolibsessiond: Add `sessiond_free_user_list()` API function 78/291578/2 accepted/tizen/unified/20230424.033542
Adam Michalski [Tue, 18 Apr 2023 13:51:34 +0000 (15:51 +0200)]
libsessiond: Add `sessiond_free_user_list()` API function

Even though it was explicitly stated that one needs to call free()
function after `subsession_get_user_list` to deallocate the user list
array, the addition of the above routine makes the libsessiond
interface more natural, since the API consumer does not need to
reach out to a lower layer (glibc) function.

Change-Id: I1897c05adf4cd1b759ef0bc7ecf25ef966ac5327

12 months agolibsession: update doxygen API documentation 00/291500/1
Adam Michalski [Mon, 17 Apr 2023 15:02:22 +0000 (17:02 +0200)]
libsession: update doxygen API documentation

Provided doxgen API documentation wasn't complete and accurate:
not all possible error codes were listed as well as the description for
the `unregister_event_callback` API call was inaccurate.

Change-Id: Ib3da4e8f1ad6f50f9b14ac84f25b8d3b6b07c543

13 months agoFix subsession switch user completion tests 16/290616/1
Adam Michalski [Tue, 21 Mar 2023 15:33:10 +0000 (16:33 +0100)]
Fix subsession switch user completion tests

Additionally, added more checks and logs.

Change-Id: I999ab1cfba81e73fdb0814a20a5f7ba9821aeffb
(cherry picked from commit 566abde05f647ae3070dca2d4ef8411ea1a7d58b)

13 months agoFix subsession switch user completion tests 20/290220/7 accepted/tizen/unified/20230329.013222
Adam Michalski [Tue, 21 Mar 2023 15:33:10 +0000 (16:33 +0100)]
Fix subsession switch user completion tests

Additionally, added more checks and logs.

Change-Id: I999ab1cfba81e73fdb0814a20a5f7ba9821aeffb

13 months ago[fix] sessiond: OnSwitchUser: `prev_subsession_id` being overwritten 25/290025/1
Adam Michalski [Thu, 16 Mar 2023 14:26:28 +0000 (15:26 +0100)]
[fix] sessiond: OnSwitchUser: `prev_subsession_id` being overwritten

Due to incorrect use of `std::string_view`, the value of
`prev_subsession_id` was overwritten by `next_subsession_id`.

Change-Id: Id198573cfae9cdc4f7e3edcc87f006801dfb8395
(cherry picked from commit 5cfe2d3bd559b6779383a56f2a48c33687ab1fb4)

13 months ago[fix] sessiond: OnSwitchUser: `prev_subsession_id` being overwritten 83/289983/1 accepted/tizen/unified/20230317.081025
Adam Michalski [Thu, 16 Mar 2023 14:26:28 +0000 (15:26 +0100)]
[fix] sessiond: OnSwitchUser: `prev_subsession_id` being overwritten

Due to incorrect use of `std::string_view`, the value of
`prev_subsession_id` was overwritten by `next_subsession_id`.

Change-Id: Id198573cfae9cdc4f7e3edcc87f006801dfb8395

15 months agolibsessiond: fix a memory leak in the `query_dir_via_readdir` routine 97/287697/1 accepted/tizen/7.0/unified/20230214.105915
Adam Michalski [Mon, 12 Dec 2022 13:57:35 +0000 (14:57 +0100)]
libsessiond: fix a memory leak in the `query_dir_via_readdir` routine

`subsession_get_user_list` has non-obvious semantics. When it is called
with the `user_list` parameter set to NULL, the caller is only
interested in the number of subsessions associated with the
`session_uid` user. In this case it is unnecessary and undesirable to
allocate memory for the user list, as it leads to a memory leak, since
we are not passing the pointer to the caller.

Change-Id: Iac30507f6e3ac826ac66254b9404edbf17d95230
(cherry picked from commit 67f5b16ce38ae6188d7c989b35b95f3ab4dc2b22)

15 months agosessiond: make subsession remove user operation atomic 17/287017/1 accepted/tizen/7.0/unified/20230120.182122
Adam Michalski [Mon, 9 Jan 2023 16:51:31 +0000 (17:51 +0100)]
sessiond: make subsession remove user operation atomic

Change-Id: I04d6d76062edf4e7de955a2f34cb40ee59ffc123
(cherry picked from commit c0b228d61f38db7ef66588fa5f2fa818fa54e976)

15 months agosessiond: make subsession remove user operation atomic 57/286557/3 accepted/tizen/unified/20230117.140453
Adam Michalski [Mon, 9 Jan 2023 16:51:31 +0000 (17:51 +0100)]
sessiond: make subsession remove user operation atomic

Change-Id: I04d6d76062edf4e7de955a2f34cb40ee59ffc123

16 months agoRelease 0.7.7.2 accepted/tizen/unified/20221219.024719
Michal Bloch [Tue, 13 Dec 2022 11:11:32 +0000 (12:11 +0100)]
Release 0.7.7.2

Hotfix a memory leak in the library.

Change-Id: I268d83c1f22fbb0c1b3d32000189a85788c8886d

16 months agoMerge "libsessiond: fix a memory leak in the `query_dir_via_readdir` routine" into...
Michal Bloch [Tue, 13 Dec 2022 10:30:57 +0000 (10:30 +0000)]
Merge "libsessiond: fix a memory leak in the `query_dir_via_readdir` routine" into tizen

16 months agolibsessiond: fix a memory leak in the `query_dir_via_readdir` routine 28/285428/2
Adam Michalski [Mon, 12 Dec 2022 13:57:35 +0000 (14:57 +0100)]
libsessiond: fix a memory leak in the `query_dir_via_readdir` routine

`subsession_get_user_list` has non-obvious semantics. When it is called
with the `user_list` parameter set to NULL, the caller is only
interested in the number of subsessions associated with the
`session_uid` user. In this case it is unnecessary and undesirable to
allocate memory for the user list, as it leads to a memory leak, since
we are not passing the pointer to the caller.

Change-Id: Iac30507f6e3ac826ac66254b9404edbf17d95230

16 months agolibsessiond: fix unchecked return value in `subsession_get_user_list` 29/285429/1
Adam Michalski [Mon, 12 Dec 2022 15:02:29 +0000 (16:02 +0100)]
libsessiond: fix unchecked return value in `subsession_get_user_list`

`getpwuid_r`s semantics is a bit tricky: normally it returns 0 and sets
the output parameter (struct passwd **result) accordingly. If no
matching password record was found, it returns 0 and `*result` is set
to NULL. In case of error, an error number is returned, but the
`*result` is also set to NULL. Since for the API client the reason does
not matter, not checking the return value from the `getpwuid_r` syscall
is not an issue (we're returning `SUBSESSION_ERROR_IO_ERROR` in both
cases). However, to satisfy static analysers we have, it's not
necessarily a bad idea to perform an explicit return value check.

Change-Id: Iefaeccd09331cff977b7cc2a449367de7d5c7db1

17 months agosubsession-client-example: Move the call to bus unwatch to the callback 26/285126/2
Adam Michalski [Tue, 6 Dec 2022 12:27:18 +0000 (13:27 +0100)]
subsession-client-example: Move the call to bus unwatch to the callback

Change-Id: I8e54fa4aff6fb92ff0fe8e8f00f2c663cf73a93c

17 months agoMerge branch 'tizen' into tizen_7.0 accepted/tizen/7.0/unified/20221207.014406 accepted/tizen/7.0/unified/20221212.015715
Karol Lewandowski [Mon, 5 Dec 2022 20:25:33 +0000 (21:25 +0100)]
Merge branch 'tizen' into tizen_7.0

Change-Id: I4b9c669418b4989cade6223aaf65ee248c1bbf05

17 months agoFixup: add missing sessiond-platform.h accepted/tizen/unified/20221209.014600
Karol Lewandowski [Mon, 5 Dec 2022 19:39:59 +0000 (20:39 +0100)]
Fixup: add missing sessiond-platform.h

Change-Id: I1d5117d6745d2ea14d8911703e2a782bb79f661c

17 months agoMerge branch 'tizen' into tizen_7.0
Karol Lewandowski [Mon, 5 Dec 2022 19:03:22 +0000 (20:03 +0100)]
Merge branch 'tizen' into tizen_7.0

Change-Id: Icf6ecbf6574b4f884ac7a5ae92d1ba6f0622a4ac

17 months agoRelease 0.7.7
Karol Lewandowski [Mon, 5 Dec 2022 19:02:20 +0000 (20:02 +0100)]
Release 0.7.7

Change-Id: I62e20d21f07227994e0dd8e8474fe4cb803e3fbf

17 months agoAdd the new callback function to catch `sessiond` ready state 55/284955/6
Adam Michalski [Thu, 1 Dec 2022 17:00:40 +0000 (18:00 +0100)]
Add the new callback function to catch `sessiond` ready state

Change-Id: I1d4357cfc5a3fadd6b66d1b2a8d5717a1520adc0

17 months agoMerge branch 'tizen' into tizen_7.0 51/284951/1 accepted/tizen/7.0/unified/20221202.171409
Adam Michalski [Thu, 1 Dec 2022 11:59:38 +0000 (12:59 +0100)]
Merge branch 'tizen' into tizen_7.0

Change-Id: Ibcfd2e453e64e480f77677f9e1c1f797c1c395f6

17 months agoMerge "Release 0.7.6" into tizen
Karol Lewandowski [Wed, 30 Nov 2022 15:23:17 +0000 (15:23 +0000)]
Merge "Release 0.7.6" into tizen

17 months agoMerge "Apply on-boot daemon activation" into tizen
Karol Lewandowski [Wed, 30 Nov 2022 15:23:11 +0000 (15:23 +0000)]
Merge "Apply on-boot daemon activation" into tizen

17 months agoRelease 0.7.6 11/284911/1 accepted/tizen/unified/20221202.015656
Adam Michalski [Wed, 30 Nov 2022 15:06:59 +0000 (16:06 +0100)]
Release 0.7.6

Change-Id: I478dee5fb9cd23e530151cfe205d3a139304f655

17 months agoMerge "Reimplement `subsession_get_user_list` by performing subsession directory...
Karol Lewandowski [Fri, 25 Nov 2022 12:45:52 +0000 (12:45 +0000)]
Merge "Reimplement `subsession_get_user_list` by performing subsession directory interrogation directly whenever possible" into tizen

17 months agoApply on-boot daemon activation 66/284766/2
Adam Michalski [Fri, 25 Nov 2022 10:50:00 +0000 (11:50 +0100)]
Apply on-boot daemon activation

Change-Id: I754eaf42b55bbb4ee8d51f99a06694989fad7d8b

17 months agoReimplement `subsession_get_user_list` by performing subsession 03/284403/13
Adam Michalski [Wed, 16 Nov 2022 16:50:07 +0000 (17:50 +0100)]
Reimplement `subsession_get_user_list` by performing subsession
directory interrogation directly whenever possible

Co-author: Michal Bloch <m.bloch@samsung.com>

Change-Id: I6b02fcf590f75fdb8f60db0a328d3ff5409f10cb

17 months ago[fix] Ensure proper permissions are set for subsession app directories 67/284267/4 accepted/tizen/unified/20221128.165601
Adam Michalski [Mon, 14 Nov 2022 16:22:49 +0000 (17:22 +0100)]
[fix] Ensure proper permissions are set for subsession app directories

First-level `apps_rw` subdirectories' permissions should be directly
copied from the corresponding `/etc/skel/apps_rw/*` subdirectories.

Change-Id: I2fe12c5350feece8c1264b2f4c92ef7509c81845

17 months agoRelease 0.7.5 03/284103/3
Michal Bloch [Wed, 9 Nov 2022 18:55:10 +0000 (18:55 +0000)]
Release 0.7.5

Change-Id: I2314f936c4fa256eec9226f2c5afbc36c3ab0d4d

17 months agoTailor the integration tests to account for changes in granting 02/284102/2
Adam Michalski [Wed, 9 Nov 2022 17:45:07 +0000 (18:45 +0100)]
Tailor the integration tests to account for changes in granting
permissions to subsession app subdirectories

Change-Id: I567b0c211573170de6839fbb044d0eadc3ec2995

17 months agoEnsure proper permissions and owner/group are set for copied 45/283945/6
Adam Michalski [Mon, 7 Nov 2022 16:17:04 +0000 (17:17 +0100)]
Ensure proper permissions and owner/group are set for copied
directories

Change-Id: I6d544e9acb70cc64dd368f954b666a11578c6709

17 months agoFix soname 95/284095/1 sandbox/klewandowski/tizen_7.0
Mateusz Majewski [Wed, 9 Nov 2022 12:36:37 +0000 (13:36 +0100)]
Fix soname

Change-Id: I99c79253b6cde0ed62effe7680d3fec49740b6bb
(cherry picked from commit 0d432d8236a19f8b2e4efef47837b27deff886d7)

17 months agoFix soname 91/284091/1
Mateusz Majewski [Wed, 9 Nov 2022 12:36:37 +0000 (13:36 +0100)]
Fix soname

Change-Id: I99c79253b6cde0ed62effe7680d3fec49740b6bb

18 months agoRelease 0.7.4 45/283545/1 accepted/tizen/unified/20221102.172730
Adam Michalski [Fri, 28 Oct 2022 09:35:43 +0000 (11:35 +0200)]
Release 0.7.4

Change-Id: I298f2b47ad2d5ee357eb61bb1f6e4c0542bb3211

18 months agoMerge "Improve sessiond integration tests" into tizen
Karol Lewandowski [Fri, 28 Oct 2022 09:25:13 +0000 (09:25 +0000)]
Merge "Improve sessiond integration tests" into tizen

18 months agoMerge "Document transmutation inconsistency" into tizen
Karol Lewandowski [Fri, 28 Oct 2022 09:25:06 +0000 (09:25 +0000)]
Merge "Document transmutation inconsistency" into tizen

18 months agoImprove sessiond integration tests 93/283493/1
Adam Michalski [Thu, 27 Oct 2022 14:41:10 +0000 (16:41 +0200)]
Improve sessiond integration tests

This commit:
* fixes permision check error that incorrectly assumed `owner` as
  the only user that can create a subsession
* adds more verbose messages when comparing files, so that it's
  much easier to identify the file reponsible for the error
* adds proper subsessions clean-up when something goes wrong in
  the middle of the test
* removes an unused global variable.

Change-Id: I5fbdd965e367442d9bce85e065d7e1bb0c475341

18 months agoFix symlink permission handling 82/283382/3
Michal Bloch [Tue, 25 Oct 2022 10:58:43 +0000 (12:58 +0200)]
Fix symlink permission handling

Change-Id: Ibb7e3af28c576dfb262efea2d734551132e5d3a4
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
18 months agoWork-around a sub session creation issue 38/283338/1
Michal Bloch [Mon, 24 Oct 2022 15:47:14 +0000 (17:47 +0200)]
Work-around a sub session creation issue

Seems to be a libsmack issue at a glance.

Change-Id: I10dfc7e3cbc83450d730eaf4d008ac33e9b50a4b
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
18 months agoDocument transmutation inconsistency 37/283337/1
Michal Bloch [Mon, 24 Oct 2022 14:22:37 +0000 (16:22 +0200)]
Document transmutation inconsistency

Change-Id: Ida2f349ce97ca4aee7e1504f73c2fe358294b622
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
19 months agoAdd unit tests to SAM exclude list 55/281655/1 accepted/tizen_7.0_unified_hotfix tizen_7.0_hotfix accepted/tizen/7.0/unified/20221110.062943 accepted/tizen/7.0/unified/hotfix/20221116.105800 accepted/tizen/unified/20220922.062110 accepted/tizen/unified/20220922.062734 tizen_7.0_m2_release
Karol Lewandowski [Tue, 20 Sep 2022 08:44:15 +0000 (10:44 +0200)]
Add unit tests to SAM exclude list

Change-Id: I0f417c89ffa0af2b5dfa882a68c75d6ad3c1cb48

19 months agolibrary: fix a memory leak in the `method_call_sync` routine 46/281146/1 accepted/tizen/unified/20220915.015341 accepted/tizen/unified/20220915.023904 accepted/tizen/unified/20220915.025944 submit/tizen/20220913.195454
Adam Michalski [Tue, 13 Sep 2022 11:36:41 +0000 (13:36 +0200)]
library: fix a memory leak in the `method_call_sync` routine

Change-Id: I2d4ae28c363996faf859cc33635bc6c777ef2442

19 months agoRelease 0.7.3 82/281082/2 accepted/tizen/unified/20220914.164043
Karol Lewandowski [Fri, 9 Sep 2022 09:00:48 +0000 (11:00 +0200)]
Release 0.7.3

Change-Id: I2eb57e6c64f0307542a1fe0271ca83ed1c4f1031

19 months agoAdd comparing file/directory permissions in integration tests 98/281098/1
Adam Michalski [Fri, 9 Sep 2022 10:38:07 +0000 (12:38 +0200)]
Add comparing file/directory permissions in integration tests

Change-Id: I27f1e680b6dda5234300795aa413904e124a18b6

19 months agosessiond: Ensure proper permissions are set for subsession user app dirs 97/281097/2
Adam Michalski [Fri, 9 Sep 2022 10:07:35 +0000 (12:07 +0200)]
sessiond: Ensure proper permissions are set for subsession user app dirs
as well as the main `apps_rw` directory

Change-Id: Iab41dcace38d1dcc346bf9bfde12ede1503ce359

19 months agoDrop -fconcepts from C flags as these are supported for C++ only 81/281081/1
Karol Lewandowski [Fri, 9 Sep 2022 09:01:51 +0000 (11:01 +0200)]
Drop -fconcepts from C flags as these are supported for C++ only

Change-Id: Ie1956bd1c890c6fb7402e74bd07dff7770296ba0

19 months agolibrary: Add coment about unsupported parameters to subsession_event_wait_done()... 80/281080/1
Karol Lewandowski [Fri, 9 Sep 2022 08:53:08 +0000 (10:53 +0200)]
library: Add coment about unsupported parameters to subsession_event_wait_done() function

Change-Id: Ia0aa98e8c02c89a405a649dabc40cb6fa5280e73

19 months agoModify sessiond integration tests to conform to the changes in setting 12/281012/3
Adam Michalski [Wed, 7 Sep 2022 15:18:04 +0000 (17:18 +0200)]
Modify sessiond integration tests to conform to the changes in setting
ownership of user app subdirectories

Change-Id: Ic7b33dc1783421288007f6d57a30173aff6b86d1

19 months agosessiond: Add privacy to the `fs_helpers` module 13/281013/2
Adam Michalski [Wed, 7 Sep 2022 16:08:39 +0000 (18:08 +0200)]
sessiond: Add privacy to the `fs_helpers` module

Change-Id: Iebce977b981135a85bd22d61cddd016d39376aa4

20 months agosessiond: Ensure proper ownership is set for subsession user app dirs 11/281011/1
Adam Michalski [Wed, 7 Sep 2022 14:32:53 +0000 (16:32 +0200)]
sessiond: Ensure proper ownership is set for subsession user app dirs

Previously, all [SUBSESSION USER/apps_rw/*] subdirectories had their
UID:GID hardcoded as [subsession_uid]:`users`. Since some of the Tizen
app subdirectories have the group set to `system_share`, the correct
way is to copy the ownership from the corresponding
`/home/SUBSESSION USER/apps_rw/[some.app]/*` subdirectories.

Change-Id: Ie24d55179b8c2216dc57dd35b27a14a449c84642

20 months agosessiond: Drop fs_helpers namespace 27/280827/1
Karol Lewandowski [Mon, 5 Sep 2022 11:33:54 +0000 (13:33 +0200)]
sessiond: Drop fs_helpers namespace

This is small project, probably code could be moved to sessiond namespace evetually.

Currently no other file uses sparate namespace (wait manager, hash, globals)
so dropping it from fs_helpers should make code a bit more consistent.

Change-Id: I5d5786f55e844abaf13e1d73358d0d980611f0fc

20 months agosessiond: rename the header file from `fs_helpers.h` to 92/280792/1
Adam Michalski [Mon, 5 Sep 2022 07:22:29 +0000 (09:22 +0200)]
sessiond: rename the header file from `fs_helpers.h` to
`fs_helpers.hpp` for consistency with naming convention
used throughout the project.

Change-Id: If2e6a490b01788a81894f517b0300a26c41a2918

20 months agoRelease 0.7.2 28/280728/2 accepted/tizen/unified/20220904.214043 submit/tizen/20220902.153259
Karol Lewandowski [Fri, 2 Sep 2022 11:59:44 +0000 (13:59 +0200)]
Release 0.7.2

Change-Id: Iddc79db71513e293b26a0473404cbf0a6468135b

20 months agoMove all sources below src/ 27/280727/2
Karol Lewandowski [Fri, 2 Sep 2022 11:51:30 +0000 (13:51 +0200)]
Move all sources below src/

Change-Id: I10a75ffe378790a7f7605c3b6aea2818ef7f2e29

20 months agoMove all tests under single directory hierarchy 24/280724/3
Karol Lewandowski [Fri, 2 Sep 2022 10:28:53 +0000 (12:28 +0200)]
Move all tests under single directory hierarchy

This commit:
 - moves api tests to tests/api_tests,
 - moves integration tests under tests/integration and adds it into tests package
 - moves client example application under test/client_example
 - drops no-op sessiond tests (test template)
 - drops unused infrastructure for runnnig tests at build time

Change-Id: I6047f66c358b089710c30709454f7afa891bd10b

20 months agoAdd sessiond test suite 43/280243/4
Adam Michalski [Thu, 25 Aug 2022 14:41:06 +0000 (16:41 +0200)]
Add sessiond test suite

Change-Id: I503e27b76dec485b132f6f9f85bf9e7f673d1121

20 months agoMerge "Make sessiond more fail-resistant" into tizen
Karol Lewandowski [Thu, 1 Sep 2022 14:11:33 +0000 (14:11 +0000)]
Merge "Make sessiond more fail-resistant" into tizen

20 months ago[fix] sessiond: Correct handling of the TRANSMUTE attribute 75/280475/6
Adam Michalski [Tue, 30 Aug 2022 12:39:13 +0000 (14:39 +0200)]
[fix] sessiond: Correct handling of the TRANSMUTE attribute

Due to its different nature (being inheritable) it wasn't handled
properly in some cases (e.g., for subdirectories that had it set
to false whose parent was set to true).

Also significantly simplified the logic by adding a helper function
and refactoring the `copy_smack_attributes` routine.

Change-Id: I3ee146056682e2380932fdd9052efe25e5d7f735
Co-author: Michal Bloch <m.bloch@samsung.com>

20 months agoMake sessiond more fail-resistant 76/280476/1
Adam Michalski [Tue, 30 Aug 2022 14:46:47 +0000 (16:46 +0200)]
Make sessiond more fail-resistant

Change-Id: I5e7c95564960523d5d6ffea4d2d24ed94a82d0dd

20 months agoChange subsession API argument name (from cb_data to user_data) 86/279986/1 accepted/tizen/unified/20220824.135645 submit/tizen/20220822.111221
Hyotaek Shim [Mon, 22 Aug 2022 04:42:09 +0000 (13:42 +0900)]
Change subsession API argument name (from cb_data to user_data)

Change-Id: I58969118f4a0412ef781d1c277ca222e70b02723
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
20 months agoMerge "library: Simplify subsession_event_wait_done() error path" into tizen
Karol Lewandowski [Fri, 19 Aug 2022 16:17:56 +0000 (16:17 +0000)]
Merge "library: Simplify subsession_event_wait_done() error path" into tizen

20 months ago[fix] sessiond: do not follow symlinks while setting SMACK attributes 53/279853/3 accepted/tizen/unified/20220821.211106 submit/tizen/20220818.125806
Adam Michalski [Thu, 18 Aug 2022 09:21:54 +0000 (11:21 +0200)]
[fix] sessiond: do not follow symlinks while setting SMACK attributes
of the copied files

Change-Id: Ia775dc9af277a333dbd5e75ee8e4ba2eebe88098

20 months agoRelease 0.7.0 80/279780/1 submit/tizen/20220817.154056
Karol Lewandowski [Wed, 17 Aug 2022 15:37:44 +0000 (17:37 +0200)]
Release 0.7.0

Change-Id: Ie35da62d64e3f985060fa0a03641864dd942417c

20 months agoMerge "Log using DLog and not on stdout in sessiond" into tizen
Karol Lewandowski [Wed, 17 Aug 2022 10:36:50 +0000 (10:36 +0000)]
Merge "Log using DLog and not on stdout in sessiond" into tizen

20 months ago[fix] sessiond: do not follow symlinks while setting the owner/group 69/279769/1
Adam Michalski [Wed, 17 Aug 2022 09:12:23 +0000 (11:12 +0200)]
[fix] sessiond: do not follow symlinks while setting the owner/group
of the copied files

Change-Id: I64aec17972aa916d471b16684a00a073c30a2016

20 months agoLog using DLog and not on stdout in sessiond 52/279752/1
Mateusz Majewski [Wed, 17 Aug 2022 07:08:43 +0000 (09:08 +0200)]
Log using DLog and not on stdout in sessiond

Change-Id: Id9db6b275da9964c221bcf54d36fe717deecd29f

20 months agoRevert "Temporarily allow all dbus policy by default" 84/279584/2
Hyotaek Shim [Fri, 12 Aug 2022 02:36:20 +0000 (02:36 +0000)]
Revert "Temporarily allow all dbus policy by default"

This reverts commit 82d39e1f34062fa443103bc1f2980bd54e295cf2.

Change-Id: I85c6780dcbe1ec4a4fd3a49e48f4d69870bb7ddd

21 months agolibrary: Simplify subsession_event_wait_done() error path 99/279399/1
Karol Lewandowski [Sat, 6 Aug 2022 20:29:40 +0000 (22:29 +0200)]
library: Simplify subsession_event_wait_done() error path

Change-Id: Ic701196aa0501a5adb3a1c8742609f82ded69909

21 months agolibrary: Automatically free GError* in method_call_sync() 44/279344/1
Karol Lewandowski [Sat, 6 Aug 2022 13:20:33 +0000 (15:20 +0200)]
library: Automatically free GError* in method_call_sync()

Change-Id: Iddb19ec2556106e2ac1f5052dd4512dbff43194d

21 months agolibrary: Use same terms in error mapping functions (in both directions) 43/279343/1
Karol Lewandowski [Sat, 6 Aug 2022 13:15:13 +0000 (15:15 +0200)]
library: Use same terms in error mapping functions (in both directions)

Change-Id: I7f6e2a12a42848feabb49a34fd64633a747a7265

21 months agolibrary: Drop dead code in subsession_get_current_user() 42/279342/1
Karol Lewandowski [Sat, 6 Aug 2022 13:00:30 +0000 (15:00 +0200)]
library: Drop dead code in subsession_get_current_user()

We don't need to explicitly check type of returned gvariant
as this will be handled by g_dbus_method_call_sync() (as invoked
via method_call_sync()).

Change-Id: I5327b670ec002f3be00e8fe40e8ba20314ccf3fe

21 months agolibrary: Drop unused macros 41/279341/1
Karol Lewandowski [Sat, 6 Aug 2022 12:48:23 +0000 (14:48 +0200)]
library: Drop unused macros

Change-Id: I13314d9bd04f88ef89e7ed159456897a7d38378b

21 months agoRelease 0.6.0 67/279267/1 accepted/tizen/unified/20220808.135312 submit/tizen/20220805.114215
Karol Lewandowski [Thu, 4 Aug 2022 22:07:18 +0000 (00:07 +0200)]
Release 0.6.0

Change-Id: I52110e67708b97fa35c443d736d0edcecc27b9d5

21 months agolibrary: Rework comparators 41/279141/3
Karol Lewandowski [Tue, 2 Aug 2022 12:04:32 +0000 (14:04 +0200)]
library: Rework comparators

- use assert() if our internally added data is of correct type (if it's not, it's an
  programming error)
- use explicit typechecked_g_variant_get()

Change-Id: Iad18df2f323b0d9f71edec52dbf46cebe9752a2d

21 months agolibrary: Be more verbose in error messages when invalid signals are received 40/279140/3
Karol Lewandowski [Tue, 2 Aug 2022 11:54:59 +0000 (13:54 +0200)]
library: Be more verbose in error messages when invalid signals are received

Change-Id: Ibdf14033919604569182d587f3bdb99c73725ff0

21 months agolibrary: Use generic method_call() in get_current_user() API 39/279139/3
Karol Lewandowski [Mon, 1 Aug 2022 23:27:42 +0000 (01:27 +0200)]
library: Use generic method_call() in get_current_user() API

Change-Id: I6973fc7f414edb65251c8c6f90cb1d06f1a98525

21 months agolibrary: Add macro to validate and get gvariant without explicit 'return' 37/279137/3
Karol Lewandowski [Tue, 2 Aug 2022 11:11:01 +0000 (13:11 +0200)]
library: Add macro to validate and get gvariant without explicit 'return'

This allows more flexible handling of type errors, without creating
new macro for each new case.

Change-Id: I6ea3311ed24da9021e6a2b65eab31cea894ae0c0

21 months agolibrary: Replace dynamic error checking with asserts in unregister() 36/279136/3
Karol Lewandowski [Mon, 1 Aug 2022 23:07:49 +0000 (01:07 +0200)]
library: Replace dynamic error checking with asserts in unregister()

It's programming error to pass NULL callbacks_data - catch it early
with assert.

Change-Id: Id6ed5861c2a5ce38e0e148e9cf177170a1661d4f

21 months agolibrary: fix: ensure dbus connection is avaliable in unregister_event_callback 35/279135/3
Karol Lewandowski [Mon, 1 Aug 2022 23:01:02 +0000 (01:01 +0200)]
library: fix: ensure dbus connection is avaliable in unregister_event_callback

Normally this function is called only after register function is called,
which checks if dbus is available.  As it's public api we must not make
assumption this behaviour is followed in real code.

Change-Id: I41b95bb746d954b6af66e31a0c9735d7f21e88b2

21 months agoUnduplicate code 59/279259/1 accepted/tizen/unified/20220805.131908 submit/tizen/20220804.142848
Michal Bloch [Thu, 4 Aug 2022 14:43:19 +0000 (16:43 +0200)]
Unduplicate code

Change-Id: Ic52222eb6157a5507689a3a91f6103d13de5ca02
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
21 months agoCreate `apps_rw/*` subdirectories and files with [subsession_uid]:users UID:GID 57/279257/1
Adam Michalski [Thu, 4 Aug 2022 13:34:51 +0000 (15:34 +0200)]
Create `apps_rw/*` subdirectories and files with [subsession_uid]:users UID:GID

Change-Id: I53045101838b12b983e3cb46055614dccf3ccc6f

21 months agoRelease 0.5.0 32/279032/1 accepted/tizen/unified/20220802.144808 submit/tizen/20220729.133354 submit/tizen/20220801.061355
Karol Lewandowski [Fri, 29 Jul 2022 13:29:53 +0000 (15:29 +0200)]
Release 0.5.0

Bump version due to behaviour change - from now on subsession
user and it's apps_rw directory is created with <session_uid>:system_share
UID:GID.

Change-Id: Ic26a8050769da3a3e48ac574171b528bfce195ca

21 months agoMerge "Create subsession and `apps_rw` directories with [subsession_uid]:system_share...
Karol Lewandowski [Fri, 29 Jul 2022 13:29:05 +0000 (13:29 +0000)]
Merge "Create subsession and `apps_rw` directories with [subsession_uid]:system_share UID:GID" into tizen

21 months agoCreate subsession and `apps_rw` directories with 16/279016/1
Adam Michalski [Fri, 29 Jul 2022 10:48:43 +0000 (12:48 +0200)]
Create subsession and `apps_rw` directories with
[subsession_uid]:system_share UID:GID

Change-Id: Ib1f8d18d715ba6ff52c97cfe78c56d00ae2e9d37

21 months agolibrary: Rename async method call to follow method_call_<sync/async> convention 48/278948/1
Karol Lewandowski [Tue, 26 Jul 2022 23:15:20 +0000 (01:15 +0200)]
library: Rename async method call to follow method_call_<sync/async> convention

Additional style fixes along the way.

Change-Id: I6eb43013019a0a701cc191ff25e1dd0463526124

21 months agolibrary: Ensure map_dbus_call_error_to_return_value handles NULL 47/278947/1
Karol Lewandowski [Thu, 28 Jul 2022 10:26:43 +0000 (12:26 +0200)]
library: Ensure map_dbus_call_error_to_return_value handles NULL

Allowing the funcion to accept NULL GError* will allow to simplify
code in other places.

Change-Id: I13e172907651da119d13119a8d07c4c7906489ee

21 months agolibrary: Move all of dbus signal subscription logic to register_event_callback 49/278749/3
Karol Lewandowski [Tue, 26 Jul 2022 22:47:31 +0000 (00:47 +0200)]
library: Move all of dbus signal subscription logic to register_event_callback

Change-Id: I2fa04d1095569e709adbbce6e297a68f6668fb94

21 months agolibrary: Merge dbus sync call helpers 48/278748/2
Karol Lewandowski [Mon, 25 Jul 2022 22:21:55 +0000 (00:21 +0200)]
library: Merge dbus sync call helpers

This commit merges method_call_no_signal() and method_call_no_signal_return()
functions into one, as the only difference between these was that returned
variant was passed to caller or not._

Change-Id: Idedac845a6b9690cade29f54dc9fbc372e7a8642

21 months agoRelease 0.4.4 04/278604/1 accepted/tizen/unified/20220726.012139 submit/tizen/20220722.101755
Karol Lewandowski [Fri, 22 Jul 2022 08:12:16 +0000 (10:12 +0200)]
Release 0.4.4

Change-Id: Ic647ec27f5f86cad2e066aeef21dc81d2468c1aa

21 months agolibrary: Rework client_data_cleansweep_mt 03/278603/1
Karol Lewandowski [Fri, 22 Jul 2022 08:10:20 +0000 (10:10 +0200)]
library: Rework client_data_cleansweep_mt

This commit:
 - renames function to callbacks_data_remove_client_data as it operates on callbacks_data list
 - changes order of function paramters to follow convention used by callbacks_data_* functions
 - adds asserts to ensure parameters are always valid

Change-Id: I0671a6a6bea783224a0bbe966bea08b4c0ec5d03

21 months agoMerge "sessiond: Re-shuffle include files to get rid of a nasty "unused variable...
Karol Lewandowski [Thu, 21 Jul 2022 21:42:55 +0000 (21:42 +0000)]
Merge "sessiond: Re-shuffle include files to get rid of a nasty "unused variable" warning" into tizen

21 months agolibrary: simplify logic in callback_data functions 41/278541/2
Michal Bloch [Thu, 21 Jul 2022 20:55:56 +0000 (22:55 +0200)]
library: simplify logic in callback_data functions

Change-Id: I6f707a201780012a3c138fca85f7a0d0b9f9a26c

21 months agolibrary: make callback functions follow subject-action convention 63/278363/5
Michal Bloch [Thu, 21 Jul 2022 20:55:43 +0000 (22:55 +0200)]
library: make callback functions follow subject-action convention

This commit renames the following functions:
 - take_from_callbacks_data_and_remove_from_list -> callbacks_data_pop
 - find_in_callbacks_data                        -> callbacks_data_find
 - subsession_register_event_in_list             -> callbacks_data_push

Change-Id: Iae4ec775a7626e45667452ff52dd2b19dc2dd6c8

21 months agoMerge "clientExample: proper clean-up in case of subsession errors" into tizen
Karol Lewandowski [Thu, 21 Jul 2022 21:20:20 +0000 (21:20 +0000)]
Merge "clientExample: proper clean-up in case of subsession errors" into tizen