platform/core/system/libdbuspolicy.git
9 months agoSwitch to openssl3 99/296099/1 accepted/tizen_8.0_unified tizen_8.0 accepted/tizen/8.0/unified/20231005.093806 accepted/tizen/unified/20230908.083310 tizen_8.0_m2_release
Karol Lewandowski [Wed, 19 Jul 2023 22:56:08 +0000 (00:56 +0200)]
Switch to openssl3

Change-Id: I320c21c7434c748fda55928af06c4fbcee1ac323

2 years agopackaging: use linux-tizen-modules-headers 64/268764/3 accepted/tizen_7.0_unified accepted/tizen_7.0_unified_hotfix tizen_7.0 tizen_7.0_hotfix accepted/tizen/7.0/unified/20221110.060304 accepted/tizen/7.0/unified/hotfix/20221116.105731 accepted/tizen/unified/20220121.122943 submit/tizen/20220120.151226 tizen_7.0_m2_release
Mateusz Majewski [Fri, 31 Dec 2021 09:21:40 +0000 (10:21 +0100)]
packaging: use linux-tizen-modules-headers

Change-Id: I07e4534ca1e152201e97be447a608f88f6f58352

2 years agotests: add generated performance tests 89/257689/4
Kushagra K [Thu, 29 Apr 2021 11:00:00 +0000 (16:30 +0530)]
tests: add generated performance tests

Enhancing performance test by incorporating VD Tizen
image specific Item Send rules in default context to
performance test at runtime.

Verification Results:

sh-3.2# ./stest_performance --system -r 10
SERIALIZED:
Default ItemSend Rule Count: 578
run: 0.001137

Change-Id: I7050d19a3ef50119254e417a2ef05b5bf4ecd911

3 years agoFix build errors - kdbus.h 68/254468/1 accepted/tizen_6.5_unified tizen_6.5 accepted/tizen/6.5/unified/20211028.114921 accepted/tizen/unified/20210303.085625 submit/tizen/20210303.090549 submit/tizen_6.5/20211028.162501 tizen_6.5.m2_release
Hyotaek Shim [Wed, 3 Mar 2021 09:04:25 +0000 (18:04 +0900)]
Fix build errors - kdbus.h

Change-Id: Iecea09838198402eef2bac6cffd672a0e3702609
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
3 years agokdbus: add kernel linux/kdbus.h header 80/253480/2 accepted/tizen/unified/20210223.065511 submit/tizen/20210222.053410 submit/tizen/20210222.105934
Adrian Szyndela [Wed, 10 Feb 2021 13:04:09 +0000 (14:04 +0100)]
kdbus: add kernel linux/kdbus.h header

Apparently, linux headers package may be not a good place
to keep linux kdbus header, as we can't rely on the
header being there when packages that optionally use it
are built (e.g. systemd, dbus, glib and libdbuspolicy).

However, this package, libdbuspolicy, is very tightly coupled
with kdbus so far. In fact, it is so tightly coupled
that maybe in the future the kdbus bindings will be moved here,
and the package will be renamed to libkdbus? Unlikely,
there are not many people out there that would like to touch it
anymore.

Anyway, anyone who wants to use kdbus on Tizen, should also use
libdbuspolicy. That's why the kdbus.h header goes here, and nowhere else.

Use it with libdbuspolicy or don't use at all.

'devel' package is the one for distribution of kdbus.h. Additionally,
kdbus.h has LGPL-2.1 license, so the 'devel' package also gets it.

Change-Id: Ie632e7ecff81d54044f2721138fc9656f3af8412

3 years agostest_performance: add some error checking 87/249587/1 accepted/tizen/unified/20201216.215918 submit/tizen/20201215.075227
Adrian Szyndela [Tue, 15 Dec 2020 07:32:00 +0000 (08:32 +0100)]
stest_performance: add some error checking

Change-Id: I95f8ec6be9597d05d5ebb3a847f241d5cb9e8dc9

3 years agoMerge "tests: allow reading from file in perf test" into tizen accepted/tizen/unified/20201214.124456 submit/tizen/20201211.104319
Hyotaek Shim [Fri, 11 Dec 2020 10:29:02 +0000 (10:29 +0000)]
Merge "tests: allow reading from file in perf test" into tizen

3 years agorefactoring: move getter out of loop and lambda 27/249427/2
Adrian Szyndela [Fri, 11 Dec 2020 08:06:08 +0000 (09:06 +0100)]
refactoring: move getter out of loop and lambda

Change-Id: Iab7e249849a2ae3f61642b4ead9a973071287401

3 years agotests: allow reading from file in perf test 28/249428/1
Adrian Szyndela [Tue, 8 Dec 2020 14:52:12 +0000 (15:52 +0100)]
tests: allow reading from file in perf test

Change-Id: I1660ed2a0248efe139590ac278fbf29d4db2d44c

3 years agoserialized: don't copy strings in policy lookups 26/249426/1
Adrian Szyndela [Fri, 11 Dec 2020 09:06:16 +0000 (10:06 +0100)]
serialized: don't copy strings in policy lookups

