platform/core/system/sessiond.git
21 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

21 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

21 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

21 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

21 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

21 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

21 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

21 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

21 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

21 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

21 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

21 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

21 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>

21 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

21 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>
21 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

21 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

21 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

21 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

21 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

21 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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>
22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 months agoclientExample: proper clean-up in case of subsession errors 95/277895/21
Adam Michalski [Thu, 14 Jul 2022 14:59:05 +0000 (16:59 +0200)]
clientExample: proper clean-up in case of subsession errors

Change-Id: I57682b4e7b4649af55435c70186a0a97956e10bf

22 months agosessiond: Re-shuffle include files to get rid of a nasty 13/278513/1
Adam Michalski [Thu, 21 Jul 2022 10:07:19 +0000 (12:07 +0200)]
sessiond: Re-shuffle include files to get rid of a nasty
"unused variable" warning

Change-Id: If0e3530c45e236cee1e1fe11a155a07099a0c498

22 months agolibrary: Shorten client callback data allocation function name 62/278362/3
Karol Lewandowski [Tue, 19 Jul 2022 21:06:05 +0000 (23:06 +0200)]
library: Shorten client callback data allocation function name

Change-Id: If8ea696acad3ea8b8c4bd230e44bd908352c8370

22 months agolibrary: Simplify comparators 96/277896/5
Karol Lewandowski [Thu, 14 Jul 2022 21:48:14 +0000 (23:48 +0200)]
library: Simplify comparators

Change-Id: Ie4af052e02f5190dae542bbcc34daa495101430b

22 months agolibrary: Drop registered_signal_t 61/278361/3
Karol Lewandowski [Tue, 19 Jul 2022 20:56:20 +0000 (22:56 +0200)]
library: Drop registered_signal_t

Change-Id: I07b7717b1e197201d10ebe25dd502d1c275903a7

22 months agolibrary: Do not initialize callbacks list with placeholder element 60/278360/3
Karol Lewandowski [Tue, 19 Jul 2022 20:35:35 +0000 (22:35 +0200)]
library: Do not initialize callbacks list with placeholder element

This does not seem to be needed.

Change-Id: I44196b316411673b19099aad528d20f98ad72136

22 months agoremoved unecessary NULL case 47/278447/2
Arkadiusz Nowak [Wed, 20 Jul 2022 11:44:47 +0000 (13:44 +0200)]
removed unecessary NULL case

Change-Id: I8ebbb85f323bb68c8a7efb703505d647540f0ee6

22 months agolibrary: Add missing const to src user 59/278359/2
Karol Lewandowski [Tue, 19 Jul 2022 20:39:55 +0000 (22:39 +0200)]
library: Add missing const to src user

Change-Id: I92f2f615cd10ef164d70ca17456989894f601455

22 months agoTemporarily allow all dbus policy by default 72/278372/1 accepted/tizen/unified/20220720.141517 submit/tizen/20220720.014058 submit/tizen/20220720.052140
Hyotaek Shim [Wed, 20 Jul 2022 01:40:23 +0000 (10:40 +0900)]
Temporarily allow all dbus policy by default

Change-Id: I23047031697072967a49d49fed0114a721b150a1
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
22 months agoRevert "Temporarily allow dbus policy by default" 71/278371/2
Hyotaek Shim [Wed, 20 Jul 2022 01:38:43 +0000 (01:38 +0000)]
Revert "Temporarily allow dbus policy by default"

This reverts commit 330e4429171a18f5f28e49c915c507572deff539.

Change-Id: I945e28a1d37b419d5a32425b79ffd999f08de9c6

22 months agoMerge "library: Ensure subsession_user_t does not contain garbage" into tizen
Karol Lewandowski [Tue, 19 Jul 2022 21:34:28 +0000 (21:34 +0000)]
Merge "library: Ensure subsession_user_t does not contain garbage" into tizen

22 months agoUser len 19 and len 20 tests 83/278283/3
Arkadiusz Nowak [Mon, 18 Jul 2022 07:15:40 +0000 (09:15 +0200)]
User len 19 and len 20 tests

Change-Id: Ibf7710a0248fdd0dfcafa885a1b6d9687fcce6b3

22 months agoTemporarily allow dbus policy by default 16/278316/1 submit/tizen/20220719.043933
Hyotaek Shim [Tue, 19 Jul 2022 04:38:45 +0000 (13:38 +0900)]
Temporarily allow dbus policy by default

