platform/core/appfw/pkgmgr-info.git
3 years agoUse LIB_INSTALL_DIR to get library path 43/260543/3
Ilho Kim [Tue, 29 Jun 2021 01:38:50 +0000 (10:38 +0900)]
Use LIB_INSTALL_DIR to get library path

The library path may vary depending on the architecture

Change-Id: If60268e6efe0026255b50ee2991e5c818f2633a2
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
3 years agoRelease version 0.21.2 35/260535/2 submit/tizen/20210628.110559
Ilho Kim [Mon, 28 Jun 2021 10:54:41 +0000 (19:54 +0900)]
Release version 0.21.2

Remove sqlite3 dependency from pkgmgr-info
Add unittests

Change-Id: Ie2b71d1d81ed0abe52c9d04f5c9daddf6e38ef7a
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
3 years agoMerge branch 'master' of github.sec.samsung.net:appfw/pkgmgr-info into tizen
Ilho Kim [Mon, 28 Jun 2021 09:10:40 +0000 (18:10 +0900)]
Merge branch 'master' of github.sec.samsung.net:appfw/pkgmgr-info into tizen

Change-Id: I404ed720f12f81f00ca8c5cf1acf27370bee14ee
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
3 years agoFix query request's behavior 53/260153/4
Ilho Kim [Mon, 21 Jun 2021 01:49:44 +0000 (10:49 +0900)]
Fix query request's behavior

pkgmgrinfo_appinfo_usr_get_localed_label
 -> Need to check all of the result

pkgmgrinfo_appinfo_usr_get_datacontrol_info
pkgmgrinfo_appinfo_usr_get_datacontrol_appid
pkgmgrinfo_appinfo_usr_get_datacontrol_trusted_info
 -> Find global db first and user db later

pkgmgrinfo_updateinfo_get_usr_updateinfo
 -> Check only the result related to input uid

Change-Id: I432508978d0d19bbd387c966ffb135636a61b9a4
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
3 years agoFix QueryParcelable 52/260152/4
Ilho Kim [Mon, 21 Jun 2021 02:11:18 +0000 (11:11 +0900)]
Fix QueryParcelable

Need to pass uid for user db request

Change-Id: Ib32c027b306993c824f02f92fcd88bcc7a9700d5
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
3 years agoFix ResultParcelable to handle null char pointer 77/259877/5
Ilho Kim [Wed, 16 Jun 2021 02:05:13 +0000 (11:05 +0900)]
Fix ResultParcelable to handle null char pointer

Change-Id: Ia0370f48c59fc9a096396750993276092fdbcb71
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
3 years agoFix QueryParcelable to handle null char pointer 04/259804/9
Ilho Kim [Mon, 14 Jun 2021 09:31:14 +0000 (18:31 +0900)]
Fix QueryParcelable to handle null char pointer

Change-Id: I1c1c02487beebd0586ad4423226231cab93c5167
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
3 years agoCleanup code
Junghyun Yeon [Fri, 18 Jun 2021 12:46:40 +0000 (21:46 +0900)]
Cleanup code

- Minor refactor codes.

Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
3 years agoCleanup db handlers and db handle provider
Junghyun Yeon [Fri, 18 Jun 2021 10:19:49 +0000 (19:19 +0900)]
Cleanup db handlers and db handle provider

- Add empty lines for readability.
- Move initialization to initialization list for consistency.
- Fix minor coding rule.

Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
3 years agoCleanup abstract_db_handler
Junghyun Yeon [Fri, 18 Jun 2021 10:01:28 +0000 (19:01 +0900)]
Cleanup abstract_db_handler

- Move initialization of member variable into initialize lists for consistency.
- Remove flag parameter of open or creating database functions.
- Add some empty lines at class definition for readability.

Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
3 years agoFix abstract_db_handler
Junghyun Yeon [Fri, 18 Jun 2021 09:22:08 +0000 (18:22 +0900)]
Fix abstract_db_handler

- Check coding rule.
- Move empty constructor implementation into header.

Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
3 years agoRemove unnecessary routines
Junghyun Yeon [Fri, 18 Jun 2021 09:14:09 +0000 (18:14 +0900)]
Remove unnecessary routines