Direct serialization allows more optimizing. Now, that other
backends are gone, we can slightly modify the interface.

This commit makes send index searching pass boost::string_ref
to the backend instead of copied C-string. The backend interface
is modified to accept string_ref. This way we can remove
string copying which was necessary for having null-terminated C-string.

Change-Id: I5a1f9657efd050d93023b5256f13afd6d150c369

3 years agofix: add missing '[]' in declaration of SerializerDirect::_data 31/248831/1 accepted/tizen/unified/20201207.123256 submit/tizen/20201203.011254
Adrian Szyndela [Wed, 2 Dec 2020 10:58:34 +0000 (11:58 +0100)]
fix: add missing '[]' in declaration of SerializerDirect::_data

Change-Id: I161ff679ad19f74d8815554958f8fa0755ac4445

3 years agorefactoring: inline StorageBackendSerialized private methods 00/248700/1
Adrian Szyndela [Tue, 1 Dec 2020 13:59:44 +0000 (14:59 +0100)]
refactoring: inline StorageBackendSerialized private methods

Change-Id: I0483dceef8afa5ec4d160e6a1a785142490fb01a

3 years agoRelease 1.2.0 97/247697/1 accepted/tizen/unified/20201117.124156 submit/tizen/20201113.125959
Karol Lewandowski [Fri, 13 Nov 2020 12:29:16 +0000 (13:29 +0100)]
Release 1.2.0

Replacing flatbuffers with own serializer really deserves separate
version.

Change-Id: Ibbcd300c29f3cbc30f6dcede7a346c421f1f31c4

3 years agoserialization: add simple file verification method 15/246715/2 accepted/tizen/unified/20201105.124409 submit/tizen/20201104.053310
Adrian Szyndela [Tue, 3 Nov 2020 09:42:17 +0000 (10:42 +0100)]
serialization: add simple file verification method

Change-Id: I95d3501bcfffa0e4601ee2c3738b38c41b366a44

3 years agolicense: eliminate dual-licensing in favor of MIT 35/246435/2
Adrian Szyndela [Thu, 29 Oct 2020 08:23:33 +0000 (09:23 +0100)]
license: eliminate dual-licensing in favor of MIT

Change-Id: If1cddafdf0f25c7e42120d0ddec1897bf079f4b3

3 years agoserialization: remove flatbuffers usage 67/246367/3
Adrian Szyndela [Fri, 30 Oct 2020 11:26:29 +0000 (12:26 +0100)]
serialization: remove flatbuffers usage

Change-Id: Ic334d20bf00cd50854af767efa9c9e0bce6111b8

3 years agoserialization: add direct backend 65/246365/4
Adrian Szyndela [Mon, 26 Oct 2020 07:59:21 +0000 (08:59 +0100)]
serialization: add direct backend

Change-Id: I5c9345310f58fa62c7fec3d8a1ccc56978e4c53a

3 years agoprinting: print send index 64/246364/3
Adrian Szyndela [Mon, 26 Oct 2020 07:58:05 +0000 (08:58 +0100)]
printing: print send index

Change-Id: Ib01e7eced91c1cf91c147361107946162b6ac2d5

3 years agotests: switch to the new extracting interface 63/246363/3
Adrian Szyndela [Wed, 14 Oct 2020 08:52:10 +0000 (10:52 +0200)]
tests: switch to the new extracting interface

Change-Id: I2167e014c951099ff3ac56af7d2e3f64f5ee102f

3 years agorefactoring: create indexes in StorageBackendXML 62/246362/2
Adrian Szyndela [Mon, 19 Oct 2020 08:33:00 +0000 (10:33 +0200)]
refactoring: create indexes in StorageBackendXML

This moves creating of indexes from serializers to StorageBackendXML.
This way it's standardized, in a single place.
Serializers now serialize the indexes from the StorageBackendXML instead
of creating their own.

Change-Id: Ie2aec8a8cbace425f2e74c402cb99c25f21a27d1

3 years agorefactoring: move generalized operations to StorageBackendSerialized 61/246361/2
Adrian Szyndela [Wed, 28 Oct 2020 10:10:58 +0000 (11:10 +0100)]
refactoring: move generalized operations to StorageBackendSerialized

Change-Id: I9abb90ff1d81970d939ca3f80b784c9b7b60ab23

3 years agorefactoring: generalize operations 60/246360/2
Adrian Szyndela [Wed, 28 Oct 2020 09:40:45 +0000 (10:40 +0100)]
refactoring: generalize operations

Change-Id: I6af4d846397b73dc3dfaf45ccf5ebb0fd1ceef46

3 years agoserialization: use new interface for operations 59/246359/2
Adrian Szyndela [Wed, 28 Oct 2020 09:11:29 +0000 (10:11 +0100)]
serialization: use new interface for operations

Change-Id: Idfd52382dd4b3acd4d158d7604468e9fcc297a9b

3 years agorefactoring: move makeDecisionItem, and use new interface 58/246358/2
Adrian Szyndela [Wed, 28 Oct 2020 08:02:06 +0000 (09:02 +0100)]
refactoring: move makeDecisionItem, and use new interface