Change-Id: Iae10d6d10904c4195e100b8631631cffebba3edf
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
22 months agoAdd a note to the sessiond.h header on the "" subsession 93/278293/1 accepted/tizen/unified/20220720.064039 submit/tizen/20220719.015501
Mateusz Majewski [Mon, 18 Jul 2022 11:37:52 +0000 (13:37 +0200)]
Add a note to the sessiond.h header on the "" subsession

Change-Id: Id6ddafd8f017ede6423b20539f0c4d0c341570ba

22 months agolibrary: Ensure subsession_user_t does not contain garbage 85/277985/2
Karol Lewandowski [Fri, 15 Jul 2022 15:16:44 +0000 (17:16 +0200)]
library: Ensure subsession_user_t does not contain garbage

Change-Id: I06fa8c004af2873a3a2926b5bde4fc62043d8f62

22 months agolibrary: Fix subsession_user_copy() 84/277984/1 accepted/tizen/unified/20220719.014548 submit/tizen/20220715.154248 submit/tizen/20220718.045828 submit/tizen/20220718.115742
Karol Lewandowski [Fri, 15 Jul 2022 15:04:08 +0000 (17:04 +0200)]
library: Fix subsession_user_copy()

This commit fixes strlen() to be invoked on source string, not
destination.

Change-Id: I9eeef27e6c713134ddfedf79e66a3f28dafb7f1d

22 months agoRelease 0.4.2 81/277981/1 submit/tizen/20220715.132635
Karol Lewandowski [Fri, 15 Jul 2022 13:00:15 +0000 (15:00 +0200)]
Release 0.4.2

Change-Id: Ifaaaede75993b827da12b55e0edaaa36ce7d70e0

22 months agolibrary: Use assert() to catch programming errors in make_new_signal_callback_client_... 92/277892/4
Karol Lewandowski [Thu, 14 Jul 2022 09:15:47 +0000 (11:15 +0200)]
library: Use assert() to catch programming errors in make_new_signal_callback_client_data()

Change-Id: I9c0b718cab9a010b8094a079e52844b2d03f0619

22 months agolibrary: Unify signal handlers 94/277894/4
Karol Lewandowski [Thu, 14 Jul 2022 10:24:59 +0000 (12:24 +0200)]
library: Unify signal handlers

This commit drops quite a lot of repetition by moving switch
and add+remove handlers common parts to separate functions.

Change-Id: I80fc2d3ab6d7990e2633b2a3660ff3ba527ea558

22 months agolibrary: Drop cb_data_ 93/277893/4
Karol Lewandowski [Thu, 14 Jul 2022 09:19:12 +0000 (11:19 +0200)]
library: Drop cb_data_

We really don't need it as repetition is negligible.  More imporantly, using explicit
paramaters (cb, cb_data) is far more readable than looking for yet another macro def.

Change-Id: Ibb0c3a3723deec76b4fa615546343393e6b82920

22 months agoAdd static where appropriate 55/277955/2
Mateusz Majewski [Fri, 15 Jul 2022 08:16:30 +0000 (10:16 +0200)]
Add static where appropriate

Change-Id: Ic3027ddecbbefd4696ddf0636407c5d4f7a2ae17

22 months agoDrop dbus_signal_subscribed 54/277954/2
Mateusz Majewski [Fri, 15 Jul 2022 08:16:08 +0000 (10:16 +0200)]
Drop dbus_signal_subscribed

... as it is unused.

Change-Id: I9724221dac88448a48ff19d98f561269e620d93e

22 months agoRemoved unused lists 51/277951/2
Arkadiusz Nowak [Fri, 15 Jul 2022 07:42:53 +0000 (09:42 +0200)]
Removed unused lists

Change-Id: I280f0852aa544d136ea8c0d8b8456ad6807e9bf3

22 months agoFix some leakage in the library 19/277819/1
Michal Bloch [Wed, 13 Jul 2022 18:50:37 +0000 (20:50 +0200)]
Fix some leakage in the library

Change-Id: I678dbb9dde715c473aa432d43d29f87e18b494d1
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
22 months agoRelease 0.4.1 02/277802/2 accepted/tizen/unified/20220715.141346 submit/tizen/20220713.133213
Karol Lewandowski [Wed, 13 Jul 2022 13:02:59 +0000 (15:02 +0200)]
Release 0.4.1

Change-Id: I9f2e8ca7595cdf3214e99837074110eedfa57a37

22 months agoCorrection in test description 72/277772/3
Arkadiusz Nowak [Wed, 13 Jul 2022 06:16:28 +0000 (08:16 +0200)]
Correction in test description

Change-Id: I557a780c119530ed9680377bc82dd8bdb4293ab9

