platform/core/system/sessiond.git
7 weeks agowip sandbox/klewandowski/generate-skel
Karol Lewandowski [Fri, 25 Apr 2025 20:58:00 +0000 (22:58 +0200)]
wip

Change-Id: Ie6a75c79b92feff86a8a0c53d56105adcd4e13c6

7 weeks agochange logic wrt and ordering, dont umount, change ownership earlier, add force
Karol Lewandowski [Thu, 24 Apr 2025 21:31:46 +0000 (23:31 +0200)]
change logic wrt and ordering, dont umount, change ownership earlier, add force

Change-Id: I1f35c9597580f3392f0bb80ab0ef0659c17c8ca2

7 weeks agoSwitch to mkfs.ext4
Karol Lewandowski [Thu, 24 Apr 2025 20:34:11 +0000 (22:34 +0200)]
Switch to mkfs.ext4

It looks like mkfs.ext2 is not universally available.

Please note filesystem created is still ext2.

Change-Id: I7a404b9a8feca5a281543f6fad1b50c0566cf574

7 weeks agofs-from-to-swap
Karol Lewandowski [Thu, 24 Apr 2025 12:12:22 +0000 (14:12 +0200)]
fs-from-to-swap

Change-Id: If5dae7fc440ad1a50bb77ac66edde5ae6381de67

7 weeks agocatch-toplevel-gen-skel-errors
Karol Lewandowski [Thu, 24 Apr 2025 12:04:37 +0000 (14:04 +0200)]
catch-toplevel-gen-skel-errors

Change-Id: Id7cbb1632d22cde8dfb5bca1c05e209a9dfb8338

7 weeks agowip
Karol Lewandowski [Thu, 24 Apr 2025 11:08:01 +0000 (13:08 +0200)]
wip

Change-Id: Ia335fabd1fcb3edec280ddaf7e2915ac836f9132

7 weeks agowip-add-resize
Karol Lewandowski [Wed, 23 Apr 2025 23:43:10 +0000 (01:43 +0200)]
wip-add-resize

Change-Id: I2c647a5bf8f61eaa3c9c74a2ddb1a37d0149364e

7 weeks agoMove skel generator to sessiond itself
Karol Lewandowski [Thu, 17 Apr 2025 23:27:10 +0000 (01:27 +0200)]
Move skel generator to sessiond itself

Change-Id: I95b1f47db118c72b5abb5de45308a2dc48691a1e

8 weeks agoAdd helper
Karol Lewandowski [Thu, 17 Apr 2025 21:04:11 +0000 (23:04 +0200)]
Add helper

Change-Id: I76199e60be36bff7c6ddda596914a7ae99f29e5a

8 weeks agomove mount & fs management to fs_helpers for helper to use
Karol Lewandowski [Thu, 17 Apr 2025 09:15:30 +0000 (11:15 +0200)]
move mount & fs management to fs_helpers for helper to use

Change-Id: Ida6c17d9591809fc89e1972ad11bd87fdd26228e

8 weeks agoadd-helper
Karol Lewandowski [Thu, 17 Apr 2025 08:20:47 +0000 (10:20 +0200)]
add-helper

Change-Id: If8eab0b5fe5e47dc83876d421ca51d366aba752e

8 weeks agolink-with-dlog
Karol Lewandowski [Thu, 17 Apr 2025 07:18:42 +0000 (09:18 +0200)]
link-with-dlog

Change-Id: I2440cc4541940738e8999596584123c9f79cad6b

8 weeks agoplugin
Karol Lewandowski [Wed, 16 Apr 2025 21:58:31 +0000 (23:58 +0200)]
plugin

Change-Id: Iae01cda446539a111c892f3797e7e17ab325303a

8 weeks agoAdd plugin parser plugin to generate /etc/skel image 52/322852/1
Karol Lewandowski [Wed, 16 Apr 2025 13:53:09 +0000 (15:53 +0200)]
Add plugin parser plugin to generate /etc/skel image

To be used to make adding subsession faster.  They way it's inteded to be is

 1. Template image from /etc/skel is generated per each user (FIXME) after any package is installed
  - check case if no package is installed during image build (FIXME)
  - file has to be generated in some sensible directory, not /tmp (FIXME)

 2. sessiond add will copy the image file instead of creating their own (TODO)
  - sessiond has to resize the image to users specified size (TODO)