Change-Id: Ibb64103c318ff1cf404dd23bdf837c28da06a120

3 years agoprinting: use generic data extracting interface 57/246357/2
Adrian Szyndela [Wed, 28 Oct 2020 07:10:29 +0000 (08:10 +0100)]
printing: use generic data extracting interface

It eliminates any konwledge of Flatbuffers structures, types, and methods
of data extracting from the printing module.

Change-Id: I5da411f3878b8cb13e9962a7f6c994063446304a

3 years agorefactoring: move FB_ID_* constants 56/246356/2
Adrian Szyndela [Wed, 28 Oct 2020 07:35:24 +0000 (08:35 +0100)]
refactoring: move FB_ID_* constants

Change-Id: Ia5a8b74612361cdbc384f251ec45c4d02a7f4032

3 years agoprinting: add generic data extraction interface for XML db 55/246355/2
Adrian Szyndela [Wed, 28 Oct 2020 07:02:08 +0000 (08:02 +0100)]
printing: add generic data extraction interface for XML db

Change-Id: Icf05d2d7a8d5077b9efa23aee7c99af8b9264242

3 years agorefactoring: move local functions to the class 91/246291/3
Adrian Szyndela [Tue, 27 Oct 2020 15:23:56 +0000 (16:23 +0100)]
refactoring: move local functions to the class

Change-Id: I98e3f0ab900be2b487df47f06d131299507cd7a3

3 years agoserialization: add new Storage extracting interface 90/246290/3
Adrian Szyndela [Tue, 27 Oct 2020 14:08:27 +0000 (15:08 +0100)]
serialization: add new Storage extracting interface

Change-Id: I947a1c73e0396034ebd0038fb483f5208a43bba3

3 years agorefactoring: eliminate StorageBackendFlatbuffersImpl 89/246289/3
Adrian Szyndela [Tue, 27 Oct 2020 13:55:03 +0000 (14:55 +0100)]
refactoring: eliminate StorageBackendFlatbuffersImpl

Change-Id: I73f2a898483fb336518f8b9ef28338ef91e55796

3 years agorefactoring: decouple StorageBackendSerialized and Serializer 88/246288/3
Adrian Szyndela [Tue, 27 Oct 2020 12:40:26 +0000 (13:40 +0100)]
refactoring: decouple StorageBackendSerialized and Serializer

Change-Id: Ib4fbd8db4a2585694d50bfce33432b170c2cdb96

3 years agorefactoring: print 'serialized' instead of 'flatbuffers' 87/246287/3
Adrian Szyndela [Tue, 27 Oct 2020 11:41:21 +0000 (12:41 +0100)]
refactoring: print 'serialized' instead of 'flatbuffers'

Change-Id: I262f6345277133bb1c0ea16d270a38bfa066695b

3 years agoserialization: add SerializationBackend type 86/246286/3
Adrian Szyndela [Tue, 27 Oct 2020 11:32:03 +0000 (12:32 +0100)]
serialization: add SerializationBackend type

Add SerializationBackend type, which is a customization point
for choosing serialization backend. At the moment it is set
to Flatbuffers. It is the place to select another backend, when it shows up.

Change-Id: I2a54f643d5c5bda065fcd193c51ca928f20df203

3 years agorefactoring: extract common file operations to StorageBackendSerialized 85/246285/3
Adrian Szyndela [Tue, 27 Oct 2020 11:14:10 +0000 (12:14 +0100)]
refactoring: extract common file operations to StorageBackendSerialized

Change-Id: I0a3fd26342482d747f44aae08ece46bb2b40a4fc

3 years agorefactoring: extract common file operations to Serializer 84/246284/2
Adrian Szyndela [Tue, 27 Oct 2020 09:58:05 +0000 (10:58 +0100)]
refactoring: extract common file operations to Serializer

Change-Id: I87e8dd9daa91a35c2748001fba71178d608d2024

3 years agolicense: add license boilerplate where it's missing 66/246366/3
Adrian Szyndela [Wed, 28 Oct 2020 15:05:46 +0000 (16:05 +0100)]
license: add license boilerplate where it's missing

Change-Id: I60be356b594cde13e7b910a333ec7b48c6409fd1

3 years agorefactoring: remove unused enum 83/246283/1
Adrian Szyndela [Tue, 27 Oct 2020 09:45:15 +0000 (10:45 +0100)]
refactoring: remove unused enum

Change-Id: I0ebeb4c599bc05ebe9c92263fd75ccaf8cfd9486

3 years agorefactoring: rename StorageBackendSerialized to StorageBackendFlatbuffers 82/246282/1
Adrian Szyndela [Tue, 27 Oct 2020 09:18:52 +0000 (10:18 +0100)]
refactoring: rename StorageBackendSerialized to StorageBackendFlatbuffers

Change-Id: I1d6a8e089b31730e7a8e2f54ea0a3b2fe8548401

3 years agorefactoring: generalize serialized enums conversion 81/246281/1
Adrian Szyndela [Tue, 27 Oct 2020 09:12:22 +0000 (10:12 +0100)]
refactoring: generalize serialized enums conversion

Change-Id: Ia1fe8089c03605fe329bc3722bf7d99fe2117b21