Checking database lock routine is unnecessary.

Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
3 years agoFix additional coding rule
Junghyun Yeon [Fri, 18 Jun 2021 07:28:07 +0000 (16:28 +0900)]
Fix additional coding rule

Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
3 years agoFix coding rule
Junghyun Yeon [Tue, 8 Jun 2021 10:07:21 +0000 (19:07 +0900)]
Fix coding rule

Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
3 years agoImplement QueryDBHandler_GetDataControlAppIdTest unittest
Ilho Kim [Wed, 9 Jun 2021 07:45:19 +0000 (16:45 +0900)]
Implement QueryDBHandler_GetDataControlAppIdTest unittest

Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
3 years agoImplement QueryDBHandler_GetDataControlTest unittest
Ilho Kim [Wed, 9 Jun 2021 06:58:23 +0000 (15:58 +0900)]
Implement QueryDBHandler_GetDataControlTest unittest

Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
3 years agoImplement QueryDBHandler_GetLocaledLabel unittest
Ilho Kim [Wed, 9 Jun 2021 05:04:28 +0000 (14:04 +0900)]
Implement QueryDBHandler_GetLocaledLabel unittest

Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
3 years agoRelease version 0.21.1 44/260144/1 accepted/tizen/unified/20210621.214537 submit/tizen/20210621.070948
Ilho Kim [Mon, 21 Jun 2021 06:47:18 +0000 (15:47 +0900)]
Release version 0.21.1

Changes:
 - Fix manifest.xsd for the tag "res-control"

Change-Id: I3bffb1c01b6e633f67739bc42d36510d3464b248
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
3 years agoFix manifest.xsd for the tag "res-control" 42/260142/1
Ilho Kim [Mon, 21 Jun 2021 06:21:06 +0000 (15:21 +0900)]
Fix manifest.xsd for the tag "res-control"

Change-Id: Ia48b37a8f3115ef01f671aedce07c0c5c64d57ed
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
3 years agoHandle multiple query in QueryHandler
Ilho Kim [Wed, 9 Jun 2021 06:21:40 +0000 (15:21 +0900)]
Handle multiple query in QueryHandler

Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
3 years agoRelease version 0.21.0 77/259977/1 submit/tizen/20210617.070222 submit/tizen/20210618.082001 submit/tizen/20210620.232502
Ilho Kim [Thu, 17 Jun 2021 06:50:30 +0000 (15:50 +0900)]
Release version 0.21.0

Changes:
 - Supress CMake build warning
 - Add definition of res-control and its attributes
 - Add tables for resource package
 - Add api for resource package

Change-Id: I7b957b148ab9a667c9922ab054f5bb016aecc0b0
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
3 years agoAdd api for resource package 70/251170/22
Ilho Kim [Thu, 7 Jan 2021 09:42:00 +0000 (18:42 +0900)]
Add api for resource package

Change-Id: I647c3d0086c52f2fd3323d1f1fd5bec96e8b48c5
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
3 years agoAdd tables for resource package 22/250522/8
Junghyun Yeon [Tue, 29 Dec 2020 01:34:12 +0000 (10:34 +0900)]
Add tables for resource package

Change-Id: I20257494908542cb8bb948702fd7ab3befffc375
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
3 years agoAdd definition of res-control and its attributes 83/248183/6
Junghyun Yeon [Mon, 23 Nov 2020 09:35:18 +0000 (18:35 +0900)]
Add definition of res-control and its attributes

Change-Id: I29762513b157e48f90849b6b391d148f5e96421e
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
3 years agoImplement QueryDBHandler_PluginInfo unittest
Ilho Kim [Tue, 8 Jun 2021 23:54:24 +0000 (08:54 +0900)]
Implement QueryDBHandler_PluginInfo unittest

Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
3 years agoSupress CMake build warning 36/259436/2
Junghyun Yeon [Tue, 8 Jun 2021 03:01:55 +0000 (12:01 +0900)]
Supress CMake build warning