Change-Id: I2b859f71174c690fa2c1658f2986fad60dd803e9

8 weeks agoMerge "Release 0.10.0.3" into tizen
Karol Lewandowski [Mon, 14 Apr 2025 16:14:33 +0000 (16:14 +0000)]
Merge "Release 0.10.0.3" into tizen

8 weeks agoMerge "Advisory locks for restoration" into tizen
Karol Lewandowski [Mon, 14 Apr 2025 16:14:33 +0000 (16:14 +0000)]
Merge "Advisory locks for restoration" into tizen

8 weeks agoMerge "Restore last subsession at sessiond start" into tizen
Karol Lewandowski [Mon, 14 Apr 2025 16:14:33 +0000 (16:14 +0000)]
Merge "Restore last subsession at sessiond start" into tizen

8 weeks agoMerge changes into tizen
Karol Lewandowski [Mon, 14 Apr 2025 16:14:33 +0000 (16:14 +0000)]
Merge changes  into tizen

8 weeks agoMerge changes into tizen
Karol Lewandowski [Mon, 14 Apr 2025 16:14:33 +0000 (16:14 +0000)]
Merge changes  into tizen

8 weeks agoMerge "Add OS::get_uid_from_name" into tizen
Karol Lewandowski [Mon, 14 Apr 2025 16:14:33 +0000 (16:14 +0000)]
Merge "Add OS::get_uid_from_name" into tizen

2 months agoRelease 0.10.0.3 03/322703/1
Michal Bloch [Mon, 14 Apr 2025 14:58:08 +0000 (16:58 +0200)]
Release 0.10.0.3

Add subsession restoration after reboot.

Change-Id: Id0213b8768b45153283a28d1594d351f69ca63f2

2 months agoAdvisory locks for restoration 26/322626/3
Michal Bloch [Fri, 11 Apr 2025 17:07:33 +0000 (19:07 +0200)]
Advisory locks for restoration

Change-Id: Ic394369fa3ab017503deb329e6dfee0328736f7c

2 months agoRestore last subsession at sessiond start 52/322552/4
Michal Bloch [Thu, 10 Apr 2025 19:55:32 +0000 (21:55 +0200)]
Restore last subsession at sessiond start

And add a restore-only mode in case work needs to be done
such as for fixed-size backend that needs to be remounted.

Change-Id: Iee7d831889ecac7e1a913e7acb61eb9a34ba82a5

2 months agoExtract sysconf buffer allocation 47/322547/3
Michal Bloch [Wed, 9 Apr 2025 16:20:58 +0000 (18:20 +0200)]
Extract sysconf buffer allocation

Change-Id: I931eca869f4b6354c25c5faa0b56362e069839d4

2 months agoAdd OS::get_uid_from_name 48/322548/3
Michal Bloch [Wed, 9 Apr 2025 16:21:43 +0000 (18:21 +0200)]
Add OS::get_uid_from_name

Change-Id: Ic6f5d83857689acfdc94ae88a3c158aff3cdbec8

2 months agoSave the last subsession on disk 50/322550/3
Michal Bloch [Thu, 10 Apr 2025 16:00:10 +0000 (18:00 +0200)]
Save the last subsession on disk

Change-Id: Id25e3ff5ec694aa3071052d4e3130edc9a4c794d

2 months ago`get_main_dir_by_user_id` exposed, returns fs::path 49/322549/3
Michal Bloch [Thu, 10 Apr 2025 15:11:59 +0000 (17:11 +0200)]
`get_main_dir_by_user_id` exposed, returns fs::path

Change-Id: Ic6f5d83857689acfdc94ae88a3c158aff3cdb000

2 months agoExample plugin conforms to libsyscommon interface change 08/322408/1 accepted/tizen/unified/20250412.035603 accepted/tizen/unified/x/20250413.210746
Michal Bloch [Tue, 8 Apr 2025 18:11:52 +0000 (20:11 +0200)]
Example plugin conforms to libsyscommon interface change