3 years agorefactoring: rename Serializer to SerializerFlatbuffers 80/246280/1
Adrian Szyndela [Tue, 27 Oct 2020 09:08:39 +0000 (10:08 +0100)]
refactoring: rename Serializer to SerializerFlatbuffers

Change-Id: I52d6c22f44d7730dea221c4b9d81df9b7b3af291

3 years agorefactoring: add size argument to initFromData() 79/246279/1
Adrian Szyndela [Tue, 27 Oct 2020 08:44:25 +0000 (09:44 +0100)]
refactoring: add size argument to initFromData()

Change-Id: I0fea35816cbbb7dc898e495adab73d9c28729bc3

3 years agorefactoring: make serialized data const 92/246192/1
Adrian Szyndela [Wed, 14 Oct 2020 12:23:00 +0000 (14:23 +0200)]
refactoring: make serialized data const

Change-Id: I1e989504323c18754c9117d903ba8f4b951d8377

3 years agorefactoring: move Serializer to ldp_serializer namespace 91/246191/1
Adrian Szyndela [Wed, 14 Oct 2020 11:57:10 +0000 (13:57 +0200)]
refactoring: move Serializer to ldp_serializer namespace

Change-Id: I75fb678335aee17bcf6c13792f5124da4d0ad422

3 years agorefactoring: hide FB::File from interfaces 90/246190/1
Adrian Szyndela [Tue, 29 Sep 2020 14:56:59 +0000 (16:56 +0200)]
refactoring: hide FB::File from interfaces

Hide FB::File from interface of StorageBackendSerialized. This
generalizes the StorageBackendSerialized interface. And that allows
other implementations.

Change-Id: I84631685e6ead50b33e7254c73dfb9af18bb9c4d

3 years agoown_tree: make ordered map, we need it sorted anyway 89/246189/1
Adrian Szyndela [Wed, 14 Oct 2020 06:07:10 +0000 (08:07 +0200)]
own_tree: make ordered map, we need it sorted anyway

Change-Id: Iaac12479580b1502bc459387b64b7dda12ce9bef

4 years agofinder: improve printing 42/230342/1 accepted/tizen_6.0_unified_hotfix tizen_6.0_hotfix accepted/tizen/6.0/unified/20201030.115601 accepted/tizen/6.0/unified/hotfix/20201103.003414 accepted/tizen/unified/20200428.001342 submit/tizen/20200427.012135 submit/tizen_6.0/20201029.205104 submit/tizen_6.0_hotfix/20201102.192504 submit/tizen_6.0_hotfix/20201103.114804 tizen_6.0.m2_release
Adrian Szyndela [Thu, 9 Apr 2020 10:38:40 +0000 (12:38 +0200)]
finder: improve printing

Add actual attribute names to printing instead of printing just "send"
or "receive".

Change-Id: Ib117847d44a57abbf1fd1217a786c1d2d8b5d218

4 years agoxml-parser: don't clear list of included files in each dir 15/230315/2
Adrian Szyndela [Thu, 9 Apr 2020 08:01:48 +0000 (10:01 +0200)]
xml-parser: don't clear list of included files in each dir

The 'includedir' directives should make the parser include all
the files in the directories introduced with the directives.

This commit removes clearing of the gathered file list when
the directive is encountered.

Change-Id: Id14be322e8696bd85ddfbb0ba2360a7b4b5bcda4

4 years agotests: test multiple includedirs directive 14/230314/2
Adrian Szyndela [Thu, 9 Apr 2020 07:05:50 +0000 (09:05 +0200)]
tests: test multiple includedirs directive

This adds a test which checks if the files in all the directories
specified in all the <includedir> directives are parsed.

It breaks the checks during building as it exposes a bug.
The subsequent commit fixes the bug.

Change-Id: I020246138586357717dbee73617182f79176eac9

4 years agoFix memleak issue reported by Dexter tool. 60/225060/2
Gaurav Gupta [Mon, 17 Feb 2020 05:38:45 +0000 (11:08 +0530)]
Fix memleak issue reported by Dexter tool.

Change-Id: I24e2d2d6b6ecb3e3daf0edd94fe67866f369e87a

4 years agocoverity: Fix coverity issue 46/226146/1 submit/tizen/20200323.074358 submit/tizen/20200324.035254 submit/tizen/20200325.234821
sanghyeok.oh [Thu, 27 Feb 2020 06:33:22 +0000 (15:33 +0900)]
coverity: Fix coverity issue

constexpr function should return LiteralType

Coverity: #1050604 Parse warning
constexpr_return_not_constant

Change-Id: I608c84748dc515778bf96c6b65e59f1e389359c3

4 years agoRemove warning for GCC-9 86/221286/4 accepted/tizen/unified/20200105.221204 submit/tizen/20200102.044953
sanghyeok.oh [Tue, 31 Dec 2019 01:52:06 +0000 (10:52 +0900)]
Remove warning for GCC-9