22 months agolib: get_current_user: Avoid off-by-one while copying user name 48/277748/7
Karol Lewandowski [Tue, 12 Jul 2022 22:19:52 +0000 (00:19 +0200)]
lib: get_current_user: Avoid off-by-one while copying user name

- fix off-by-one error while copying user name
- tizen style fixes

Change-Id: If2fc3204413f748526959f567fad9b032502cd75

22 months agolib: get_user_list: Numerous fixes 47/277747/5
Karol Lewandowski [Tue, 12 Jul 2022 20:15:31 +0000 (22:15 +0200)]
lib: get_user_list: Numerous fixes

- use SUBSESSION_* errors only (instead of 0/TIZEN_* domain errors)
- use exact types where possible (subsession_user_t instead of void)
- fix off-by one when copying gvariant string whose lenght >= USER_MAXLEN
- minor style fixes

Change-Id: I47821432306f48caac719e2a09c3af8c1b8b452b

22 months agolibsessiond: fix a memleak in `subsession_get_user_list` 39/277739/5
Adam Michalski [Tue, 12 Jul 2022 14:23:44 +0000 (16:23 +0200)]
libsessiond: fix a memleak in `subsession_get_user_list`

Change-Id: I543f85dfddd563db71e834acf0874dae09eb3d82

23 months agoDefault user on libsessiond 33/277733/1
Arkadiusz Nowak [Tue, 12 Jul 2022 12:28:43 +0000 (14:28 +0200)]
Default user on libsessiond

Fix test to check default user id
Minor fix in clientExample

Change-Id: I1b95e3e6f77141804d35f04f4c2169b40dc244b5

23 months agoInclude default user in `GetUserList` call 25/277725/2
Adam Michalski [Tue, 12 Jul 2022 11:32:26 +0000 (13:32 +0200)]
Include default user in `GetUserList` call

Change-Id: I9e2319615f06e2896157adba0c8545c2e41fffdc

23 months agoClearly guide how to free user_list from subsession_get_user_list() 04/277604/3
Hyotaek Shim [Mon, 11 Jul 2022 04:16:02 +0000 (13:16 +0900)]
Clearly guide how to free user_list from subsession_get_user_list()

Change-Id: Ic0cc16a072d9a8d307fd061c2fc06c0e6dd1aafc
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
23 months agoRelease 0.4 86/277586/2 accepted/tizen/unified/20220712.010805 submit/tizen/20220708.124830
Karol Lewandowski [Fri, 8 Jul 2022 12:36:20 +0000 (14:36 +0200)]
Release 0.4

Change-Id: Ic3c22630f8947c04289012ef1f057d365216e302

23 months agoClient example: minor tweaks 87/277587/1
Michal Bloch [Fri, 8 Jul 2022 12:36:45 +0000 (14:36 +0200)]
Client example: minor tweaks

Change-Id: Id79209548f37171d2c0f521858c443a23688968d
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
23 months agoAdapt clientExample to char * 73/277573/6
Mateusz Majewski [Fri, 8 Jul 2022 09:21:36 +0000 (11:21 +0200)]
Adapt clientExample to char *

Change-Id: Ic68fc382f0d1e91f062ff6d40ac7885f1a864fdb

23 months agolibsessiond: Change user id from int to string type 68/277468/19
Arkadiusz Nowak [Fri, 1 Jul 2022 11:31:05 +0000 (13:31 +0200)]
libsessiond: Change user id from int to string type

Change-Id: I89da68279daa124b93eaf3a32db96e2b421d6990

23 months agoChange subsession_id type to std::string{,_view} 67/276967/18
Mateusz Majewski [Tue, 28 Jun 2022 11:30:45 +0000 (13:30 +0200)]
Change subsession_id type to std::string{,_view}

Co-authored-by: Adam Michalski <a.michalski2@partner.samsung.com>
Change-Id: Ie5d645b9172d7423f40b74c5b92c44ac106b8c1e

23 months agoRemove unnecessary `enum` 60/277360/1
Adam Michalski [Tue, 5 Jul 2022 14:54:45 +0000 (16:54 +0200)]
Remove unnecessary `enum`

Change-Id: Ibd8c2f7efb8999a97d76c69ac04f0ca6e014d42e

23 months agoRelease 0.3.1 01/277201/1 accepted/tizen/unified/20220704.213012 submit/tizen/20220701.115540
Karol Lewandowski [Fri, 1 Jul 2022 11:08:37 +0000 (13:08 +0200)]
Release 0.3.1

Change-Id: If7467fe5fb2b5549a768be32d49fe5dd3b2acc7e