Change-Id: I5a5e8cb59dd16c3d287b5ed6584a00e8def63e2e

2 months agoRelease 0.10.0.2 28/322328/2
Michal Bloch [Mon, 7 Apr 2025 14:38:39 +0000 (16:38 +0200)]
Release 0.10.0.2

Hotfix printf arg ordering

Change-Id: Idbec99be804cff38b55537836750fc877f7e2ce3

2 months agoRelease 0.10.0.1 68/321968/2 accepted/tizen/unified/20250404.011642 accepted/tizen/unified/x/20250404.094524
Michal Bloch [Tue, 1 Apr 2025 17:22:17 +0000 (19:22 +0200)]
Release 0.10.0.1

Minor correctness fixes

Change-Id: I25cd31dbd56975e865e1529cb5464493481bd478

2 months agoPlugin example: stump actually fits its contents 67/321967/2
Michal Bloch [Tue, 1 Apr 2025 17:21:52 +0000 (19:21 +0200)]
Plugin example: stump actually fits its contents

Change-Id: I8a112284ef1c17a8501b241435a60bf4796f9699

2 months agoImprove plugin example commentary 66/321966/2
Michal Bloch [Tue, 1 Apr 2025 17:21:05 +0000 (19:21 +0200)]
Improve plugin example commentary

In case it actually gets used as a skeleton/example.

Change-Id: I2861c4fb72d6aaa60fac3f70525faa2816caf09a

2 months agoProper exception handling for add/remove failures 65/321965/2
Michal Bloch [Tue, 1 Apr 2025 15:34:47 +0000 (17:34 +0200)]
Proper exception handling for add/remove failures

Change-Id: I138578dda11a3f21a17c5114e3eb1c1de4fafd16

2 months agoCleanup failed fixed-size add attempts properly 64/321964/2
Michal Bloch [Tue, 1 Apr 2025 12:09:46 +0000 (14:09 +0200)]
Cleanup failed fixed-size add attempts properly

Change-Id: I624fd935c4f1a795503004befc54dd99a15aa06f
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
2 months agoCheck subsession existence explicitly for Add/Remove 51/322051/1
Michal Bloch [Wed, 2 Apr 2025 17:36:04 +0000 (19:36 +0200)]
Check subsession existence explicitly for Add/Remove

Instead of relying on the actual function blowing up
and parsing the exception in the outermost scope.

Change-Id: Ibd9b0f587880dc5503924f0debde1ec17157f892
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
2 months agoTweak exception log messages 63/321963/1
Michal Bloch [Tue, 1 Apr 2025 11:57:29 +0000 (13:57 +0200)]
Tweak exception log messages

 * remove inline \n because this produce 2 separate dlog entries
 * put the specific exception message at the end for readability

Change-Id: I556a0694d691fb324334245613b8b1456ea157cc

2 months agoMerge changes into tizen
Karol Lewandowski [Mon, 31 Mar 2025 16:50:55 +0000 (16:50 +0000)]
Merge changes  into tizen

2 months agoMerge changes from topic "sessiond-2025-03-plugins" into tizen
Karol Lewandowski [Mon, 31 Mar 2025 16:50:55 +0000 (16:50 +0000)]
Merge changes from topic "sessiond-2025-03-plugins" into tizen

* changes:
  Release 0.10.0.0
  Add an example/test plugin
  Plugin can now also push events
  Ensure sessiond service build as PIE
  Add basic event listener plugin support
  Unify validity checks
  Have a single global instance of `sessiond_context`
  Move struct defs out of main.cpp
  Extract work away from dbus method handlers

2 months agoMerge changes into tizen
Karol Lewandowski [Mon, 31 Mar 2025 16:50:55 +0000 (16:50 +0000)]
Merge changes  into tizen

2 months agoMerge changes into tizen
Karol Lewandowski [Mon, 31 Mar 2025 16:50:55 +0000 (16:50 +0000)]
Merge changes  into tizen

2 months agoRelease 0.10.0.0 26/321526/3 accepted/tizen/unified/20250403.081015 accepted/tizen/unified/x/20250403.110103
Michal Bloch [Mon, 24 Mar 2025 17:42:43 +0000 (18:42 +0100)]
Release 0.10.0.0