Change-Id: Iefda0c2fafd09efe06ab3d8d73f593e3de406e7a
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
4 years agoMerge "DF191023-00350:[Secure option] file secure option application request (PIE... accepted/tizen/unified/20191113.123516 submit/tizen/20191113.022957
sanghyeok oh [Wed, 13 Nov 2019 02:26:35 +0000 (02:26 +0000)]
Merge "DF191023-00350:[Secure option] file secure option application request (PIE, etc)" into tizen

4 years agoDF191023-00350:[Secure option] file secure option application request (PIE, etc) 45/217545/3
Kushagra K [Mon, 4 Nov 2019 08:33:48 +0000 (14:03 +0530)]
DF191023-00350:[Secure option] file secure option application request (PIE, etc)

Change-Id: I65bbebeb5b6f8399dce4bc622c7a59b5963540ce
Reviewed-by: Himanshu Maithani <himanshu.m@samsung.com>
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
4 years agoMerge "printer: print FileIdentifier" into tizen_5.5 accepted/tizen/5.5/unified/20191104.111320 submit/tizen_5.5/20191101.081616
sanghyeok oh [Fri, 1 Nov 2019 08:08:20 +0000 (08:08 +0000)]
Merge "printer: print FileIdentifier" into tizen_5.5

4 years agoMerge "serialization: serialize send index" into tizen_5.5
sanghyeok oh [Fri, 1 Nov 2019 08:08:01 +0000 (08:08 +0000)]
Merge "serialization: serialize send index" into tizen_5.5

4 years agoMerge "refactoring: move local functions to an anonymous namespace" into tizen_5.5
sanghyeok oh [Fri, 1 Nov 2019 08:07:54 +0000 (08:07 +0000)]
Merge "refactoring: move local functions to an anonymous namespace" into tizen_5.5

4 years agoMerge "doc: overview, purpose, design, implementation" into tizen_5.5
sanghyeok oh [Fri, 1 Nov 2019 08:07:47 +0000 (08:07 +0000)]
Merge "doc: overview, purpose, design, implementation" into tizen_5.5

4 years agoMerge "Fix some issues found by static analysis." into tizen_5.5
sanghyeok oh [Fri, 1 Nov 2019 08:07:41 +0000 (08:07 +0000)]
Merge "Fix some issues found by static analysis." into tizen_5.5

4 years agoprinter: print FileIdentifier 01/216801/1
sanghyeok.oh [Mon, 28 Oct 2019 07:23:12 +0000 (16:23 +0900)]
printer: print FileIdentifier

Change-Id: Ia993cd3739f74920e3dedceeb4a58de1e967b326
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
(cherry picked from commit 87cae30fd5842acc83ababd378873b3182c11f02)

4 years agoserialization: serialize send index 00/216800/1
Adrian Szyndela [Fri, 25 Oct 2019 14:27:09 +0000 (16:27 +0200)]
serialization: serialize send index

This removes creating send index after reading a serialized database.
Instead, the send index is created while serializing the database,
and written along with the database. Then, the index is used
as before, but in a bit more generalized way, being a part
of PolicySend now.

Therefore, this extends the database with the new tables,
making the database version up to LDP2. The previous version
LDP1 is still compatible with new code, however the send index
is not supported for old databases.

This results in the following:
- with serialized database, version LDP2, the send index
  is kept in serialized database file, and used accordingly
  for all lookups to "send" part of the database;
- with serialized database, version LDP1, there is no send index,
  the lookups are performed in an old-fashined, linear manner;
- with no serialized database, only XML files, the index is created
  in memory, along with the serialized database. Thus, running
  fast, but at the cost of memory.

Change-Id: Ib918fa96eb60d216512faf60f8e20692c8a5d3a3
(cherry picked from commit 783b7e7315959b625a613b959c19b12a381e5831)

4 years agorefactoring: move local functions to an anonymous namespace 99/216799/1
Adrian Szyndela [Fri, 25 Oct 2019 11:35:59 +0000 (13:35 +0200)]
refactoring: move local functions to an anonymous namespace

Change-Id: I9d9cf07877d59df88305e8847c3156a73e82efd8
(cherry picked from commit c641a5cb8a025f7a75f7b88015d85e1a5cc6813a)

4 years agodoc: overview, purpose, design, implementation 98/216798/1
Adrian Szyndela [Mon, 7 Oct 2019 09:08:32 +0000 (11:08 +0200)]
doc: overview, purpose, design, implementation

The description of the libdbuspolicy project. It includes
the overview, the purpose, the description of the design and
the implementation, and additionally notes for improvements
made or considered.

Change-Id: I6b0bc9028ed86cb688d0dac9e910c10d3c4d8bc5
(cherry picked from commit 92c61f4ae8c64d2be5adf809c1ba10a1cdb5e905)

4 years agoFix some issues found by static analysis. 97/216797/1
Michal Bloch [Mon, 23 Sep 2019 13:12:52 +0000 (15:12 +0200)]
Fix some issues found by static analysis.

Change-Id: I8af3cddac48f82d98d9bdeaf6d41bae31d3dc12a
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
(cherry picked from commit 78eec0949fe14bffe6e057e79c3cf311499be8c3)