Change-Id: I9100d7738e374c8be159db299c9fc41d836a9d7c
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
3 years agoRelease version 0.20.7 37/259637/1 accepted/tizen/unified/20210611.013639 submit/tizen/20210610.095123
Ilho Kim [Thu, 10 Jun 2021 09:33:53 +0000 (18:33 +0900)]
Release version 0.20.7

Changes:
 - Remove redundant access at global database
 - Fix static analysis issues

Change-Id: Ia8c6c15c4b0c498ea232aff16e9cf279f5f3f8df
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
3 years agoFix static analysis issues 74/259574/5
Ilho Kim [Thu, 10 Jun 2021 01:26:22 +0000 (10:26 +0900)]
Fix static analysis issues

 - Fix memory leak
 - Fix buffer not null terminated
 - Fix double free
 - The out parameter is not modified in the error case

Change-Id: I24266271e42c249c2d96b3ec764bf1a61d87aa43
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
3 years agoRemove redundant access at global database 95/259595/1
Ilho Kim [Thu, 10 Jun 2021 05:40:11 +0000 (14:40 +0900)]
Remove redundant access at global database

If uid is global user pkginfo-server access global database twice

Change-Id: I05490b12a5e8c07cd62abe317471e2ff0ecfd1a8
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
3 years agoImplement dependencyinfo unittest
Junghyun Yeon [Fri, 4 Jun 2021 07:02:45 +0000 (16:02 +0900)]
Implement dependencyinfo unittest

Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
3 years agoImprove readability
Junghyun Yeon [Fri, 4 Jun 2021 06:58:33 +0000 (15:58 +0900)]
Improve readability

- Change testcase name from DBHandlerTest to ParserDBHandlerTest.
- Use abbreviate namespace.

Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
3 years agoChange implementation of dependencyInfo related testcode
Junghyun Yeon [Fri, 4 Jun 2021 05:16:59 +0000 (14:16 +0900)]
Change implementation of dependencyInfo related testcode

- Integrate depinfo handle creation logic to remove duplication.
- Change pkgid to make it more readable.

Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
3 years agoAdd coverage
Junghyun Yeon [Fri, 4 Jun 2021 07:43:38 +0000 (16:43 +0900)]
Add coverage

Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
3 years agoImplement certinfo unit tests
Junghyun Yeon [Wed, 2 Jun 2021 07:01:01 +0000 (16:01 +0900)]
Implement certinfo unit tests

Implement certinfo unittest and separate
structure comparsion function and retrieved one from database.

Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
3 years agoChange filename
Junghyun Yeon [Wed, 2 Jun 2021 02:56:57 +0000 (11:56 +0900)]
Change filename

Change test_db_handlers.cc to test_parser_db_handlers.cc to add
certificate test cases.

Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
3 years agoAdd GetTestCertificate() for testing purpose
Junghyun Yeon [Wed, 2 Jun 2021 02:55:24 +0000 (11:55 +0900)]
Add GetTestCertificate() for testing purpose

Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
3 years agoMerge branch 'tizen' of ssh://review.tizen.org:29418/platform/core/appfw/pkgmgr-info
Junghyun Yeon [Wed, 2 Jun 2021 01:32:19 +0000 (10:32 +0900)]
Merge branch 'tizen' of ssh://review.tizen.org:29418/platform/core/appfw/pkgmgr-info

3 years agoFix coding rule
Junghyun Yeon [Mon, 31 May 2021 05:20:22 +0000 (14:20 +0900)]
Fix coding rule

Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
3 years agoImplement appinfo db unit tests
Junghyun Yeon [Fri, 28 May 2021 02:04:02 +0000 (11:04 +0900)]
Implement appinfo db unit tests

Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
3 years agoRelease version 0.20.6 51/259051/1 accepted/tizen/unified/20210602.122431 accepted/tizen/unified/20210607.124544 submit/tizen/20210601.021419 submit/tizen/20210604.052001
Changgyu Choi [Mon, 31 May 2021 09:13:25 +0000 (18:13 +0900)]
Release version 0.20.6

Changes:
 - Use cache to get system locale
 - Improve performance

Change-Id: Ic854c4dd8755d998acbfaa3480d41f20f7e717d3
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
3 years agoImprove performance 24/258924/10
Changgyu Choi [Fri, 28 May 2021 01:59:50 +0000 (10:59 +0900)]
Improve performance