Added plugin support

Change-Id: Ib297d98a45c454bdc101ce9ad32bd5e40fc7d6ef

2 months agoAdd an example/test plugin 81/321681/4
Karol Lewandowski [Tue, 25 Mar 2025 13:40:22 +0000 (14:40 +0100)]
Add an example/test plugin

Co-authored-by: Michal Bloch <m.bloch@samsung.com>
Change-Id: Ifa7c7d2b773d1840449e855d9885d5c951c1b86d

2 months agoPlugin can now also push events 02/321602/4
Michal Bloch [Tue, 25 Mar 2025 19:55:29 +0000 (20:55 +0100)]
Plugin can now also push events

Change-Id: I920283dd08647ac8abce95de25315484f1e7ba43

2 months agoEnsure sessiond service build as PIE 24/321824/3
Karol Lewandowski [Fri, 28 Mar 2025 13:12:42 +0000 (14:12 +0100)]
Ensure sessiond service build as PIE

This is needed for plugins to be able to safely call sessiond exported
symbols.

Change-Id: I10eb2b8163d202f10cbdd209bffe412309da1952

2 months agoAdd basic event listener plugin support 13/321413/8
Michal Bloch [Wed, 19 Mar 2025 15:54:31 +0000 (16:54 +0100)]
Add basic event listener plugin support

Change-Id: I766a35b341c89d14eeae96f16d31ea65b91ac27e

2 months agoUnify validity checks 54/321754/1
Michal Bloch [Wed, 26 Mar 2025 18:09:14 +0000 (19:09 +0100)]
Unify validity checks

Change-Id: If3ba71927a7d182bde76b25ac655f44f3cf855bb

2 months agoHave a single global instance of `sessiond_context` 80/321680/2
Michal Bloch [Wed, 26 Mar 2025 13:55:54 +0000 (14:55 +0100)]
Have a single global instance of `sessiond_context`

This is the de facto state of affairs
and makes the plugin interface cleaner.

Change-Id: I24cb1625945fae2ef4a7dbb5b4e5e232edb6c911

2 months agoMove struct defs out of main.cpp 01/321601/2
Michal Bloch [Tue, 25 Mar 2025 20:11:10 +0000 (21:11 +0100)]
Move struct defs out of main.cpp

Plugin will want to know the context definition to call work funcs,
so the definitions need to be in a header.

Make some other header functions `inline` to allow multiple inclusion.

Change-Id: Iba0cf4c15f139a47d808ee1fdfaa38e4e64ec4e7

2 months agoExtract work away from dbus method handlers 00/321600/1
Michal Bloch [Tue, 25 Mar 2025 19:08:41 +0000 (20:08 +0100)]
Extract work away from dbus method handlers

Dbus method handlers are now strictly for dealing with dbus messages.
All the work is performed in a separate function, which will be able
to be called directly from non-dbus sources (such as plugin).

Change-Id: I1d2b1fd74827aa65f1fb48205e52d6892b858c11

3 months agoMove fork helpers to OS namespace 46/320946/1
Michal Bloch [Tue, 11 Mar 2025 12:53:06 +0000 (13:53 +0100)]
Move fork helpers to OS namespace

Change-Id: I264f830c8c7e92bdcd29c48b0b57da32aa381d65

3 months agofixed size backend: Do not unmount subsession image when switching away from session 53/320553/2
Karol Lewandowski [Tue, 4 Mar 2025 17:16:14 +0000 (18:16 +0100)]
fixed size backend: Do not unmount subsession image when switching away from session

There is no tangible benefit for unmounting the image.

Change-Id: Ic425cfee68b99fe3eef8f532676f77844229c833

3 months agoSubsession meta file rights tweaks 45/320945/1
Michal Bloch [Thu, 6 Mar 2025 14:25:13 +0000 (15:25 +0100)]
Subsession meta file rights tweaks

 * don't copy SMACK label from the image to the mounted FS root.
   This keeps the label the same as the /etc/skel source.

 * add some commentary.