4 years agoFix DetachedBuffer self move assignment 96/216796/1
Michal Bloch [Wed, 18 Sep 2019 09:38:09 +0000 (11:38 +0200)]
Fix DetachedBuffer self move assignment

Change-Id: I7d107ac767bbb9982bf773eca86f827fce8c6423
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
(cherry picked from commit baba460bf65e66e62533d4a0c5e7dd7526a435ae)

4 years agoprinter: print FileIdentifier 36/216536/4 accepted/tizen/unified/20191101.042158 submit/tizen/20191031.025459
sanghyeok.oh [Mon, 28 Oct 2019 07:23:12 +0000 (16:23 +0900)]
printer: print FileIdentifier

Change-Id: Ia993cd3739f74920e3dedceeb4a58de1e967b326
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
4 years agoserialization: serialize send index 96/216496/1
Adrian Szyndela [Fri, 25 Oct 2019 14:27:09 +0000 (16:27 +0200)]
serialization: serialize send index

This removes creating send index after reading a serialized database.
Instead, the send index is created while serializing the database,
and written along with the database. Then, the index is used
as before, but in a bit more generalized way, being a part
of PolicySend now.

Therefore, this extends the database with the new tables,
making the database version up to LDP2. The previous version
LDP1 is still compatible with new code, however the send index
is not supported for old databases.

This results in the following:
- with serialized database, version LDP2, the send index
  is kept in serialized database file, and used accordingly
  for all lookups to "send" part of the database;
- with serialized database, version LDP1, there is no send index,
  the lookups are performed in an old-fashined, linear manner;
- with no serialized database, only XML files, the index is created
  in memory, along with the serialized database. Thus, running
  fast, but at the cost of memory.

Change-Id: Ib918fa96eb60d216512faf60f8e20692c8a5d3a3

4 years agorefactoring: move local functions to an anonymous namespace 95/216495/1
Adrian Szyndela [Fri, 25 Oct 2019 11:35:59 +0000 (13:35 +0200)]
refactoring: move local functions to an anonymous namespace

Change-Id: I9d9cf07877d59df88305e8847c3156a73e82efd8

4 years agodoc: overview, purpose, design, implementation 54/215354/1
Adrian Szyndela [Mon, 7 Oct 2019 09:08:32 +0000 (11:08 +0200)]
doc: overview, purpose, design, implementation

The description of the libdbuspolicy project. It includes
the overview, the purpose, the description of the design and
the implementation, and additionally notes for improvements
made or considered.

Change-Id: I6b0bc9028ed86cb688d0dac9e910c10d3c4d8bc5

4 years agoFix some issues found by static analysis. 17/214517/1
Michal Bloch [Mon, 23 Sep 2019 13:12:52 +0000 (15:12 +0200)]
Fix some issues found by static analysis.

Change-Id: I8af3cddac48f82d98d9bdeaf6d41bae31d3dc12a
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
4 years agoFix DetachedBuffer self move assignment 39/214139/2
Michal Bloch [Wed, 18 Sep 2019 09:38:09 +0000 (11:38 +0200)]
Fix DetachedBuffer self move assignment

Change-Id: I7d107ac767bbb9982bf773eca86f827fce8c6423
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
4 years agosvace fix:add catch - std::out_of_range 98/213998/1 accepted/tizen_5.5_unified_mobile_hotfix tizen_5.5_mobile_hotfix accepted/tizen/5.5/unified/20191031.022427 accepted/tizen/5.5/unified/mobile/hotfix/20201027.090256 accepted/tizen/unified/20190918.102205 submit/tizen/20190917.065530 submit/tizen_5.5/20191031.000004 submit/tizen_5.5_mobile_hotfix/20201026.185104 tizen_5.5.m2_release
sanghyeok.oh [Tue, 17 Sep 2019 06:40:43 +0000 (15:40 +0900)]
svace fix:add catch - std::out_of_range

Change-Id: I2bf65edb452d6d4baeeabc34682825e56ef69199
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
4 years agosvace fix 74/213974/2 submit/tizen/20190917.062106
sanghyeok.oh [Tue, 17 Sep 2019 05:44:06 +0000 (14:44 +0900)]
svace fix

Change-Id: Ie5f39ba6e883d259b6da10c4052000cae5e4c738
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
4 years agosrc: fix non-linking with some compilers/linkers 44/213544/1 accepted/tizen/unified/20190909.050752 submit/tizen/20190906.120330
Adrian Szyndela [Fri, 6 Sep 2019 11:06:31 +0000 (13:06 +0200)]
src: fix non-linking with some compilers/linkers

