Zofia Abramowska [Thu, 16 Jul 2020 13:56:23 +0000 (15:56 +0200)]
Categorize unit tests for DescriptionListRequest in ProtocolAdmin
Categorize into positive/negative test cases.
Change-Id: I0a1c0b6b9e53ff31d3000d6994cd665df0d6905c
Zofia Abramowska [Thu, 16 Jul 2020 13:52:47 +0000 (15:52 +0200)]
Redo unit tests for AdminCheckResponse in ProtocolAdmin
* squash positive test cases
* add invalid protocol test case
Change-Id: I2a3e46e2df2942e091aa0620345c91c4e7d10bbb
Zofia Abramowska [Thu, 16 Jul 2020 13:20:14 +0000 (15:20 +0200)]
Redo unit tests for AdminCheckRequest in ProtocolAdmin
* squash positive test cases
* add invalid protocol test cases
Change-Id: Icfbceb6ba42d3ebf96855caf7a44482058fbb883
Zofia Abramowska [Thu, 16 Jul 2020 13:06:55 +0000 (15:06 +0200)]
Categorize BucketRecordCorruptedException unit tests
Categorize into positive/negative test cases.
Change-Id: If2dc7634bfe8eed65265685fb2e7f9407423e252
Zofia Abramowska [Wed, 15 Jul 2020 16:43:22 +0000 (18:43 +0200)]
Add unit tests for CancelResponse in ProtocolClient
Change-Id: If34ce28977fdf13e26a7d89c7a11cd9ce20a287a
Zofia Abramowska [Wed, 15 Jul 2020 16:34:25 +0000 (18:34 +0200)]
Add unit tests for CheckResponse in ProtocolClient
Change-Id: Ibfb00e00db21ca10ba18c6fdcfa5b76fd64ea4f1
Zofia Abramowska [Wed, 15 Jul 2020 16:03:31 +0000 (18:03 +0200)]
Add unit tests for MonitorEntryPutRequest in ProtocolClient
Change-Id: Idb17089a5061fb81fdd2b842c7366f2dbf6821c1
Zofia Abramowska [Wed, 15 Jul 2020 15:12:28 +0000 (17:12 +0200)]
Remove unused code
Change-Id: Ifc6230cc0fdd4044a8967cf619a6e29585ca6228
Zofia Abramowska [Tue, 30 Jun 2020 15:38:37 +0000 (17:38 +0200)]
Add tests for ProtocolSerialization
Change-Id: I9afce8b2635e81c3ffaae45804c1d4b93251b314
Zofia Abramowska [Tue, 30 Jun 2020 14:57:57 +0000 (16:57 +0200)]
Add unit tests MonitorEntriesPutRequest in ProtocolClient
Change-Id: Iab7265f104716cb3607e1b5dd10bb0d3ea53a9f6
Zofia Abramowska [Tue, 9 Jun 2020 17:15:33 +0000 (19:15 +0200)]
Move protocol serialization/deserialization to one place
Move serialization and deserialization of common types to
ProtocolSerialization and ProtocolDeserialization respectively.
This eliminates code redundancy, reduces the possibility of
wrong order of serialization/deserialization and moves protocol
size limits checks to one place.
Currently max container size is 4096. As there is no valid case
when cynara can be passed a 4096-long container, this limit will
be applied, where it hasn't been before, except for
ProtocolMonitorGet, which utilizes different buffer size - 65535.
Change-Id: Id7469015712204b3be8a1aed255dcbfa91975be3
Zofia Abramowska [Tue, 9 Jun 2020 13:01:44 +0000 (15:01 +0200)]
Ensure that MonitorCache capacity is of permissible size
When MonitorCache is flushed its whole content is sent to
Cynara service in one batch. Cynara service should not accept
vectors bigger than CYNARA_MAX_VECTOR_SIZE. Currently this is true,
but this commit adds a compile-time assertion for this limit,
so it won't be changed without realization of the consequences.
Change-Id: I5ae28882ea4c50a7455d2d0d3a7ff76d7ec7a38a
Zofia Abramowska [Mon, 8 Jun 2020 16:55:24 +0000 (18:55 +0200)]
Add unit tests for SimpleCheckRequest in ProtocolClient
Change-Id: Ia797842b01e843f3273d3c436f6d3b38b857cf92
Zofia Abramowska [Fri, 5 Jun 2020 14:49:46 +0000 (16:49 +0200)]
Add negative unit tests for ProtocolClient
Add unit tests for:
* requests and responses not implemented in ProtocolClient
* requests and responses with wrong OpCode
* requests and responses with unfinished frame
Change-Id: I3334a887b6aacac4d4924285da401fec41d7b89f
Zofia Abramowska [Thu, 4 Jun 2020 15:51:53 +0000 (17:51 +0200)]
Add unit tests for CheckRequest in ProtocolClient
Change-Id: I7dec5ab1ae3c78a4c01f00cfd72eb1eb9e2efd1e
Zofia Abramowska [Thu, 4 Jun 2020 15:17:44 +0000 (17:17 +0200)]
Add unit tests for CancelRequest in ProtocolClient
Change-Id: I6644438151faf09eb4aacf5c53e299048c1714fc
Zofia Abramowska [Fri, 5 Jun 2020 11:25:56 +0000 (13:25 +0200)]
Add unit tests for AgentRegisterResponse in ProtocolAgent
Change-Id: Idbdef1ab3315dc4e3238e7fc57f334acdc7583e3
Zofia Abramowska [Fri, 5 Jun 2020 11:01:47 +0000 (13:01 +0200)]
Add unit tests for AgentActionResponse in ProtocolAgent
Change-Id: I88d7ffa5851727d0b0f7905258a40697399bfdfd
Zofia Abramowska [Thu, 4 Jun 2020 13:46:05 +0000 (15:46 +0200)]
Add unit tests for AgentRegisterRequest in ProtocolAgent
Change-Id: I66741df415ced3f8cae240b49aaf276c9097d952
Zofia Abramowska [Thu, 4 Jun 2020 12:18:41 +0000 (14:18 +0200)]
Add unit tests for AgentActionRequest in ProtocolAgent
Change-Id: If94172c87fa6fc6cac6f93ce17edf38e31e2c69f
Zofia Abramowska [Mon, 3 Aug 2020 15:36:10 +0000 (17:36 +0200)]
Release 0.16.0
* Remove logs ifdef from spec files
* Revert "Partially remove libdlog dependency"
Change-Id: Id0e4774c9c50bdce31b161e9d9f9d010e859fdf4
Zofia Abramowska [Mon, 3 Aug 2020 15:34:36 +0000 (17:34 +0200)]
Remove logs ifdef from spec files
Logs backend choice became more complicated, than simple Tizen
version check. This ifdef is no longer accurate and needed.
Change-Id: Ic62497af4753bbd53253a7bf1ec13ff30575d389
Zofia Abramowska [Mon, 3 Aug 2020 10:46:54 +0000 (12:46 +0200)]
Revert "Partially remove libdlog dependency"
This reverts commit
426f9b677c0b6b000ad369e5086726cbdb94e3a1.
Change-Id: I55eedc3b0ea2e9a6772d452c018e3d58b905ebdc
Zofia Abramowska [Fri, 31 Jul 2020 12:21:29 +0000 (14:21 +0200)]
Release 0.15.0
* Dual license cynara under Apache 2.0 or MIT
* Partially remove libdlog dependency
* Add unit tests and redo existing ones to categorize
them into positive/negative test cases
* Minor fixes and refactoring for new unit tests
Change-Id: Ic49ea50bf625bc222bdb8c3d4633a554c7aacd05
Krzysztof Jackiewicz [Mon, 20 Jul 2020 17:20:04 +0000 (19:20 +0200)]
Dual license cynara under Apache 2.0 or MIT
Add licenses to devel packages.
Unify the copyright and license notice formatting.
Change-Id: I0cbd7f9d2fca963737cc2a7df4f9c9bf4c29a9a6
Krzysztof Jackiewicz [Wed, 29 Jul 2020 08:54:59 +0000 (10:54 +0200)]
Partially remove libdlog dependency
Switch to journal logging by default in all modules except cynara service.
This is to avoid libdlog dependency in client libraries.
Only cynara service may depend on libdlog and use it by providing a logging
callback to libcynara-commons.
Minor fixes and refactoring.
Change-Id: I15cf8dae915bd5863db79d27cad539cd7103ea34
Konrad Lipinski [Tue, 7 Jul 2020 08:28:05 +0000 (10:28 +0200)]
Change compare() not implemented assertion to compile time
Change-Id: I2c79edb3cd5d962784490139a996e14638fa33fb
Zofia Abramowska [Wed, 3 Jun 2020 12:48:36 +0000 (14:48 +0200)]
Add negative unit tests for ProtocolAgent
Add unit tests for:
* requests and responses not implemented in ProtocolAgent
* requests and responses with wrong OpCode
* requests and responses with unfinished frame
Change-Id: Ibb3882764fc58d307c4f9ff49d75a116512a9c35
Zofia Abramowska [Fri, 29 May 2020 15:55:52 +0000 (17:55 +0200)]
Add negative unit tests for ProtocolAdmin
Add unit tests for:
* requests and responses which are not implemented in ProtocolAdmin
* requests and responses with wrong opcode
* requests and responses with unfinished frame
Change-Id: Ifa0fa83b6caeaa32315c2abf14ef231005bfe573
Zofia Abramowska [Tue, 2 Jun 2020 14:41:10 +0000 (16:41 +0200)]
Sanitize test data collection
* add template generation for numeric data
* remove redundant static specifier
Change-Id: I6f64988d98c633e55d027bb5c9f5bf0b8b2597a0
Zofia Abramowska [Fri, 29 May 2020 14:23:28 +0000 (16:23 +0200)]
Add unit tests for CodeResponse with ProtocolAdmin
Change-Id: I3aad98d36969b27908cca5a1833531808b0cb6bc
Zofia Abramowska [Thu, 28 May 2020 16:17:05 +0000 (18:17 +0200)]
Add SetPoliciesRequest unit tests
Change-Id: Ia4c6d8c9a48650ac472adc613c1c70707e71285b
Zofia Abramowska [Thu, 28 May 2020 16:16:50 +0000 (18:16 +0200)]
Add RemoveBucketRequest unit tests
Change-Id: I2b0653f614d516f1b701cde904d8fc81c2a4bb7c
Zofia Abramowska [Thu, 28 May 2020 16:16:27 +0000 (18:16 +0200)]
Add InsertOrUpdateBucketRequest unit tests
Change-Id: I5c5eae53ee460a12fe0215a08d1fd02434e888eb
Zofia Abramowska [Mon, 25 May 2020 16:29:38 +0000 (18:29 +0200)]
Add tryCatch and exceptions messages tests
Change-Id: I1d82762ca73e491821336b069570ac961e38c8a8
Zofia Abramowska [Wed, 27 May 2020 15:48:17 +0000 (17:48 +0200)]
Add parameters information to exceptions messages
Fix UnknownPolicyTypeException and BucketNotExistsException
Change-Id: I3e4ef71e9050781d48d9537cf44111d1727bc37e
Zofia Abramowska [Mon, 25 May 2020 16:45:47 +0000 (18:45 +0200)]
Let tryCatch be used in multiple translation units
Move tryCatch() implementation to separate source file.
Change-Id: Ia4614a032a022765c386144e76c58c2eec6ab6b6
Zofia Abramowska [Mon, 25 May 2020 14:17:41 +0000 (16:17 +0200)]
Add safeStrError function unit tests
Change-Id: I4f54c082fe854b07d63a7a89cb4f0c13b224427d
Zofia Abramowska [Fri, 22 May 2020 16:07:25 +0000 (18:07 +0200)]
Add BinaryQueue unit tests
* add unit tests
* name test cases so they contain positive/negative information
Change-Id: I085c416bcc8fdd1cda1eeaed6778306f24ce5f52
Zofia Abramowska [Fri, 22 May 2020 10:13:58 +0000 (12:13 +0200)]
Fix parameter checking in BinaryQueue
* check raw pointers for nullptr
* check for empty buckets in all methods
* don't perform redundant checks in Bucket class
Change-Id: Ia5607df736460881aea5e8b1020ab6c5391b22d4
Zofia Abramowska [Thu, 21 May 2020 15:08:06 +0000 (17:08 +0200)]
Add MonitorCache unit tests
* add unit tests
* rename test cases to contain positive/negative information
Change-Id: I663957de5d25b646da4bab33f4f8de3f554243f1
Zofia Abramowska [Wed, 20 May 2020 16:32:44 +0000 (18:32 +0200)]
Add SequenceContainer unit tests
* add new tests
* rename test cases to contain positive/negative information
Change-Id: I892fb8fa3c74075ec12d9f340c8e78443063f879
Zofia Abramowska [Tue, 19 May 2020 15:13:25 +0000 (17:13 +0200)]
Add ChecksumGenerator unit tests
* add new tests
* rename test cases to contain positive/negative information
Change-Id: Iade6d49990e68a3e3d2549b95f558695ba0d29b7
Zofia Abramowska [Tue, 19 May 2020 15:05:10 +0000 (17:05 +0200)]
Fix options handling in ChecksumGenerator
* do not output checksum when wrong algorithm option is passed
* do not fail on run() when help option is passed
* do not throw on constructor when wrong option is passed
Change-Id: Iaebd7eeb8b6dae0e3a6f7f51bce8554528973d88
Zofia Abramowska [Mon, 18 May 2020 15:31:14 +0000 (17:31 +0200)]
Fix paths for cynara-db-migration and its tests
Change-Id: Ie43a4f2842c0436594409e51b5499ec30e2d3edb
Zofia Abramowska [Mon, 11 May 2020 15:58:24 +0000 (17:58 +0200)]
Handle gmock without pkgconfig
Googletest and googlemock do not provide libraries on
typical Linux distributions. They need to be built from sources,
preferably during project build.
Change-Id: I2f56ee8bf71f155a577fbbd2d6d72d0d350016b0
Zofia Abramowska [Wed, 13 May 2020 14:57:54 +0000 (16:57 +0200)]
Fix fallthrough issue in switch
Change-Id: Ie61c176abeec3c1bd9c1ad3076ff018ed5419d24
Zofia Abramowska [Mon, 11 May 2020 16:12:54 +0000 (18:12 +0200)]
Fix unused capture in lambdas
Fix unused capture in lambdas for unused variables and const
integers.
Change-Id: I3ed6564c522f8db936c96c3209462fa83ffc9ce9
Zofia Abramowska [Mon, 11 May 2020 16:10:47 +0000 (18:10 +0200)]
Fix no virtual destructor issue in EmergencyBackup
Change-Id: Ic9453ec1af892c57029f8cbfa48848e84bf00e09
Zofia Abramowska [Tue, 16 Jun 2020 16:13:40 +0000 (18:13 +0200)]
Add libsystemd build requirements when journal is used
Change-Id: If141aaf2511601fe08b46fb0b5b84be1447417f5
Zofia Abramowska [Mon, 11 May 2020 16:09:05 +0000 (18:09 +0200)]
Bump C++ version support
Check for compiler support of C++17 standard. If it is not
supported, then compilation fails.
Change-Id: Ie0a250678bae218e883c84acf101e0060daaf210
Zofia Abramowska [Wed, 6 May 2020 14:38:57 +0000 (16:38 +0200)]
Add flags and rpm for coverage profiling
Add compiler flags for code coverage profiling and
an rpm containing gcov objects generated during build time.
Change-Id: Iaf527a5acf7a87aa54bedc383d20dad8d8ae170f
Tomasz Swierczek [Wed, 15 Jan 2020 09:21:00 +0000 (10:21 +0100)]
Release 0.14.26
* Add gcc 9 fixes
Change-Id: I692bebc5980f02f414524e75f3a418889dfe167d
Tomasz Swierczek [Wed, 15 Jan 2020 09:09:47 +0000 (10:09 +0100)]
Add gcc 9 fixes
Change-Id: I5765699111d94d209a08002696d1d0906d917211
Tomasz Swierczek [Thu, 9 Jan 2020 08:36:45 +0000 (09:36 +0100)]
Release 0.14.25
* Fix build for gcc 9
* Other EmergencyBackup implementation
* Adjust EmergencyBackup to tests
* Dont modify actual admin offline storage to validate DB
* Fix ownership of tests files
Change-Id: I5c61a4d31cb854059685a842d8880d187750867a
Tomasz Swierczek [Wed, 8 Jan 2020 07:04:52 +0000 (08:04 +0100)]
Fix build for gcc 9
Change-Id: Id6f85a9b853e043fe00b5ae8525888481a4bab14
Zofia Grzelewska [Thu, 3 Oct 2019 16:51:13 +0000 (18:51 +0200)]
Other EmergencyBackup implementation
Change-Id: I438f545d8fcf5c115c88ba069d80c73810f8a9db
Zofia Grzelewska [Wed, 11 Sep 2019 12:28:56 +0000 (14:28 +0200)]
Adjust EmergencyBackup to tests
* Change EmergencyBackup namespace to class to allow testing
* Pass EmergencyBackup to InMemoryStorageBackend as parameter
and make it optional
* Add unit tests for both cases - when EmergencyBackup is used
and not
Change-Id: Ibc8e2ac5b20b9769597e45ce87cb1a8cdd4bfbe0
Zofia Grzelewska [Wed, 11 Sep 2019 12:34:42 +0000 (14:34 +0200)]
Dont modify actual admin offline storage to validate DB
Change-Id: I88f0d0d2ce1d607b7cfab6e95dcf6631faef449a
Zofia Grzelewska [Tue, 10 Sep 2019 15:25:44 +0000 (17:25 +0200)]
Fix ownership of tests files
Change-Id: I15c451862413b291f0cf00e6788dd8dc04c13c5f
Zofia Grzelewska [Fri, 30 Aug 2019 16:19:11 +0000 (18:19 +0200)]
Release 0.14.24
* Add emergency backup for handling Cynara Db corruption
* Fix umask in Cynara service
* Change the config value of the "NoNewPrivileges=" ("true" -> "yes")
Change-Id: I74af0a8fe7adaae98ede770502223bc13262b750
Alicja Kluczek [Fri, 26 Jul 2019 11:33:54 +0000 (13:33 +0200)]
Add emergency backup for handling Cynara Db corruption
Add emergency backup creation to admin API and cyad functionality.
This should be used during image creation to backup Cynada database.
Above functionality works *ONLY* in off-line mode.
Add mechanism to Cynara which replaces original database with backup
database after corruption detection. If there is integrity problem after
loading backup, cynara enters emergency mode.
After loading backup, flag file {$STATE_PATH}/db-recovered
is created containing timestamp of when corruption was detected and
backup was loaded.
Change-Id: I80924279145a3913f91f66ea133e690ce9b50a37
Zofia Grzelewska [Wed, 28 Aug 2019 16:11:11 +0000 (18:11 +0200)]
Fix umask in Cynara service
Cynara service file resulted in Cynara creating updated
database files with 666 permissions. This commit changes
umask to 022.
Change-Id: I05976653d83ebe3abb7ae97483e816f6c372e3f8
INSUN PYO [Wed, 26 Jun 2019 01:07:47 +0000 (10:07 +0900)]
Change the config value of the "NoNewPrivileges=" ("true" -> "yes")
Change-Id: Ibb71a895d8ff9fed0f25f60e192eedcd6f0a402a
Tomasz Swierczek [Tue, 25 Jun 2019 04:49:51 +0000 (06:49 +0200)]
Release 0.14.23
* Remove unnecessary settings on cynara.target
Change-Id: Iec9178831b10ba1d82dbd87f737717d72a803b2e
INSUN PYO [Mon, 29 Apr 2019 00:17:25 +0000 (09:17 +0900)]
Remove unnecessary settings on cynara.target
Change-Id: I66a80e2966be2aaf6872e162dbc9fea77c7bdfa9
Tomasz Swierczek [Mon, 11 Feb 2019 11:46:55 +0000 (12:46 +0100)]
Release 0.14.22
* Add release script
* Add strerror_r wrapper implementation
Change-Id: Iabeee79815cea8b9f2eca6b2f2228479d26b1530
Zofia Grzelewska [Tue, 29 Jan 2019 14:56:05 +0000 (15:56 +0100)]
Add release script
Add script helping in creating release commit:
* update version in all CMakeLists.txt files
* update version in all *.spec files
* update changelog
* generate commit message
Change-Id: Idc86879ed1ab64414f5a4f3b9855f013aeb55bed
Zofia Grzelewska [Mon, 28 Jan 2019 14:10:13 +0000 (15:10 +0100)]
Add strerror_r wrapper implementation
strerror function cannot be used inside client libararies.
This commit provides a convenient C++ wrapper of strerror_r
and applies it in all files linked with client libraries.
Change-Id: I2defc2fbb76cdca8a63a8b23b581b953d2803679
Tomasz Swierczek [Wed, 16 Jan 2019 13:00:45 +0000 (14:00 +0100)]
Release 0.14.21
* Fix cynara unit tests
* Fix issues from static analysis
* Add cynara sd-bus helper
Change-Id: I47c3bd5f35bb461965b1adad5e13601af3a18a14
Tomasz Swierczek [Wed, 16 Jan 2019 07:59:14 +0000 (08:59 +0100)]
Add exception handling in cynara_session_from_pid
Change-Id: I4ad3a32100376e5790c08c5f400086bf031fb9fe
Pawel Kowalski [Thu, 10 Jan 2019 12:20:45 +0000 (13:20 +0100)]
Fix test CynaraAdminPolicies.addOne
Remove unnecessary freeing of cynara admin policy fixed the test.
Freeing is performed using the unique pointer policyPtr and manual
freeing is no longer needed.
Change-Id: Ib649ee1878f00f476b383ad116e4a28809c8755c
Zofia Grzelewska [Mon, 26 Nov 2018 13:33:28 +0000 (14:33 +0100)]
Fix warnings found in static analysis
* remove octal constants - any integer constant beginning
with a '0' (zero) is treated as octal. Because of this,
it is possible for a zero-prefixed constant that is intended
to be a decimal number to be incorrectly entered as an octal number,
contrary to developer expectations (from c++test)
* remove unnecessary default constructors
Change-Id: Ie1ef6c27ea51fa6ea70f73e467fca922bd5be445
Monika Zielinska [Mon, 5 Nov 2018 12:17:38 +0000 (13:17 +0100)]
Add cynara sd-bus helper
* Added cynara_sd_bus_get_(client,user,pid) credential fetching API
supporting sd-bus library
* API uses SD_BUS_CREDS_SELINUX_CONTEXT option for fetching Smack label
as there is currently no other secure way
Change-Id: I36b771be3a5ba764467e36154fd520b3f0b3e2fc
Piotr Sawicki [Tue, 30 Oct 2018 09:36:46 +0000 (10:36 +0100)]
Release 0.14.20
* Fix SVACE defect in cyad test
* Increase backlog for listening sockets
Change-Id: Ibc9ec113b6e2bffe58419da5005485cf010212cf
Pawel Kowalski [Wed, 26 Sep 2018 10:57:10 +0000 (12:57 +0200)]
Fix SVACE defect in cyad test
* Add throwing bad_alloc() exception when allocating descriptions fails
Change-Id: Iecf17609cb6099efc76da4ea24b428f71d561430
Piotr Sawicki [Wed, 17 Oct 2018 09:28:22 +0000 (11:28 +0200)]
Increase backlog for listening sockets
When systemd's socket activaction is utilized, the default backlog
parameter passed to the listen() function is set to SOMAXCONN,
which is equal to 128. In distributions where systemd is not used
for socket activation, the default Cynara's UNIX socket
implementation sets the backlog value to 5.
Moreover, there are services which don't keep a connection open for
multiple Cynara's checks. They create one connection per one request.
All this may lead to rare overflow of an internal connection queue.
This manifests itself as the -EAGAIN error returned by connect().
To mitigate the issue, the backlog parameter has been set
to SOMAXCONN, which is a default value used by systemd.
Change-Id: Ia67d48155cbe442c208bac65a42cfc2923442bb0
Tomasz Swierczek [Fri, 31 Aug 2018 12:42:33 +0000 (14:42 +0200)]
Release 0.14.19
* Change dlog function to support serial console
Change-Id: I636368c6c7afe807dd2e8832b644027ff242f6ec
Kidong Kim [Tue, 21 Aug 2018 07:22:38 +0000 (16:22 +0900)]
Change dlog function to support serial console
Change-Id: I20f8e22e7cfa0bfc745cbba8ca46e7b3a80eea1c
Tomasz Swierczek [Thu, 9 Aug 2018 11:50:40 +0000 (13:50 +0200)]
Release 0.14.18
* Improve DB management - better error handling
* Verify db saving to files on policy change
Change-Id: I3ce7e53e40444b3d1b3f361d375b6ba52acc19e6
Lukasz Wojciechowski [Thu, 2 Aug 2018 18:48:35 +0000 (20:48 +0200)]
Verify file read errors during database loading
Verify if there are no IO errors during database loading from files.
Change-Id: I49ac887bae05f47b2b75dd6dc6489fc4d54562fb
Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Lukasz Wojciechowski [Thu, 2 Aug 2018 17:56:32 +0000 (19:56 +0200)]
Verify database saving to files
There was a critical error in Cynara, that might cause loss of data stored
in the database. During the saving of the backup database, there was
no verification if writing data to files succeded. Only creation of files
was verified.
In case of no storage space on a device, empty files were created,
but no data was written into them.
This patch raises a DatabaseWriteException, which is propagated to higher
layers of Cynara or Cyad in offline mode and blocks changes in both
database and the in-memory structures. Also the proper error code
is returned to an admin process requesting a change in the database
or to a command line client in cyad's offline mode.
Change-Id: I9db6aeebc485f595f5eef1cdc8090830ae33949c
Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Lukasz Wojciechowski [Thu, 2 Aug 2018 15:58:42 +0000 (17:58 +0200)]
Handle file errors in Cyad's bulk file policy set
There was no error handling in case of the missing file passed to set policies
command in a bulk mode. Both, the missing file and the io operations' errors
were ignored.
This patch raises and handles a FileNotFound exception in CommandDispatcher.
Additionally the bulk file format accepts now empty lines, which allows
a logical division of policies in the file thus increasing readability.
All changes are covered by unit tests in commands_dispatcher.cpp
Change-Id: I27ccb97ffef6c07a6d0685ad4f2be73266ed8f2b
Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Tomasz Swierczek [Tue, 27 Mar 2018 12:44:18 +0000 (14:44 +0200)]
Release 0.14.17
Choose logging mechanism differently for Tizen 4.0 and earlier (syslog)
and Tizen 5.0 (dlog).
Fix minor issues in changelog and rpm summaries.
Change-Id: I48c048d5948115b217b770fcce3c4ada628abdf0
Lukasz Wojciechowski [Mon, 26 Mar 2018 17:36:10 +0000 (19:36 +0200)]
Use syslog as a default logging mechanism in cmake
Using FATAL_ERROR in case of undefined LOG_TYPE introduced in
"Change spec/cmake logging definitions - one cmake variable" patch
breaks backward compatibility of build recipies for non-Tizen systems.
As it changes default behaviour in case of undefined LOG_TYPE causing
build failure.
This commit reverts this behaviour. Undefined LOG_TYPE on cmake level
will trigger usage of syslog again.
This patch affects only non-Tizen distributions as Tizen uses .spec files,
which always define log type.
Change-Id: I034a0d614c0732c7c602b245eace26c42c59cfe1
Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Lukasz Wojciechowski [Mon, 26 Mar 2018 17:28:50 +0000 (19:28 +0200)]
Fix typo in changelog
Change-Id: I27e7928f5bb11dbd61b743df387c780ddda93ae8
Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Lukasz Wojciechowski [Mon, 26 Mar 2018 17:22:32 +0000 (19:22 +0200)]
Fix main rpm packages summaries
Change-Id: Ic0ec04a4fc0743d712762b4fcd968328a6932926
Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Lukasz Wojciechowski [Mon, 26 Mar 2018 17:03:19 +0000 (19:03 +0200)]
Choose log_type depending on Tizen version
Tizen 5.0 requires logging to dlog, while older versions of Tizen (4.0, 3.0)
use syslog mechanism.
Logging mechanism is choosen depending on Tizen major version.
Change-Id: I5771605f4416ca5cd87a8a9f7b6ad6495aefa224
Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Tomasz Swierczek [Fri, 23 Mar 2018 19:00:36 +0000 (20:00 +0100)]
Release 0.14.16
Fix logging in cynara-plugins
Change-Id: I6269b3911fd9045010424993e4af69ad295d1b11
Tomasz Swierczek [Fri, 23 Mar 2018 18:21:10 +0000 (19:21 +0100)]
Fix logging in cynara-plugins
Cynara plugins include log.h in its interface, making log.h header
visible to external modules that implement plugins. Such change
was introduced to Cynara when log.h implemented only one kind of logger (journal).
Today, this file can alternatively compile to use syslog, journal or dlog,
depending on definitions passed from spec/cmake. This causes external modules
to rely on Cynara's internal macros, not defined in their cmake files.
This commit returns back "feature" of log.h to compile to syslog usage
as it was prior 0.14.15 release, in order to fix external module build breaks,
introduced by commit
632d8296266547f2291e03149e54fbc399bd9de8.
Ideally, this problem requires more changes - changing logging in dependent
modules not to use Cynara's loging definitions from log.h & removing log.h from API.
However, Since Cynara is an open source project and may be used outside Tizen, this change is
introduced first - modifying API should be done with careful consideration for external users.
Change-Id: I99c80ceb636fd9797b2419eb87b81171351b95f3
Tomasz Swierczek [Wed, 21 Mar 2018 09:58:41 +0000 (10:58 +0100)]
Release 0.14.15
Changed spec/cmake logging definitions - one cmake variable
Added dlog as default logging option
Changed PIE handling (PIC for libs, PIE for executables)
Change-Id: I42464174e81856e0cf2e1bcd050592291ee1eb0b
Tomasz Swierczek [Thu, 22 Mar 2018 10:43:30 +0000 (11:43 +0100)]
Change spec/cmake logging definitions - one cmake variable
Previous independent CMAKE definitions for each logging backend
were changed to one variable defining type of backend
Change-Id: I7b85123948f856fd5100931bb924555e589048d3
Tomasz Swierczek [Wed, 14 Mar 2018 11:42:43 +0000 (12:42 +0100)]
Add dlog as Tizen-platform specific (& default) logging option
Change-Id: Ie2cf9e45c958785cd9891929afcac8ea6cb93920
Tomasz Swierczek [Thu, 22 Mar 2018 16:01:40 +0000 (17:01 +0100)]
packaging: make shared libs with PIC, executables with PIE
CXXFLAGS/LDFLAGS defined in spec file caused everything compile with PIE;
ASAN requires shared libs to be with PIC
Change-Id: I315128fa7dff344b60602b3d6e5b7a889d39f45e
Zofia Grzelewska [Thu, 25 Jan 2018 15:48:45 +0000 (16:48 +0100)]
Release 0.14.14
Added hardening options to all build artifacts
Change-Id: I406dd89d541912dc6ec1f28fd23f2ba0e2839eb9
Tomasz Swierczek [Fri, 12 Jan 2018 11:41:10 +0000 (12:41 +0100)]
Added hardening options to all build artifacts
* added PIE
* added RELO
Change-Id: Ie4ee57c987352103fd3a31e59dd3485a181545a4
Zofia Abramowska [Mon, 18 Sep 2017 14:04:10 +0000 (16:04 +0200)]
Release 0.14.13
Fix SVACE defects :
* Create explicit instantiation of StorageSerializer
Change-Id: I936187f3c452e487d5b0dca004c96e309527671f
Zofia Abramowska [Fri, 15 Sep 2017 15:07:30 +0000 (17:07 +0200)]
Create explicit instantiation of StorageSerializer
Change-Id: Iec4e24e0d9e73ecc95b7698f6a027d033a060144
Zofia Abramowska [Wed, 9 Aug 2017 10:18:25 +0000 (12:18 +0200)]
Release 0.14.12
* Fix unreachable code
* Enforce PIE globally through main CMakeLists
Change-Id: I7684b905a5817a28548375aa39f780e02ca78454
Zofia Abramowska [Mon, 7 Aug 2017 11:46:48 +0000 (13:46 +0200)]
Fix unreachable code
Log was printed after throwing an exception. This commit moves
it before throw.
Change-Id: Idb840c166052c96b013733c7cf2cb14a935a38e0