Change-Id: Iaabb5e0768a93790829574511e592c39de73db60
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 months agoRelease 0.7.8.3 31/320731/1 accepted/tizen/unified/20250310.131215 accepted/tizen/unified/x/20250311.125547
Michal Bloch [Thu, 6 Mar 2025 14:27:33 +0000 (15:27 +0100)]
Release 0.7.8.3

Fixes, tests, and proper internal C API.

Change-Id: I467641bd86ce628da8302f25676b7e14d9eb7358
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 months agoMake sure self-switch works on fixed-dir backend. 82/320682/1
Michal Bloch [Wed, 5 Mar 2025 18:25:40 +0000 (19:25 +0100)]
Make sure self-switch works on fixed-dir backend.

Change-Id: I93e1f6eeaa9460526da625e0747b6586342ba96b

3 months agoImage files start with a dot 81/320681/1
Michal Bloch [Wed, 5 Mar 2025 18:20:22 +0000 (19:20 +0100)]
Image files start with a dot

Sessions named "foo.img" are valid, only names starting
with a dot are protected for technical reasons.

Change-Id: If0fc31dd124b189d27b71a588eb4ad985699979f

3 months agoAdd advanced fixed-size backend tests. 80/320680/1
Michal Bloch [Tue, 4 Mar 2025 18:55:04 +0000 (19:55 +0100)]
Add advanced fixed-size backend tests.

Covers more scenarios specific to the backend,
and interaction between the two backends.

Change-Id: I2ae980ffa8497dffc455761d1958c94db8390d5d

3 months agoAdd basic fixed-size backend tests. 52/320552/3
Michal Bloch [Tue, 4 Mar 2025 14:27:46 +0000 (15:27 +0100)]
Add basic fixed-size backend tests.

So far just a copy-paste of regular dir backend tests,
doesn't yet handle some fixed-size specific scenarios.

Change-Id: I557d3ebd280547a40feae38da5cbd51c8aeb3bf8

3 months agoFix a typo in test description 79/320679/1
Michal Bloch [Tue, 4 Mar 2025 18:59:31 +0000 (19:59 +0100)]
Fix a typo in test description

Change-Id: Ibfaa4bc253e16524cbde17e99650c6e66ae10667

3 months agoMark existing API tests as using regular-dir backend 51/320551/2
Michal Bloch [Tue, 4 Mar 2025 14:36:14 +0000 (15:36 +0100)]
Mark existing API tests as using regular-dir backend

Change-Id: I59302775c70d9941e1be592aaaa1306a7c36b7c1

3 months agoAdd `subsession_add_user_fixed_size` API. 50/320550/2
Michal Bloch [Tue, 4 Mar 2025 13:08:27 +0000 (14:08 +0100)]
Add `subsession_add_user_fixed_size` API.

Change-Id: Icbf988469a8ec038e4aa5a6a04ddee34304c24b1

3 months agoAccept const references where possible 44/320444/1 accepted/tizen/unified/20250304.070221 accepted/tizen/unified/x/20250304.080631
Michal Bloch [Thu, 27 Feb 2025 19:06:44 +0000 (20:06 +0100)]
Accept const references where possible

Change-Id: I4a2ffbd9352fc04ede70ba34bdd7ca3770b7043f

3 months agoUse `fs` consistently over `std::filesystem` 43/320443/1
Michal Bloch [Thu, 27 Feb 2025 19:03:39 +0000 (20:03 +0100)]
Use `fs` consistently over `std::filesystem`

Change-Id: Id743bce0383e30cc0d5961f22c12c45ad63f2e80

3 months agoRelease 0.7.8.2 34/320334/3 accepted/tizen/unified/20250228.071927 accepted/tizen/unified/x/20250301.185950
Michal Bloch [Wed, 26 Feb 2025 18:56:16 +0000 (19:56 +0100)]
Release 0.7.8.2

Add fixed-size image backend.

Change-Id: I4362242a2f9e0d953f711076fde4e0467f39c8e8

3 months agoFix file permissions for fixed-size backend 85/320385/1
Michal Bloch [Thu, 27 Feb 2025 15:14:24 +0000 (16:14 +0100)]
Fix file permissions for fixed-size backend

Change-Id: I429cb35d2ff50c1c22d9187976c310a774ed90c6