Changes:
 - Fix some unnecessary copy.
 - Add ReadyChecker for booting time.

Change-Id: I8454ff5ce28946f45375451a5ee2264a3f914024
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
3 years agoMerge "Use cache to get system locale" into tizen
Junghoon Park [Sun, 30 May 2021 23:02:35 +0000 (23:02 +0000)]
Merge "Use cache to get system locale" into tizen

3 years agoRelease version 0.20.5 51/258951/1 accepted/tizen/unified/20210602.122527 submit/tizen/20210528.071327 submit/tizen/20210531.052459
Ilho Kim [Fri, 28 May 2021 07:05:18 +0000 (16:05 +0900)]
Release version 0.20.5

Changes:
 - Fix memory leak
 - Add to make ready file
 - Fix memory leak
 - Fix build warning

Change-Id: Ib05d8ee8c2e0a356b93b1d67ea79371eee48b2ac
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
3 years agoFix build warning 62/258562/3
Ilho Kim [Thu, 20 May 2021 08:09:02 +0000 (17:09 +0900)]
Fix build warning

Change-Id: I7fb07ce044d08ae445e987a6d514b641fcf7e3eb
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
3 years agoFix memory leak 43/258043/5
Ilho Kim [Mon, 10 May 2021 02:16:29 +0000 (11:16 +0900)]
Fix memory leak

- There is need to free the list as well as elements
- Free the used list

Change-Id: I0b0c3d98e49d368e58ffbe34fd4f3bfd5905ff41
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
3 years agoUse cache to get system locale 59/258859/6
jh9216.park [Thu, 27 May 2021 03:05:23 +0000 (23:05 -0400)]
Use cache to get system locale

Change-Id: I955f1624be77e8c70a7ed73262169fe9d4769de3
Signed-off-by: jh9216.park <jh9216.park@samsung.com>
3 years agoAdd to make ready file 56/258756/4
Changgyu Choi [Tue, 25 May 2021 07:19:59 +0000 (16:19 +0900)]
Add to make ready file

After pkginfo-server was loaded, it creates ready file at bellow path.

                "/run/.pkginfo_server_ready"

Before client try to connect server, it checks to exist the file.

Change-Id: I2b55cc9d9c9eb1661e83124a53fadea6e44541fb
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
3 years agoFix memory leak 24/258624/10
Changgyu Choi [Fri, 21 May 2021 07:25:51 +0000 (16:25 +0900)]
Fix memory leak

g_slist_delete_link() don't free data.
This patch add to free data.

Change-Id: I86f3647eccb58282b0340281e18e709f7cada4f8
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
3 years agoRemove malloc from wrap list
Junghyun Yeon [Thu, 13 May 2021 10:16:37 +0000 (19:16 +0900)]
Remove malloc from wrap list

It's not implemented

Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
3 years agoUse "wrap" compile option to mock fopen
Ilho Kim [Tue, 27 Apr 2021 07:12:41 +0000 (16:12 +0900)]
Use "wrap" compile option to mock fopen

__set_db_version function is moved by commit (2951a7dcf53f4949706d3cfd513b179dc1409096)
this patch abort that change and use "wrap" compile option
to mock fopen, fgets, fclose

Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
3 years agoImplement PkgGetDBHandler unit test
Ilho Kim [Fri, 16 Apr 2021 11:52:25 +0000 (20:52 +0900)]
Implement PkgGetDBHandler unit test

Change-Id: I78a84d0f4dfa33c6943c667c726540932773b962
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
3 years agoImplement PkgSetDBHandler unit test
Ilho Kim [Fri, 16 Apr 2021 11:13:56 +0000 (20:13 +0900)]
Implement PkgSetDBHandler unit test

Change-Id: Ib233764ef46d54de4d3505098d515690793b12a7
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
3 years agoImplement Empty DBHandler unit test
Ilho Kim [Fri, 16 Apr 2021 09:26:58 +0000 (18:26 +0900)]
Implement Empty DBHandler unit test