23 months agoMerge "Add log notification" into tizen
Karol Lewandowski [Fri, 1 Jul 2022 10:49:25 +0000 (10:49 +0000)]
Merge "Add log notification" into tizen

23 months agoAdd log notification 40/277040/4
Arkadiusz Nowak [Wed, 29 Jun 2022 14:50:08 +0000 (16:50 +0200)]
Add log notification

Change-Id: Ia4e3809385d66e0bb7b00aee40c7bbc66a24d524

23 months agoFix an inappropriate usage of std::string_view 10/277010/2 accepted/tizen/unified/20220630.211956 submit/tizen/20220630.001059
Mateusz Majewski [Wed, 29 Jun 2022 05:55:37 +0000 (07:55 +0200)]
Fix an inappropriate usage of std::string_view

Change-Id: Ib78a4dee5588cd50ebda2666d9536acc8156de55

23 months agosessiond: Apply systemd-based dbus activation 49/276649/6
Adam Michalski [Wed, 22 Jun 2022 12:43:13 +0000 (14:43 +0200)]
sessiond: Apply systemd-based dbus activation

Change-Id: I7c5323eef839ead0fb9e3ae066310c3b50aa357e

23 months agoFix a blunder 66/276966/1
Mateusz Majewski [Tue, 28 Jun 2022 11:21:04 +0000 (13:21 +0200)]
Fix a blunder

HMMMMMMMMMMMMMMMMMMMMMMMMMMMMM

Change-Id: I0b993c1e64fb600ef30c854ad688eef1ca6c97d5

23 months agoAdd std::string and std::string_view support to tuple_g_variant_helpers 80/276780/2
Mateusz Majewski [Fri, 24 Jun 2022 10:11:05 +0000 (12:11 +0200)]
Add std::string and std::string_view support to tuple_g_variant_helpers

std::string is supported in both cases. std::string_view is only allowed
in input and not in output.

Change-Id: Ib7d23a434309943e475e70b6a2ace943e55ec8ae

23 months agoRefactor tuple_g_variant_helpers 79/276779/2
Mateusz Majewski [Fri, 24 Jun 2022 10:06:23 +0000 (12:06 +0200)]
Refactor tuple_g_variant_helpers

... to be a bit more extensible.

Change-Id: I2c37833fd8c5296d2d81413316173a35910e7a8f

23 months agoClient example: Remove unnecessary header file 78/276778/1
Adam Michalski [Fri, 24 Jun 2022 10:07:06 +0000 (12:07 +0200)]
Client example: Remove unnecessary header file

<unistd.h> was needed by sleep/usleep calls which were used temporarily
during the client app race condition tests. It's redundant now, that's
why it has been removed.

Change-Id: I9d97189a91d6630daa5853d0f62e6ac9042e4f66

23 months agoClient example: improve commentary 33/276733/1
Michal Bloch [Thu, 23 Jun 2022 14:28:34 +0000 (16:28 +0200)]
Client example: improve commentary

Change-Id: Ibe197b04e362069c3c4d129aad2f6bdf769c8bb7
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
23 months agoapi: Adjust spacing 12/275912/4
Karol Lewandowski [Mon, 6 Jun 2022 10:52:14 +0000 (12:52 +0200)]
api: Adjust spacing

Change-Id: Iab0a1c38894bf6ce4f0c10ce39337e832cc253e9

23 months agoClient example: extract duplicate code 11/276611/2
Michal Bloch [Tue, 21 Jun 2022 20:15:46 +0000 (22:15 +0200)]
Client example: extract duplicate code

 * changes a loop condition to the first-last form,
   which is equivalent and used everywhere else.

 * changes `switch_user_test` to return bool to
   conform with the new convention I am in the
   process of enforcing.

Change-Id: Id233a33ab0f0977b4e6ce660457761ce27520c8e
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
23 months agoClient example: rework mutexes 10/276610/2
Michal Bloch [Tue, 21 Jun 2022 18:01:42 +0000 (20:01 +0200)]
Client example: rework mutexes

 * add a lot of commentary, including to the newly added
   example of passing values to the callback.

 * use a conditional variable instead of a single mutex.
   This is because glib mutexes (and their underlying
   default POSIX mutexes) have undefined behaviour when
   trying to lock an already owned mutex from the owning
   thread. As a side effect, this gets rid of the trylock
   mechanism which (even though it worked) was confusing.

 * fix the mutex being left locked on subsession call error.

Change-Id: I1afa973bcae57ff8c7434d2365d51893ff7696d0
Signed-off-by: Michal Bloch <m.bloch@samsung.com>