3 months agoCheck for mountpoint before mounting 78/320378/2
Michal Bloch [Thu, 27 Feb 2025 12:20:43 +0000 (13:20 +0100)]
Check for mountpoint before mounting

Change-Id: I335f3d0ae03a473eca929ebf1bd1d34d11c035f7

3 months agoIntegration test: fewer regular subsessions 33/320333/3
Michal Bloch [Wed, 26 Feb 2025 18:55:57 +0000 (19:55 +0100)]
Integration test: fewer regular subsessions

Three is enough, it lets you have an active subsession and multiple
inactive subsessions in parallel (not that we even look at them in
a way that this would matter). More than that doesn't really bring
much value and just makes it take more time to run the test.

Change-Id: Ifa2253bb5f637e74452c452500d711d35c0bc8bc

3 months agoAdd basic integration tests 58/320158/6
Michal Bloch [Mon, 24 Feb 2025 18:00:16 +0000 (19:00 +0100)]
Add basic integration tests

Change-Id: I18075aa397cd07e8dc5318d208b8e8ea008a5ec5
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 months agoAdd 'AddUserFixedSize' dbus call. 56/320156/8
Michal Bloch [Wed, 19 Feb 2025 16:19:34 +0000 (17:19 +0100)]
Add 'AddUserFixedSize' dbus call.

Change-Id: I29aa18dcf5812e9a0376f705c39b5483c642c8f4
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 months agoAdd fixed-size backend. 55/320155/8
Michal Bloch [Mon, 24 Feb 2025 12:49:41 +0000 (13:49 +0100)]
Add fixed-size backend.

Change-Id: I398db9e586102c97b44724ae52c112b5f2c50638

3 months agoAdd some safety to SessionAdd. 32/320332/2
Michal Bloch [Wed, 26 Feb 2025 17:34:54 +0000 (18:34 +0100)]
Add some safety to SessionAdd.

Change-Id: I2414dba217d3a8f125e13dd8ac78361b2105328d

3 months agoExtract AddSession dir helpers to dir backend. 54/320154/5
Michal Bloch [Fri, 21 Feb 2025 18:42:25 +0000 (19:42 +0100)]
Extract AddSession dir helpers to dir backend.

Change-Id: I0aa9ca022542cb6966911cc45b800110c37b11ff
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 months agoAdd a subsession switch callback to dir backend 53/320153/4
Michal Bloch [Mon, 24 Feb 2025 14:15:38 +0000 (15:15 +0100)]
Add a subsession switch callback to dir backend

Change-Id: I83bd27940fe61c6ac6b3a45be9e784db5b4535eb

3 months agoMake dir backends use inheritance instead 78/320078/1
Michal Bloch [Wed, 19 Feb 2025 14:52:11 +0000 (15:52 +0100)]
Make dir backends use inheritance instead

This is because multiple backends will be used at runtime.

Change-Id: I33811b427ba10c91f82927c13aefd61fdbb511f2
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 months agoCoverity fixes 26/319626/1 accepted/tizen/unified/20250219.035249 accepted/tizen/unified/x/20250221.042157
Michal Bloch [Thu, 13 Feb 2025 13:50:42 +0000 (14:50 +0100)]
Coverity fixes

Change-Id: I200d8d09571b35888ee543e8c58a3ec822b685db
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
4 months agoRelease 0.7.8.1 85/319485/3 accepted/tizen/unified/20250214.120456 accepted/tizen/unified/x/20250218.043808
Michal Bloch [Wed, 12 Feb 2025 11:37:26 +0000 (12:37 +0100)]
Release 0.7.8.1

Don't use bleeding edge technologies like C++20
since some known downstream forks use g++9.2.

Change-Id: I020817bb35307c92d7f1a3d13ca529279b33e986
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
4 months agoRelease 0.7.8.0 22/319122/4 accepted/tizen_unified_x_asan accepted/tizen/unified/20250207.071317 accepted/tizen/unified/x/20250212.043734 accepted/tizen/unified/x/asan/20250211.003242
Michal Bloch [Mon, 3 Feb 2025 19:14:53 +0000 (20:14 +0100)]
Release 0.7.8.0

No logic change, just refactoring.