We got a report that the library does not link within some
environments, giving messages like:

 undefined reference to `BusPathResolver::KDBUS_SYSTEM_BUS_PATH'

This is due to missing definition of static constexpr fields.
It is not necessary to give such definition when a field is initialized
inline since C++17, but this is compiled with C++11.

This commit adds definition of static constexpr fields.

Change-Id: Ia354f0e1aa5f1051571bf328fc654627f69c5dbd

4 years agoprinter: fix 'v' argument 45/213245/1
Adrian Szyndela [Tue, 3 Sep 2019 08:11:22 +0000 (10:11 +0200)]
printer: fix 'v' argument

':' in getopt list means that the option requires an argument.
'v' option does not require argument.

Change-Id: I63052b80e8ed9cc6df93524b7052f8f1c77a8773

4 years agocoverity fix 59/212759/1 accepted/tizen/unified/20190828.011000 submit/tizen/20190827.083850
sanghyeok.oh [Mon, 26 Aug 2019 11:53:10 +0000 (20:53 +0900)]
coverity fix

Change-Id: I124109dfd923f30471c2a0799fa5774f29ee091c
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
4 years agoMerge "dbuspolicy-printer: add xml format" into tizen
Hyotaek Shim [Tue, 6 Aug 2019 01:59:03 +0000 (01:59 +0000)]
Merge "dbuspolicy-printer: add xml format" into tizen

4 years agoMerge "dbuspolicy-printer: fix segfault due to invalid input" into tizen
Hyotaek Shim [Tue, 6 Aug 2019 01:58:57 +0000 (01:58 +0000)]
Merge "dbuspolicy-printer: fix segfault due to invalid input" into tizen

4 years agodbuspolicy-printer: add xml format 64/211164/2
sanghyeok.oh [Tue, 30 Jul 2019 13:01:33 +0000 (22:01 +0900)]
dbuspolicy-printer: add xml format

Change-Id: I67cc1f29fb8e4f2fded530dea7719c46f74c0568
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
4 years agodbuspolicy-printer: fix segfault due to invalid input 28/211128/1
sanghyeok.oh [Tue, 30 Jul 2019 08:06:38 +0000 (17:06 +0900)]
dbuspolicy-printer: fix segfault due to invalid input

-i opt expecting serialized file.

Change-Id: I31bde3750deaa43c8148f2469e74a52e7ef4ba15
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
4 years agoMigrate to openssl 1.1 86/210386/2 accepted/tizen/unified/20190801.113500 submit/tizen/20190730.065826 submit/tizen/20190731.065916
Dariusz Michaluk [Thu, 18 Jul 2019 12:43:33 +0000 (14:43 +0200)]
Migrate to openssl 1.1

Change-Id: I07c62e6cf0e0fd9173a5d92b40b4b34756f05861

4 years agochange 'constructor with 1 argument' to explicit constructor 99/210199/1 accepted/tizen/unified/20190724.063739 submit/tizen/20190722.121816
sanghyeok.oh [Wed, 17 Jul 2019 00:19:21 +0000 (09:19 +0900)]
change 'constructor with 1 argument' to explicit constructor

* implicit conversion
The compiler is allowed to make one implicit conversion to resolve the parameters to a function.
What this means is that the compiler can use constructors callable with a single parameter to convert from one type to another in order to get the right type for a parameter.

Change-Id: I79da863d9d86d3ea19e43089f2c836d2f52ef6d8
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
4 years agoFix a dangling pointer / needless copy 45/209645/2
Michal Bloch [Tue, 9 Jul 2019 12:53:34 +0000 (14:53 +0200)]
Fix a dangling pointer / needless copy

Change-Id: I388462ea3d8949f7512228e1b65e4c9ccbc25bdb
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
4 years agoAdd a missing whitespace 47/209547/1
Michal Bloch [Mon, 8 Jul 2019 13:48:31 +0000 (15:48 +0200)]
Add a missing whitespace

"allowown" -> "allow own"

Change-Id: Ied47493a5a678a13b34be421a573a7bed52b62bb
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
4 years agointernal: add send index 22/208522/4 accepted/tizen/unified/20190627.014814 submit/tizen/20190626.110347
Adrian Szyndela [Wed, 29 May 2019 14:17:49 +0000 (16:17 +0200)]
internal: add send index

This adds indexes:
- main index for send rules;
- additional index for send prefix rules;
- indexes for send rules for each user;
- additional indexes for send prefix rules for each user.

Change-Id: I45a4b3625fe67a9fff7525d04ae6ebf8879e14f1

4 years agorefactoring: remove unnecessary includes 23/208523/3
Adrian Szyndela [Tue, 25 Jun 2019 11:39:29 +0000 (13:39 +0200)]
refactoring: remove unnecessary includes

Change-Id: I07f76694014d24d89964b95d834d10b4b3f8b38b

4 years agonew printing pattern 32/208132/6
Baumann [Tue, 18 Jun 2019 10:39:13 +0000 (12:39 +0200)]
new printing pattern

Change-Id: Ifb3f31c44ba845a35490f26d63e74f05cb8c6658

4 years agodbuspolicy-finder documentation 28/207728/11
Baumann [Tue, 11 Jun 2019 14:18:14 +0000 (16:18 +0200)]
dbuspolicy-finder documentation

Change-Id: Ia6617d124a4e4da8a1377eefba2b70b971b65c23

4 years agoadded policy rejected message as input 50/207650/12
Baumann [Thu, 30 May 2019 14:41:19 +0000 (16:41 +0200)]
added policy rejected message as input

Change-Id: I15f921221f02d9d8d72097d93aa54f92f91895c0

4 years agoadded dbuspolicy-finder utility 42/205142/29
Baumann [Mon, 8 Apr 2019 17:19:37 +0000 (19:19 +0200)]
added dbuspolicy-finder utility

It shows filters policies and possible privilege combinations.

Change-Id: Ia4078eb76a7fde3fc457280a08189208089464d2

4 years agofix maybe-uninitialized error in serializer.cpp 88/208488/2
Himanshu Maithani [Tue, 25 Jun 2019 05:35:11 +0000 (11:05 +0530)]
fix maybe-uninitialized error in serializer.cpp

Function Serializer::serialize(const std::string config_path, size_t &size) can
return nullptr in case of error, thus leaving size to be uninitialized.

[   50s] src/internal/serializer.cpp: In member function 'serialize':
[   50s] src/internal/serializer.cpp:133:50: error: 'size' may be used uninitialized in this function [-Werror=maybe-uninitialized]
[   50s]   output.write(reinterpret_cast<char *>(buf), size);
[   50s]                                                   ^
[   50s] src/internal/serializer.cpp:130:9: note: 'size' was declared here
[   50s]   size_t size

Change-Id: If8b2c735e6b01e73b592827b937e0dfe8f94a615
Signed-off-by: Himanshu Maithani <himanshu.m@samsung.com>
4 years agoChange the config value of the "RemainAfterExit=" ("true" -> "yes") 37/208537/2
INSUN PYO [Wed, 26 Jun 2019 00:21:53 +0000 (09:21 +0900)]
Change the config value of the "RemainAfterExit=" ("true" -> "yes")

Change-Id: I969b67e81bb7db736d1db7a566cb361bbb281a1a

4 years agobugfix: LOGE messed with errno 25/207225/4
Adrian Szyndela [Thu, 30 May 2019 10:37:53 +0000 (12:37 +0200)]
bugfix: LOGE messed with errno

Change-Id: I626c8e4e809791e5a0050a3096b392336f85cc60

4 years agorefactoring: make less dependencies 24/207224/4
Adrian Szyndela [Thu, 30 May 2019 09:42:34 +0000 (11:42 +0200)]
refactoring: make less dependencies

Change-Id: I8ec4031716f0a089e62ca0cae6fe1bfc3f5e9529

4 years agotests: add 'worst case' performance test 23/207223/2
Adrian Szyndela [Wed, 29 May 2019 09:38:33 +0000 (11:38 +0200)]
tests: add 'worst case' performance test

Change-Id: I4d14eeb5bea1e7054674793ebd8d0861c876eb59

4 years agotests: add missing deny for build-time tests 34/206834/3
Adrian Szyndela [Mon, 27 May 2019 13:56:54 +0000 (15:56 +0200)]
tests: add missing deny for build-time tests

Previous commit somehow didn't get additional deny, which
is needed for passing build-time tests.

Change-Id: Id29a11a14e6f2b586d1cab58fd8b27ef576cf713

4 years agoMerge "extracted helper functions to a separate header" into tizen
Adrian Szyndela [Tue, 28 May 2019 08:53:14 +0000 (08:53 +0000)]
Merge "extracted helper functions to a separate header" into tizen

4 years agoMerge "Makefile now conforms to libtool naming standard" into tizen
Adrian Szyndela [Tue, 28 May 2019 08:44:03 +0000 (08:44 +0000)]
Merge "Makefile now conforms to libtool naming standard" into tizen

4 years agoextracted helper functions to a separate header 00/206500/3
Baumann [Mon, 20 May 2019 15:05:06 +0000 (17:05 +0200)]
extracted helper functions to a separate header

Change-Id: I777b45cf0166611e215bf38c275b62db777dd9dd

4 years agotests: make denying method calls narrower 16/206416/1
Adrian Szyndela [Fri, 17 May 2019 11:07:18 +0000 (13:07 +0200)]
tests: make denying method calls narrower

After commit 329ae0e41 the cynara test stopped working. It was due to
different order of reading configuration files, as method.tests.conf
denied all the method calls.

This makes method.tests.conf deny only method calls to org.test.*, which
covers all destinations defined in the file.

Change-Id: I9a181bb184d41af83585c000b458fb9edd78cfb9

4 years agointernal bugfix: handle no-interface messages 36/206336/4
Adrian Szyndela [Thu, 16 May 2019 12:39:20 +0000 (14:39 +0200)]
internal bugfix: handle no-interface messages

No-interface messages should be handled in a special way.
Dbus says in bus/policy.c:

 The interface is optional in messages. For allow rules, if the message
 has no interface we want to skip the rule (and thus not allow);
 for deny rules, if the message has no interface we want to use the
 rule (and thus deny).

For example, a rule of type:
 <deny send_type="method_call" send_interface="foo.bar"/>
should:
- deny method_calls with foo.bar interface;
- deny method_calls with no interface.
A rule of type:
 <allow send_type="method_call" send_interface="foo.bar"/>
should:
- allow method_calls with foo.bar interface;
- not allow method_calls with not interface (the rule should be ignored).

The point is to make libdbuspolicy work as close as possible to how
dbus-daemon works with policies.

Change-Id: I99563d3728047a67fa4719948719a2df9c5d9f97