Change-Id: I2642b3e190720f7281304d47e4d51118a64631dd
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
3 years agoRemove to close db handle at internal api
Ilho Kim [Mon, 19 Apr 2021 00:34:10 +0000 (09:34 +0900)]
Remove to close db handle at internal api

db handle will be closed AbstractDBHandler

Change-Id: Ia0eb272529b0a3f8cfeb4d2f878b11e2e4cf8c5c
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
3 years agoFix coding style
Changgyu Choi [Fri, 30 Apr 2021 03:57:03 +0000 (12:57 +0900)]
Fix coding style

Change-Id: Ifed8405a3c9bc0867319b6250e13fe5aa23f4dde
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
3 years agoFix some indent
Changgyu Choi [Wed, 28 Apr 2021 01:30:20 +0000 (10:30 +0900)]
Fix some indent

Change-Id: I7071fecf8d4550be50a25d725461318248d4257d
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
3 years agoSeperate cynara module with runner
Changgyu Choi [Wed, 28 Apr 2021 01:21:48 +0000 (10:21 +0900)]
Seperate cynara module with runner

Change-Id: I94eb7601d86e4bc14403fb898f724a6002e5e7e6
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
3 years agoAdd to check uid
Changgyu Choi [Tue, 27 Apr 2021 05:41:54 +0000 (14:41 +0900)]
Add to check uid

If sender's uid is system uid, pass privilege check.

Change-Id: Ib6f34af5a2247c73f214e6c6211a58657bffb626

3 years agoAdd to check Privilege
Changgyu Choi [Tue, 27 Apr 2021 02:16:38 +0000 (11:16 +0900)]
Add to check Privilege

When the server receives requests, it checks privilege asynchronously.
Only requests that habe passed the cynara check will be processed.

Change-Id: I675f527a4366826fab4c68c1ce1abd06e08b394c
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
3 years agoMerge branch 'master' of github.sec.samsung.net:appfw/pkgmgr-info into tizen
Changgyu Choi [Fri, 30 Apr 2021 02:45:28 +0000 (11:45 +0900)]
Merge branch 'master' of github.sec.samsung.net:appfw/pkgmgr-info into tizen

3 years agoRelease version 0.20.4 11/257611/3 accepted/tizen/unified/20210430.052715 submit/tizen/20210429.072312
Junghyun Yeon [Wed, 28 Apr 2021 07:21:12 +0000 (16:21 +0900)]
Release version 0.20.4

Changes:
 - Fix ReqTypeToString()
 - Refactor query construction logic of query handler
 - Fix to properly bind the parameter in writing query
 - Add unit test for parcelable
 - Add codes and comments for possible static analysis issues
 - Fix possible static analysis issue
 - Fix wrong response issues

Change-Id: I40358e948de28e7946a463f326506255aaedc09d
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
3 years agoFix wrong response issues 43/257643/3
Changgyu Choi [Thu, 29 Apr 2021 01:47:31 +0000 (10:47 +0900)]
Fix wrong response issues

Closing fd should be performed on the thread.
This patch modified what was handled on the main thread.

Changes:
 * Remove FdErrorHandler()
 * Add to Disconnect() at socket destructor.
 * Add some logs for debugging.

Change-Id: I436a6e987e5691970e0e76892b995e131d22e034
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
3 years agoFix possible static analysis issue 18/257518/2
Junghyun Yeon [Tue, 27 Apr 2021 06:14:28 +0000 (15:14 +0900)]
Fix possible static analysis issue

- Fix static analysis issue.
- Integrate error check logic for efficiency.