Change-Id: I7d92b8dbdae48dc2b568a39ad79b3e1c9eea7142

4 months agoRemove a redundant check. 76/318576/6
Michal Bloch [Mon, 3 Feb 2025 19:07:52 +0000 (20:07 +0100)]
Remove a redundant check.

Change-Id: I86ae8fecafe17627ebcb2e0955e6faccfed8caeb

4 months agoMore fs::path instead of string parsing 71/318571/7
Michal Bloch [Mon, 3 Feb 2025 18:14:00 +0000 (19:14 +0100)]
More fs::path instead of string parsing

Change-Id: I6d5365f58f5bf588ca209e65644118586c9e37de
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
4 months agoMake OS helpers use fs::path instead of strings 78/318778/5
Michal Bloch [Wed, 22 Jan 2025 12:16:49 +0000 (13:16 +0100)]
Make OS helpers use fs::path instead of strings

Change-Id: I06a5912a98033fbaeaaa01acc3ebf66ed3bffb5f
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
4 months agoInitial subsession dir backend abstraction 77/318777/4
Michal Bloch [Wed, 22 Jan 2025 12:11:19 +0000 (13:11 +0100)]
Initial subsession dir backend abstraction

Just subsession removal for now.

Change-Id: Id811f5811fb842f581952f149e58de9918209196

4 months agoExtract wrappers over OS functions to a separate file 70/318570/6
Michal Bloch [Wed, 15 Jan 2025 15:13:21 +0000 (16:13 +0100)]
Extract wrappers over OS functions to a separate file

This leaves fs_helpers with just business logic.

Change-Id: I6a24e3964b918a71770055a0461bd531300debbb

4 months agoUse fs::path in `remove_user_subsession` 76/318776/3
Michal Bloch [Wed, 22 Jan 2025 11:30:13 +0000 (12:30 +0100)]
Use fs::path in `remove_user_subsession`

Instead of processing raw strings manually.

Change-Id: I188432ac5e0cb24ecac24c8aedff2fb6134b0c96

4 months agoUse std::fs for stat and mode 69/318569/5
Michal Bloch [Thu, 30 Jan 2025 16:31:54 +0000 (17:31 +0100)]
Use std::fs for stat and mode

Change-Id: I31fca9acc678734276400311b65a5b2412ccc6ab

4 months agoDecouple set_ownership from "dir class" logic 68/318568/2
Michal Bloch [Tue, 14 Jan 2025 15:23:31 +0000 (16:23 +0100)]
Decouple set_ownership from "dir class" logic

Putting business logic outside it turns set_ownership
into strictly a filesystem helper.

Change-Id: Ibdfdc4cdaed9c183b542846e0320627aab046847

4 months agoExtract "get main dir path" into a function 67/318567/2
Michal Bloch [Tue, 14 Jan 2025 14:12:46 +0000 (15:12 +0100)]
Extract "get main dir path" into a function

Change-Id: I2d13339ab99d81bbdb146bf7f6e9c2fde5ecf83a

7 months agoModify dbus conf for buxton daemon 60/319760/2 accepted/tizen/unified/20241119.153847 accepted/tizen/unified/x/20241218.032521 accepted/tizen/unified/x/asan/20241224.004247
Hwankyu Jhun [Thu, 31 Oct 2024 12:21:56 +0000 (21:21 +0900)]
Modify dbus conf for buxton daemon

To allow buxton user, the dbus policy is modified.

Requires:
 - https://review.tizen.org/gerrit/#/c/platform/core/system/buxton2/+/319750/

Change-Id: I366b8918a7cf972d90e167c3bebd635a35ea60a3
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
12 months agogcc14 fix: Add missing include 86/312286/1 accepted/tizen_unified_dev accepted/tizen_unified_toolchain accepted/tizen/9.0/unified/20241030.235345 accepted/tizen/unified/20240611.123249 accepted/tizen/unified/dev/20240620.005804 accepted/tizen/unified/toolchain/20240610.172858 accepted/tizen/unified/x/20240610.223436 accepted/tizen/unified/x/asan/20240625.092002 tizen_9.0 tizen_9.0_m2_release
Karol Lewandowski [Wed, 5 Jun 2024 12:36:50 +0000 (14:36 +0200)]
gcc14 fix: Add missing include

Change-Id: I246815dca73e8d46a081a830fa72d2f7d690ceee

12 months agoMemoryLimit has been replaced by MemoryMax 34/312134/1
Łukasz Stelmach [Tue, 4 Jun 2024 13:12:47 +0000 (15:12 +0200)]
MemoryLimit has been replaced by MemoryMax

The  MemoryLimit option is marked as deprecated in systemd and needs to
be changed to MemoryMax in unit files.

Change-Id: Id135764af5349ceb710df7093b2229c2af4b97e8
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
12 months agopackaging: Disable sessiond when it is not used on low-memory model 89/311189/1 accepted/tizen/unified/20240520.131858 accepted/tizen/unified/x/20240521.022210
Chanwoo Choi [Thu, 16 May 2024 02:07:14 +0000 (11:07 +0900)]
packaging: Disable sessiond when it is not used on low-memory model

Disable sessiond when it is not used on low-memory model
according to the following build macro rules:

- %if ("%{sec_buildconf_optimized_memory}" != "1")
 : this key is used for both of Licensing 1GB/1.5GB model and Samsung 1GB model

 - %if ("%{sec_buildconf_product_lite_tizen}" != "y")
 : it is used for only Licensing 1GB/1.5GB/2.5GB)

Change-Id: I0c064a6308892792e08cbfe780fecf78cbbbdbd9
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
15 months agospec: Replace with sec_buildconf_optimized_memory to remove dependency from sessiond 62/306062/1 accepted/tizen/unified/20240216.161330 accepted/tizen/unified/toolchain/20240311.065619 accepted/tizen/unified/x/20240220.145933
Chanwoo Choi [Thu, 15 Feb 2024 11:41:22 +0000 (20:41 +0900)]
spec: Replace with sec_buildconf_optimized_memory to remove dependency from sessiond

If sec_buildconf_optimized_memory equals with 1,
indicates that optimized_memory feature is enabled.
Because sessiond is not used on target with the enabled optimized_memory,
it should be not executed.

Replace sec_buildconf_product_lite_tizen with sec_buildconf_optimized_memory
in order to achieve the above role.

Change-Id: Ie62dedfbd80de92484f4391705d51346080ac5c4
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
16 months agospec: Remove dependency between libsessiond and sessiond if multi-user is not used accepted/tizen/unified/20240201.165053 accepted/tizen/unified/x/20240205.063748
Youngjae Cho [Wed, 24 Jan 2024 01:39:13 +0000 (10:39 +0900)]
spec: Remove dependency between libsessiond and sessiond if multi-user is not used

In environments that have no multi-user, sessiond does nothing. However,
libsessiond can work alone. For example, subsession_get_user_list()
provides a way that fetches user list without sessiond. However,
libsessiond is bound to sessiond by the below specification.
  %package -n libsessiond
  Requires:   sessiond = %{version}-%{release}

Therefore, one who needs "only" libsessiond has no choice but pulls
sessiond in together. This is matter on a system with insufficient
memory, with no use of multi-user environment as sessiond consumes
memory while does nothing. Currently security-manager is one example
that pulls libsessiond in.

Change-Id: I22fb3b0917a2ee2ad6e36f56426c23767ce648ef
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
16 months agoFix Coverity issues 36/304536/1 accepted/tizen/unified/20240119.154746
Adam Michalski [Thu, 18 Jan 2024 14:28:21 +0000 (15:28 +0100)]
Fix Coverity issues

Change-Id: I488696b437817ae23707e4f92305d83fe1943919

19 months agoservice: Set MemoryLimit to 20MB 49/300349/1 accepted/tizen/unified/20231024.112206
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>
23 months agosessiond: Fix a memory leak 49/295049/1 accepted/tizen/8.0/unified/20231005.093843 accepted/tizen/unified/20230706.152121 tizen_8.0_m2_release
Adam Michalski [Fri, 30 Jun 2023 12:51:24 +0000 (14:51 +0200)]
sessiond: Fix a memory leak

Change-Id: I758a664f234206809310bf8074de7537746e2937

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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