Change-Id: I757e5b8a93a9bdf2972cb2857712a0b9d0b267ef
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
3 years agoRemove build warnings
Junghyun Yeon [Mon, 26 Apr 2021 06:09:23 +0000 (15:09 +0900)]
Remove build warnings

Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
3 years agoRemove sqlite dependency from pkgmgr_parser_db (#167)
김일호/Tizen Platform Lab(SR)/Engineer/삼성전자 [Mon, 26 Apr 2021 02:36:44 +0000 (11:36 +0900)]
Remove sqlite dependency from pkgmgr_parser_db (#167)

Remove sqlite dependency from pkgmgr_parser_db

Change-Id: I705e888ab5e43a719bfdf4eb7c2d625c8baf7288
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
3 years agoAdd Unit test for request type
Junghyun Yeon [Thu, 22 Apr 2021 06:16:44 +0000 (15:16 +0900)]
Add Unit test for request type

Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
3 years agoAdjust fPIE option to execution file
Ilho Kim [Thu, 22 Apr 2021 03:45:31 +0000 (12:45 +0900)]
Adjust fPIE option to execution file

3 years agoFix minor issues
Ilho Kim [Wed, 21 Apr 2021 08:14:19 +0000 (17:14 +0900)]
Fix minor issues

Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
3 years agoChange to use dlopen for direct access
Ilho Kim [Fri, 26 Mar 2021 11:15:28 +0000 (20:15 +0900)]
Change to use dlopen for direct access

 - Split libpkgmgr_info.so to remove sqlite3 dependency

Change-Id: I56a01d01eb55b24e6545cf003f42b562b45761aa
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
Signed-off-by: jh9216.park <jh9216.park@samsung.com>
3 years agoAdd codes and comments for possible static analysis issues 29/256729/2
Junghyun Yeon [Mon, 12 Apr 2021 05:03:12 +0000 (14:03 +0900)]
Add codes and comments for possible static analysis issues

- Add copyright comments.
- Add parameter check logic.

Change-Id: I8526900ae44c3423914f49b90d0eb2afe89d27ef
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
3 years agoAdd unit test for parcelable 38/256838/1
Ilho Kim [Wed, 14 Apr 2021 01:14:19 +0000 (10:14 +0900)]
Add unit test for parcelable

Add unit test related DepInfoParcelable, CommandParcelable

Change-Id: Ib77bb0172e1723cce80ee3d76d8f62d8d11b0b05
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
3 years agoFix to properly bind the parameter in writing query 35/256635/2
Ilho Kim [Thu, 8 Apr 2021 08:14:15 +0000 (17:14 +0900)]
Fix to properly bind the parameter in writing query

Change-Id: I6aa0174845ee4d4a6745a5a897abacee30a9f3ca
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
3 years agoRefactor query construction logic of query handler 83/256483/4
Junghyun Yeon [Mon, 5 Apr 2021 07:13:36 +0000 (16:13 +0900)]
Refactor query construction logic of query handler

Query requests could be handled on sqlite side
by using sqlite3_prepare_v2() and sqlite3_bind_text().

Change-Id: I6bc6906a6dc42d00ec21724fd16a88cae28b9e2b
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
3 years agoFix ReqTypeToString() 35/256335/4
Changgyu Choi [Thu, 1 Apr 2021 08:20:30 +0000 (17:20 +0900)]
Fix ReqTypeToString()

Changes:
 * Add to missing comma
 * Change return type to char*

Change-Id: I775a732456d80d14c557b64cda54f841f8138d1d
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
3 years agoRelease version 0.20.3 95/256295/1 accepted/tizen/unified/20210401.110053 submit/tizen/20210401.040449 submit/tizen/20210401.052550
Junghyun Yeon [Thu, 1 Apr 2021 04:02:44 +0000 (13:02 +0900)]
Release version 0.20.3

Changes:
 - Change socket access retry policy

Change-Id: I4fccf77f733a99d072812c84a24ca9790b5d0493
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
3 years agoChange socket access retry policy 76/256276/1
Junghyun Yeon [Thu, 1 Apr 2021 01:31:04 +0000 (10:31 +0900)]
Change socket access retry policy

Do not retry socket access if requester is root.

Change-Id: I437289395733b66ddadeda76bc80c25c6ab3ce9e
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
3 years agoRelease version 0.20.2 31/256131/1 accepted/tizen/unified/20210331.054025 submit/tizen/20210330.033527
Changgyu Choi [Tue, 30 Mar 2021 02:23:21 +0000 (11:23 +0900)]
Release version 0.20.2

Changes:
 - Fix minor issues
 - Add to check to crash process
 - Add mutex in DBHandler
 - Fix 64-bit build error
 - Fix uid behavior on appinfo related functions
 - Remove useless log
 - Add ReqTypeToString()
 - Refactor pkgmgr-info
 - Remove some logs
 - Fix minor coding rule

Change-Id: Idc6c181156a755c7f82fc2745064649c90d1e9c3
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
3 years agoFix minor coding rule 90/255990/2
Junghyun Yeon [Fri, 26 Mar 2021 06:31:04 +0000 (15:31 +0900)]
Fix minor coding rule

Change-Id: I93b7b987c341b651325a481f1647aabe3e20628b
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
3 years agoRemove some logs 88/255988/2
Changgyu Choi [Fri, 26 Mar 2021 05:50:47 +0000 (14:50 +0900)]
Remove some logs

pkginfo-server's log is too much.
This patch remove some logs regarding to socket connect.

Change-Id: Ic1b06bd62cab34a679d387e283acaa4963bbd9e9
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
3 years agoRefactor pkgmgr-info 34/255834/15
jh9216.park [Wed, 24 Mar 2021 07:24:38 +0000 (03:24 -0400)]
Refactor pkgmgr-info

- Make queries at server side to protect from SQL injection attack

Change-Id: I146269d1bfd31d81c168e33565c85481a9d6700a
Signed-off-by: jh9216.park <jh9216.park@samsung.com>
3 years agoAdd ReqTypeToString() 53/255853/3
Changgyu Choi [Wed, 24 Mar 2021 08:16:39 +0000 (17:16 +0900)]
Add ReqTypeToString()

Change-Id: I7751f887dc23be2aaec57c590ad763dae345be0a
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
3 years agoRemove useless log 97/255797/3
Ilho Kim [Wed, 24 Mar 2021 01:44:57 +0000 (10:44 +0900)]
Remove useless log

When getting appinfo fails the client prints log

Change-Id: I7e8d78c5f9eda0d514b5906b03c00f27f475c12a
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
3 years agoFix uid behavior on appinfo related functions 60/255660/3
Junghyun Yeon [Mon, 22 Mar 2021 07:08:52 +0000 (16:08 +0900)]
Fix uid behavior on appinfo related functions

To support features like "disable global app for certain user only",
uid for database and uid to be used in query should be delivered
simultaneously.

Change-Id: Ie7f15a71821dc7418dc781faf350a445128c9ac6
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
3 years agoMerge "Add mutex in DBHandler" into tizen
Changgyu Choi [Wed, 24 Mar 2021 00:47:09 +0000 (00:47 +0000)]
Merge "Add mutex in DBHandler" into tizen

3 years agoFix 64-bit build error 34/255734/1 submit/tizen/20210323.055934
jusung [Tue, 23 Mar 2021 05:57:08 +0000 (14:57 +0900)]
Fix 64-bit build error

Change-Id: I2da0c29326f84c81548ce636b5367735b74725c0
Signed-off-by: jusung <jusung07.son@samsung.com>
3 years agoAdd mutex in DBHandler 59/255559/4
Changgyu Choi [Fri, 19 Mar 2021 07:35:44 +0000 (16:35 +0900)]
Add mutex in DBHandler

Add shared_mutex in DBHandler.
When it received get request, then use shared_lock.
So multiple thread is accessible.
On the other hand, when be received set request,
it use unique_lock.

Change-Id: Ifbf02d50713479d26372adaa4ad4772a030be2ef
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
3 years agoAdd to check to crash process 38/255438/8 submit/tizen/20210323.054210
Changgyu Choi [Thu, 18 Mar 2021 08:43:02 +0000 (17:43 +0900)]
Add to check to crash process

When TrimMemory() is called , it checks if there is a dead process
among the processes that requested the write.

Change-Id: I95732a8b178e2c0abb4f4e449151f861a7b59cb8
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
3 years agoFix minor issues 78/255578/1
Junghyun Yeon [Fri, 19 Mar 2021 08:41:13 +0000 (17:41 +0900)]
Fix minor issues

- Fix coding rule.
- Fix static analysis issues.

Change-Id: I391fbac9f7ec865fc06cbab7c204fa619c00e038
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
3 years agoRelease version 0.20.1 61/255561/1 accepted/tizen/unified/20210323.122846 submit/tizen/20210319.065928
Ilho Kim [Fri, 19 Mar 2021 07:37:31 +0000 (16:37 +0900)]
Release version 0.20.1

Changes:
 - Remove unnecessary mutex
 - Fix parcel factroy
 - Refactor pkginfo
 - Fix codes for matching behavior with previous code
 - Fix comparing pkg certinfo API
 - Add build options for ASLR

Change-Id: Iace9af6a4dc418a0e8052db5edd513593970420b
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
3 years agoAdd build options for ASLR 57/255557/1
Junghyun Yeon [Fri, 19 Mar 2021 07:34:39 +0000 (16:34 +0900)]
Add build options for ASLR

Change-Id: I84b11422970b99a57d0888924bc80201c952901d
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
3 years agoFix comparing pkg certinfo API 27/255527/4
Junghyun Yeon [Fri, 19 Mar 2021 04:26:12 +0000 (13:26 +0900)]
Fix comparing pkg certinfo API

Change-Id: I87a428d75056cc71dfe98f806941dcafd2549130
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
3 years agoFix codes for matching behavior with previous code 77/255477/3
Junghyun Yeon [Fri, 19 Mar 2021 01:42:26 +0000 (10:42 +0900)]
Fix codes for matching behavior with previous code

Change-Id: Ia02f583952b346ee3dec85a8f4259164cddfba47
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
3 years agoMerge "Remove unnecessary mutex" into tizen
Changgyu Choi [Fri, 19 Mar 2021 06:39:20 +0000 (06:39 +0000)]
Merge "Remove unnecessary mutex" into tizen

3 years agoRefactor pkginfo 19/255419/3
jh9216.park [Thu, 18 Mar 2021 06:10:50 +0000 (02:10 -0400)]
Refactor pkginfo

- Use constexpr instead of macro.
- Use operator* in smart pointer.
- Remove unused variable.

Change-Id: I1f0fd188accafbb5ca5361f1081525dea557d0b3
Signed-off-by: jh9216.park <jh9216.park@samsung.com>
3 years agoFix parcel factroy 65/255465/1
jh9216.park [Fri, 19 Mar 2021 01:01:13 +0000 (21:01 -0400)]
Fix parcel factroy

- The protocol for parcel was changed not to use a flag
- see : https://review.tizen.org/gerrit/#/c/platform/core/base/bundle/+/255354/

Change-Id: Icc3bfb08c35161667637f01f4acb85a250ba4b61
Signed-off-by: jh9216.park <jh9216.park@samsung.com>
3 years agoRemove unnecessary mutex 86/255386/3
Changgyu Choi [Thu, 18 Mar 2021 02:10:05 +0000 (11:10 +0900)]
Remove unnecessary mutex

Local lock is unnecessary because every critical section is global.

Change-Id: Ib33ae7a6bd7709e72fb23eb4884014b53b9a165c
igned-off-by: Changgyu Choi <changyu.choi@samsung.com>

3 years agoRelease version 0.20.0 82/255382/1 submit/tizen/20210317.233905 submit/tizen/20210318.062905
Ilho Kim [Wed, 17 Mar 2021 23:37:13 +0000 (08:37 +0900)]
Release version 0.20.0

Redesign pkgmgr-info to apply client-server architecture.

Change-Id: Ia096cf88e84ae87d41f03d8c2fd01e018f6536bf
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
3 years agoRelease version 1.0.0 submit/tizen/20210317.082331
Ilho Kim [Wed, 17 Mar 2021 08:15:00 +0000 (17:15 +0900)]
Release version 1.0.0

Redesign pkgmgr-info to apply client-server architecture.

Change-Id: I4eb3812dca8c3d66d9fa2ace19c3af7a3a508ad1
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
3 years agoChange return value of filter_count() APIs
Junghyun Yeon [Wed, 17 Mar 2021 05:21:24 +0000 (14:21 +0900)]
Change return value of filter_count() APIs

It will return PMINFO_R_OK even if result count with given filter is 0.

Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
3 years agoFix coding rule
Ilho Kim [Wed, 17 Mar 2021 07:38:51 +0000 (16:38 +0900)]
Fix coding rule

Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>