Kyungwook Tak [Thu, 16 Jun 2016 05:25:46 +0000 (14:25 +0900)]
Move async test lock into ASSERT_CALLBACK
Not to miss to wait async operation.
Change-Id: I44571a33afa7d6d64636259c108a27cf3e038ccf
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Tue, 14 Jun 2016 02:16:18 +0000 (11:16 +0900)]
Handling history detected by scan on cloud
Add table to db schema to manage separately to ordinary app scanning.
It's for giving detected/ignored/judge malwares because those work based
on history in db.
Change-Id: I78fec4b61ed7838298ec156dc2452ed7c4e64c6c
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Thu, 16 Jun 2016 04:48:46 +0000 (13:48 +0900)]
Fix assert check on delta scan test
To exclude probability of other file changed in the directory case,
checking scanned count more precisely.
Change-Id: If050ddf2b6eb6a1e453b8fa678a88357bf29e2b3
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Wed, 15 Jun 2016 07:22:04 +0000 (16:22 +0900)]
Fix test-resource and permissions on platform v3.0
Change-Id: Ifc41778f138b7cebf981cda662279434878daf28
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Wed, 15 Jun 2016 07:20:10 +0000 (16:20 +0900)]
Change db schema of package_info table
pkg_id cannot be used as primary key because the case of symlink exist
in package path. On symlink existing case, pkg id will be same on both
of symlink path and original path(resolved path) so it could be conflict
on package_info table with same pkg_id.
Change-Id: Iaf9580c5979ad6bcb32170743d47c34602295c16
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Tue, 14 Jun 2016 08:08:28 +0000 (17:08 +0900)]
File readable check by ::fopen instead of ::access
To adjust CAP_DAC_READ_SEARCH capability for scanning app directory in
platform v3.0, we cannot use ::access. Because the capability isn't
giving permission to force out all of DAC checking, but it just bypass
to check it. So if it's checked explicitly by ::access, we cannot
bypass. So we use ::fopen with "rb" mode instead.
Change-Id: If9c79f28978ab95b607f4bffbb605f57b8b51fa9
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Tue, 14 Jun 2016 07:43:48 +0000 (16:43 +0900)]
Multi user aware when getting pkg info handle
Change-Id: Ia3746304891954471d8981ed2bea2479c1967aaa
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Dongsun Lee [Tue, 14 Jun 2016 06:43:01 +0000 (15:43 +0900)]
change a malware file in app packaging to eicar.txt
Change-Id: I57ef5162cb0e752028ae412dced30b0d4e13874f
Signed-off-by: Dongsun Lee <ds73.lee@samsung.com>
Kyungwook Tak [Mon, 13 Jun 2016 11:15:59 +0000 (20:15 +0900)]
Remove useless sleeps in async cancel test
Change-Id: Icd60ef7c1e599182ea4d9d184d25febdc5961962
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Mon, 13 Jun 2016 08:38:58 +0000 (17:38 +0900)]
Add "/smack" to dir blacklist
/smack/cipso occurs unknown error from engine
Change-Id: Id0b55ceb768b6a71c65e88438e91411ad30ffcb7
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Mon, 13 Jun 2016 08:22:02 +0000 (17:22 +0900)]
Built in engine error exception converter to iloader
to convert engine internal error to string(by loaded symbol), engine
error exception converter need to loader instance so it's better to be
built in iloader virtual function for being used by both of cs / wp
loaders.
Change-Id: I382344d0b787f2863ca7e2853eb72601bae8b76a
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Mon, 13 Jun 2016 06:41:37 +0000 (15:41 +0900)]
Tracking tizen version by rpm spec macro
Change-Id: Ia115b1e800e42d25a4f2158431012620686d84f2
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
sangwan.kwon [Mon, 13 Jun 2016 06:54:56 +0000 (15:54 +0900)]
Add anchor attribute at hypertext
This is for launching browser when hypertext clicked.
Change-Id: I49cc34379ab59d8ff3d5793b5b43046d92fc7e76
Kyungwook Tak [Mon, 13 Jun 2016 06:13:19 +0000 (15:13 +0900)]
Change assert to warn on init state on test
Change-Id: Iccbdb614c48ef1036a7cf8bd1b439a0a162a6103
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Mon, 13 Jun 2016 06:13:58 +0000 (15:13 +0900)]
FixBug: error handling in async logics in content-screening.cpp
After error, exception should be thrown. If async task returned
normally, it's considered as success case and completed callback called.
Change-Id: I929ccc8c1e5ee124f74a8588a927b07f453b673a
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Mon, 13 Jun 2016 05:42:37 +0000 (14:42 +0900)]
Wait to start async client subthread until api returned
For robust calling registered callbacks, wait to start async client
subthread until api returned, controlled by handle-ext mutex lock.
Some client gets undefined behavior when registered callback called
earlier than returning async API...
Change-Id: I31ac4596cb43d2b67b9fe8095ed2a4c98779e17e
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Mon, 13 Jun 2016 05:03:05 +0000 (14:03 +0900)]
Don't allocate/construct additional std::string
file visitor is one of the most frequently running part of program so it
needed to being downsized is highly recommended
Change-Id: Ib317b9420329b1ad25b4db6310d3cce53b39f95f
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Mon, 13 Jun 2016 05:06:20 +0000 (14:06 +0900)]
Add dir blacklist which are excluded from scanning
Some files (procfs, sysfs) can occur undefined behavior when file
opened. Like sensor device file, it's blocked when file just opened.
File opening/reading could be differently implemented by engine in lower
layer of csr daemon so we cannot control all of them.
Change-Id: I157e3c21bb8e1c9e3b0afe9fbe65f97ad6eefefb
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
sangwan.kwon [Mon, 13 Jun 2016 02:48:58 +0000 (11:48 +0900)]
Delete only parent obejct in popup destructor
* In efl, if parent object deleted then child objects also deleted
automatically.
Change-Id: I21d8a6084fadb0a9c5b8293b1ee5f562bb9c2ffe
sangwan.kwon [Fri, 10 Jun 2016 09:09:17 +0000 (18:09 +0900)]
Refine label layout for multi-line
Change-Id: Id55fec0bb1c9d6d780f05a51aaa754955ea6acdd
Kyungwook Tak [Fri, 10 Jun 2016 08:04:03 +0000 (17:04 +0900)]
Add file io error handling in sample engine
Change-Id: I7dcf87abad15983444ca1595bce306612849f7d6
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Fri, 10 Jun 2016 07:57:14 +0000 (16:57 +0900)]
Skip errored directory on file system visitor
Silently skip unable to read directory stream to reduce side-effect to
whole other directories.
Change-Id: Ied216e0efcb0598251f5f7fad8d7f9abdabd17b6
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
sangwan.kwon [Thu, 9 Jun 2016 15:17:37 +0000 (00:17 +0900)]
Add webview when "More information" pressed
Change-Id: If0995f5652e791ae41b90a7f6f8ec9dd8341ffb6
Kyungwook Tak [Fri, 10 Jun 2016 05:54:21 +0000 (14:54 +0900)]
Disable test resources reset function
service cannot be restarted on both of platform v 2.4 and 3.0.
On 2.4, there's undefined behaviour when systemctl restart called.
On 3.0, test program should be run as "owner" user but it doesn't have
permission to restart system service.
Change-Id: I233a78fb81b1fc5a3835d7c013391e91c106d6b3
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Fri, 10 Jun 2016 05:51:52 +0000 (14:51 +0900)]
Use std::string on test function param
resource paths could be converted to std::string to support both of
platform v 2.4 & 3.0 by generate paths dynamically.
For this, test assertion functions need to receive std::string() param
for not to use '.c_str()' member function of std::string to all of
callers.
Change-Id: I3780673a757204fea7be1846726e8f15f14c449b
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Fri, 10 Jun 2016 04:47:09 +0000 (13:47 +0900)]
Don't check whether file is removable
Client will get remove failed error code from csr_cs_judge_detected_malware
if the target is unremovable
Change-Id: Ic73ea49459afcc0407766a1d065dd92f262a3155
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Fri, 10 Jun 2016 02:17:06 +0000 (11:17 +0900)]
Don't return malware handle when the file removed
Change-Id: I61aadc3b3a8db53bf57fedd131548429c51b2ac3
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Thu, 9 Jun 2016 10:55:46 +0000 (19:55 +0900)]
Add smack rule for accessing sd card
Change-Id: I1da30843d179ffc84e47cf7a819de5f539ff6265
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Thu, 9 Jun 2016 05:00:48 +0000 (14:00 +0900)]
Add warn_if on test
Change-Id: I7a066ad8509bdeb1f0afe4afd5a8ff6b3b39d80a
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Thu, 9 Jun 2016 09:12:06 +0000 (18:12 +0900)]
Add TC on content screening async
Change-Id: Id72a3f05730b603e64c827393e92e6f4417db0cc
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Thu, 9 Jun 2016 09:06:59 +0000 (18:06 +0900)]
Call callbacks only when callable on async client
Change-Id: Iadb78263064e8ef71cccfebf607a55341275d06e
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Thu, 9 Jun 2016 06:26:19 +0000 (15:26 +0900)]
Support test app management on tizen v 3.0
Change-Id: Ib5b99dcbc3ae021ca5c1bee53b78be88f6b654e8
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Thu, 9 Jun 2016 07:56:49 +0000 (16:56 +0900)]
Define pie option for ASLR properly
link flags cannot be defined on source's property setter
Change-Id: I32e8cb7e25f54ddd13149902ec7ae695e7125cc6
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Wed, 8 Jun 2016 08:38:06 +0000 (17:38 +0900)]
Move test resource pkgs to give floor label
Change-Id: Ic815a2b3b4fda4a818c996af493b4962b1bd86a1
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Thu, 9 Jun 2016 06:16:52 +0000 (15:16 +0900)]
Connection on onMessageProcess captured as copy
Connection can be abnormally closed by the peer and with
std::shared_ptr<Connection> &, it's hardly guarantee validity of the
reference. So we capture std::shared_ptr<Connection> as copy so
increment shared pointer's reference so as to guarantee validity of
connection. Catch exceptions when using connection in process of
onMessageProcess because the connection could be already closed by the
peer.
Change-Id: I391bae78cf663b875b96124f8356d27a38a97dc6
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Thu, 9 Jun 2016 06:20:39 +0000 (15:20 +0900)]
Fix order of params in ASSERT_IF
expected value should follows actual value
Change-Id: Icdc2dfca7f4ebdafd0f23349d8b31f24a7abc78b
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Thu, 9 Jun 2016 04:06:34 +0000 (13:06 +0900)]
Fix malware file to standard virus signature
Change-Id: If9a29eb9c90ce22ea9c5f734874c5a41106dad83
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Thu, 9 Jun 2016 02:20:26 +0000 (11:20 +0900)]
Add smack rule for dbus
Change-Id: Ia1d48b6c587489d92798e6a50a6fd674962d1f1f
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Dongsun Lee [Thu, 9 Jun 2016 00:03:02 +0000 (09:03 +0900)]
Sample engine build featuring
Change-Id: If874c62e3cb6de543a14b9fe37c5900b5d91f149
Signed-off-by: Dongsun Lee <ds73.lee@samsung.com>
Kyungwook Tak [Wed, 8 Jun 2016 08:00:54 +0000 (17:00 +0900)]
User-aware when detect app on platform v 3.0
Change-Id: I95456b49727481578a29230ea0fa2da09bb5a1a3
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Wed, 8 Jun 2016 07:27:52 +0000 (16:27 +0900)]
Canonicalize paths on db history getters
Change-Id: Icdf4a1487df644ac662469d1af4729766c17c739
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Dongsun Lee [Wed, 8 Jun 2016 22:55:48 +0000 (07:55 +0900)]
add smack rules for system::use_internet
Change-Id: I3741686846d046c45afff8228043f948a06d1104
Signed-off-by: Dongsun Lee <ds73.lee@samsung.com>
Dongsun Lee [Wed, 8 Jun 2016 13:25:49 +0000 (22:25 +0900)]
set CSR_STATE_ENABLE as a default value
Change-Id: I800d2ab47eb60c4a6f79b279f6b1cbd16a372339
Signed-off-by: Dongsun Lee <ds73.lee@samsung.com>
Kyungwook Tak [Wed, 8 Jun 2016 05:27:42 +0000 (14:27 +0900)]
Exclude symbol of mainloop/socket from common lib
Mainloop class and Socket class is used only as private member in other
classes in common lib so it could be hidden symbol.
Change-Id: Id32237cb00a9115fc84d95294e1846e3ddc341da
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Wed, 8 Jun 2016 04:50:58 +0000 (13:50 +0900)]
Fix not-following tizen coding rule cases
Checked by cpplint_tizen_160418.py
Change-Id: Ib33fd5aa3146df7b011061153df843ef884ff43c
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Wed, 8 Jun 2016 04:25:07 +0000 (13:25 +0900)]
Use custom resolvePath() instead of ::realpath()
::realpath() expands all symbolic links. When getting scannable file, we
have to focus on symbolic link itself because we cannot remove every
symbolic links when it comes to the regular file in scannable list even
though symbolic link path is in parameter.
Change-Id: If0d69419d9103a6ecff9ea56afdaa21b7e03613f
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Wed, 8 Jun 2016 02:17:51 +0000 (11:17 +0900)]
Fix bug: File read permission check is missed
when get stat of file, file read permission should be checked
additionally. ::stat() function doesn't require permission on the file
itself but require all permissions of the directories in path that lead
to the file.
Change-Id: Ia91c188fe20a90784ebad8109930ff3726f5ca72
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Wed, 8 Jun 2016 01:44:26 +0000 (10:44 +0900)]
Remove additional callback on new/close callback
On lower version of Tizen 3.0, crash occured here if callback not
callable(nullptr). We don't use this additional callback so for now just
remove this feature.
Change-Id: Ib378566b6f803749fe7735fb315474f5bd2c71b3
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Tue, 7 Jun 2016 06:58:29 +0000 (15:58 +0900)]
Check connection validation before write response
If client disconnect connection while server is handling the client's
request, server could write response to invalid connection by
connection->send() and crash occured. To prevent it, (client's abnormal
operation affect server) connection validation check is performed before
write on it.
Change-Id: I4c02fb0b40a6fd3a50e715a619334a3e290957f0
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Tue, 7 Jun 2016 08:08:00 +0000 (17:08 +0900)]
[CAPI description changed] The @a -> @a
Change-Id: Ie7664b6d92fb5774b7aae2ea186b11a117777756
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Tue, 7 Jun 2016 06:27:44 +0000 (15:27 +0900)]
Check & Clean all TODOs.
Socket::create added to divided domain socket creation and client socket
connection easily.
Mutex locks in mainloop and service are not needed because callback
add/erase are done by single thread (main thread) only.
Change-Id: I56a18cb81218908f79e130186c11ec206955240c
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Tue, 7 Jun 2016 05:51:51 +0000 (14:51 +0900)]
Hide symbol of common lib
Change-Id: I8fd63c172b13380ccf8e810fee7c25ebafef0813
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
sangwan.kwon [Tue, 7 Jun 2016 07:32:48 +0000 (16:32 +0900)]
Fix bug : popup does not show as proper size
[bug]
- CMakeList ADD_DEFINITION visibility problem
- It just add definition to source not CMakeList
[solve]
- change ADD_DEFINITION to SET
Change-Id: I9ef8e59b932c997f0030d261a5ec9d5c476e8a57
Kyungwook Tak [Tue, 7 Jun 2016 07:11:17 +0000 (16:11 +0900)]
Fix build break on 3.0 emul. (TRUE -> EINA_TRUE)
Change-Id: I09a90f5b92e87d08b63b5e629daadbc90e232795
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Tue, 7 Jun 2016 05:19:15 +0000 (14:19 +0900)]
Fix bug: min core num definition missed
Set minimun core num in internal test of cpu usage manager
Change-Id: Ie4621885eed7faf3c05325e5d5d039882de67e9b
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Tue, 7 Jun 2016 05:11:05 +0000 (14:11 +0900)]
Macro should have any value in rpm spec
Change-Id: I4dac3d552d3732f50dd9f80a53b8243de5254bf9
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Tue, 7 Jun 2016 04:46:58 +0000 (13:46 +0900)]
[Engine API Added] csre_cs_scan_app_on_cloud_supported
Change-Id: I032b90331cbcbf82dd3e3028b7abb393f92779db
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Tue, 7 Jun 2016 04:08:06 +0000 (13:08 +0900)]
Custom exception class not used in derived form
Declare exceptions not per error codes. Just give error code parameter
to the single Csr::Exception class. This architecture is needed for
async client when converting returned error code to exception.
Async scanning client side exception-handling can be done with changed
exception. Callback on exceptional cases(cancelled, error occured) can
be handled in catch statement.
Change-Id: Ic0a0e959fe8e851ea12a09ff9bbcde1ed2659e40
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Fri, 3 Jun 2016 08:07:16 +0000 (17:07 +0900)]
Keep single worker thread in async client
Change-Id: I6265e7bc642fa5b57be5b7cbdc6b385fb76b3f0a
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
sangwan.kwon [Tue, 7 Jun 2016 01:54:35 +0000 (10:54 +0900)]
Set app properties in popup
* Show app icon image.
* Set app version and label.
Change-Id: Iccfc93c1af0cb9cfc3b834298aa32448a777ad85
sangwan.kwon [Thu, 2 Jun 2016 07:30:28 +0000 (16:30 +0900)]
Refine popup layout for linking to web page
* "More information" pressed, popup should link to detailed web page
* For this, seperate popup text to several label
Change-Id: I7832e0594a268a169dd6ec0304933b4adc442397
Kyungwook Tak [Fri, 3 Jun 2016 05:33:02 +0000 (14:33 +0900)]
Support detailed url base usage
detailed url base is inserted in rpm spec definition.
Detailed url shown to client will be generated by...
If it turned on (by giving 1 to with_detailed_url_base), concatenated with
given detailed url base + malware name.
Else it turned off (by giving 0 to with_detailed_url_base), just getter engine
API used as it was.
Change-Id: I6c075f407d3e23db8b0ffa3eff8e75f1110c2286
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
sangwan.kwon [Thu, 2 Jun 2016 08:41:27 +0000 (17:41 +0900)]
Fix package info class return value
* If pkginfo could not get information,
* return Unknown value.
Change-Id: I25b3c05a694b4830aa573cf185f8574b6c19671d
sangwan.kwon [Thu, 2 Jun 2016 07:55:51 +0000 (16:55 +0900)]
Divide file path to file name and extra in popup
Change-Id: I31599aa02136b8352013ed2b161e12105a40331a
Kyungwook Tak [Thu, 2 Jun 2016 10:41:15 +0000 (19:41 +0900)]
Set initial value as null to detected handles
Engine lib can be implemented as not to set detected handle to nullptr
explicitly if there isn't malware detected. For that case, we need to
set initial value of detected handle to nullptr explicitly.
Change-Id: If3b54f2b8b7bdfa8616b57ba171cf55c9f8e92ef
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Thu, 2 Jun 2016 10:40:18 +0000 (19:40 +0900)]
Engine activation status check in loaders
Change-Id: Ie33f5218584eb9ee992147dce7c79339ea5dbe29
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Thu, 2 Jun 2016 09:12:59 +0000 (18:12 +0900)]
[Engine API Changed] engine handles are removed
engine handles are replaced with context handles.
Change-Id: I8a088ecf1427b69d9f6cee3f5c88a79c6cd49648
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Dongsun Lee [Fri, 3 Jun 2016 01:10:29 +0000 (10:10 +0900)]
Added @partner and @platform tags to enum type
Change-Id: Ibe4a0db88c59268df1fe07b50eb4e2881efcf0de
Signed-off-by: Dongsun Lee <ds73.lee@samsung.com>
Dongsun Lee [Thu, 2 Jun 2016 11:07:05 +0000 (20:07 +0900)]
Add api description and add tags for @partner and @platform
Change-Id: I2c3d85be43295db548cd5a3bacc0e8f909b402ac
Signed-off-by: Dongsun Lee <ds73.lee@samsung.com>
Dongsun Lee [Thu, 2 Jun 2016 10:28:35 +0000 (19:28 +0900)]
remove CAPI_CSR_FRAMEWORK_TYPES_MODULE from doc
Change-Id: I7c12b57c435bed664702a1cd2bb9b92e2a1f9d3a
Signed-off-by: Dongsun Lee <ds73.lee@samsung.com>
Kyungwook Tak [Thu, 2 Jun 2016 05:46:31 +0000 (14:46 +0900)]
Handle the case of engine not exist
Change-Id: Ic9312ec7afb571e2f78a4a3382ef56527fb65344
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Dongsun Lee [Wed, 1 Jun 2016 23:25:04 +0000 (08:25 +0900)]
modify API parameter name
- is_on_cloud -> scan_on_cloud in csr_cs_set_scan_on_cloud()
Change-Id: Ida82cb646c20f0c00e87b0becdae7a5254a8837e
Signed-off-by: Dongsun Lee <ds73.lee@samsung.com>
Kyungwook Tak [Thu, 2 Jun 2016 01:21:44 +0000 (10:21 +0900)]
[Engine API Changed] Remove detected_get_timestamp
It isn't provided by engine lib. So just stamp time before start
scanning request to engine in cs-logic side.
Change-Id: I2547232bf372795c4fecc9efcccd064b897db1c7
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Wed, 1 Jun 2016 09:48:50 +0000 (18:48 +0900)]
Merge engine ro res dir and engine dir
Change-Id: Idc1b99c832c1f88bfc87e7feda1e6bca54c07375
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Wed, 1 Jun 2016 09:28:06 +0000 (18:28 +0900)]
Move sample engine lib to test package
TODO: handle for the case of engine not exist.
CSR_ERROR_ENGINE_NOT_EXIST error code should be returned.
Change-Id: I0c11c7a89cddc4abb5efb72f852302e98e97de56
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
sangwan.kwon [Wed, 1 Jun 2016 08:55:09 +0000 (17:55 +0900)]
Add getLabel and getVersion to package-info class
Change-Id: I02d0cfa05c8313659d146ec4719c985911e1a1bc
sangwan.kwon [Wed, 1 Jun 2016 05:40:15 +0000 (14:40 +0900)]
Refine popup class and implement detail layout
* Implement detail layout according to UI guide.
Change-Id: I137d65f08136fd5ef4ec13a364f23d5230e83588
Kyungwook Tak [Wed, 1 Jun 2016 09:04:53 +0000 (18:04 +0900)]
Change engine directories
engine lib : ${ro_data_dir}/csr/engine
engine ro resource: ${ro_data_dir}/csr/engine_res
engine rw data : ${rw_data_dir}/csr/engine_data
Change-Id: I4b3be593702c15ddf137ab4f0d5f020cdb0b9920
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Wed, 1 Jun 2016 07:50:04 +0000 (16:50 +0900)]
Daemon exit on idle for 60 seconds
idle timeout time of csr service and popup service can be set on spec file.
Before stop dispatch loop in Mainloop class instance, it checks that
it's really idle on upper layer either by idle checker registered by
service. e.g., if there can be running task in thread pool(workqueue) in
server-service but ::epoll_wait loop can be timed out when task in
thread pool takes more time than ::epoll_wait loop timeout time.
In case above, we cannot guarantee the connection instance is valid
because it's dtor in service's dtor which is same layer with thread pool
instance.
Change-Id: I5f7940a55b38c339b6c8b6e2de5ec3407a48e029
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Dongsun Lee [Wed, 1 Jun 2016 04:32:34 +0000 (13:32 +0900)]
[CAPI Changed] Enum value names and scan cloud
- enum value changes for csr_wp_ask_user_e, csr_wp_user_response_e,
csr_cs_ask_user_e, csr_cs_core_usage_e, and csr_cs_user_response_e
- API description changes for csr_cs_malware_list_get_malware and
some enums in csr-content-screening-types.h
- Parameter(bool) added to scan on cloud option setter API for turning
on and off the option.
Change-Id: I05672483fda2539b615dcb3db29a27cba703fe8f
Signed-off-by: Dongsun Lee <ds73.lee@samsung.com>
Kyungwook Tak [Tue, 31 May 2016 07:05:51 +0000 (16:05 +0900)]
Canonicalize by ::realpath on server side
Client cannot call ::realpath because file scanning is not working with
client permission but server permission.
Client just make path to absolute (prepend current directory if relative
path comes in to parameter) and give them to server to get canonicalized
file set.
It's same to files_async and dirs_async but we need to erase
subdirectory in dirs_async case after canonicalization done.
Change-Id: I15ddd7e8816ee068c9e4439eea51bbe8c0a2602b
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Tue, 31 May 2016 09:12:58 +0000 (18:12 +0900)]
Async handle only take one scanning in background
Keep out another asynchronous scanning request if it's running.
Change-Id: Id44e8da6648094205436c41ec6b6042145ea64b9
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Dongsun Lee [Tue, 31 May 2016 09:08:25 +0000 (18:08 +0900)]
API description change and new error code(CSR_ERROR_BUSY) added
- error code CSR_ERROR_BUSY added
- TIZEN_ERROR_CSR value changed
- stdbool.h removed
- explanation added about how to destroy csr_cs_malware_h in csr_cs_detected_cb()
Change-Id: I7825855fed3b207521bd65afd933b4757012d277
Signed-off-by: Dongsun Lee <ds73.lee@samsung.com>
Kyungwook Tak [Mon, 30 May 2016 09:17:53 +0000 (18:17 +0900)]
Fix svace defects
Don't use asctime because of thread-unsafe detection category.
Handle null dereferencing cases in cs-logic.
Change-Id: Icacb98014d5296f13470a07813c67bb8abb322a6
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Tue, 31 May 2016 02:10:50 +0000 (11:10 +0900)]
Add popup package info class
Package information needed for displaying on popup.
For now, only icon info is needed.
Change-Id: I01485bc24da86ff825de6b2ced7bdfe4da46d5c3
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Tue, 31 May 2016 02:17:05 +0000 (11:17 +0900)]
Don't check engine state when getting engine info
Change-Id: I58f99c5da67d7c509c450a33dd2a366b059b972f
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Tue, 31 May 2016 06:39:30 +0000 (15:39 +0900)]
Add linker options for adding sample engine libdir
Change-Id: Ia8b0343547beb8bd6c580ee2b60f08b932738966
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Dongsun Lee [Tue, 31 May 2016 05:13:00 +0000 (14:13 +0900)]
APIs and description changed for ACR
- enum name change : CSR_ENABLE -> CSR_STATE_ENABLE, CSR_DISABLE -> CSR_STATE_DISABLE
- error code change : CSR_ERROR_UNKNOWN -> CSR_ERROR_SYSTEM
- user_data parameter after other parameters in callback functions
- error description for error callback
- @pre tag added in async scanning method
- csr_cs_cancel_scanning description changed
- @detail tag right after @brief
Change-Id: Ib0c60f40a43fd14ba10e5f2758d1ebc7f3512e23
Signed-off-by: Dongsun Lee <ds73.lee@samsung.com>
Kyungwook Tak [Mon, 30 May 2016 10:25:32 +0000 (19:25 +0900)]
Fix CAPI description according to ACR review
0) Reinforce more detail descriptions
1) Decalre return error code appropriately
CSR_ERROR_DB, CSR_ERROR_FILE_SYSTEM, CSR_ERROR_ENGINE_PERMISSION,
CSR_ERROR_NOT_SUPPORTED
2) Default message descripted on popup message setters
3) Start with verb on every @brief tags
4) fix typo (e.g., pakcage)
5) Memory management description fixed refered to general guideline
6) Add missing PERMISSIONDENIED return error code list to
csr_cs_scan_data()
7) Change API name
csr_cs_malware_get_malware_name() -> csr_cs_malware_get_name()
8) Add description for content screening callback functions
Change-Id: I6bedb74d9ba4ece07576abe50629f6d5cdb9f592
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Tue, 31 May 2016 01:43:53 +0000 (10:43 +0900)]
Sync smack label for api privilege with ACR doc
remove dash('-')
csr::api-cs -> csr::apics
csr::api-wp -> csr::apiwp
csr::api-admin -> csr::apiadmin
Change-Id: I8a16ece4925e062889bc731c83b209f894de18a8
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Dongsun Lee [Mon, 30 May 2016 08:10:47 +0000 (17:10 +0900)]
Remove 'p' prefix in API parameters and API name changed
- Remove 'p' prefix in API parameters
- parameter name changed : detected -> malware
- API name changed: csr_cs_malware_list_get_detected -> csr_cs_malware_list_get_malware
Change-Id: I81b3ee83b3c2f5b6dddc57254fd58050f790b0b1
Signed-off-by: Dongsun Lee <ds73.lee@samsung.com>
Kyungwook Tak [Mon, 30 May 2016 07:39:37 +0000 (16:39 +0900)]
Don't check file check when canonicalization
On client side, it's meaningless to check permission for file
access/remove when resolving absolute path for scanning because file
scanning isn't done with client's credential but server's cred. So when
resolving absolute path, it just append cwd if first char of path isn't
'/'.
Change-Id: Id453dc23553b20d88a91a96684bb010ffd4be27e
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Mon, 30 May 2016 02:25:23 +0000 (11:25 +0900)]
Security configurations with platform version
Change-Id: I48782293b719e64bcd1bffb7b2f239fc036b0b3e
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Dongsun Lee [Mon, 30 May 2016 04:29:06 +0000 (13:29 +0900)]
change API name : csr_cs_scan_cancle->csr_cs_cancel_scanning
Change-Id: Icffcf988b8ddecba4b9829d64cfd5ad51f2ec816
Signed-off-by: Dongsun Lee <ds73.lee@samsung.com>
Kyungwook Tak [Fri, 27 May 2016 11:09:47 +0000 (20:09 +0900)]
Catch exception system apply on server service
Additionally, EXCEPTION_GUARD_CLOSER isn't needed anymore because all of
commands can handle results as optionally so only error code needed to
be serialized when exception catched.
Change-Id: I3bc2f58220b32f88e9fc66abb854b9f99274825d
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Fri, 27 May 2016 10:32:49 +0000 (19:32 +0900)]
Make all of result as optional when returned error
Handle optional return values needed for server to catch thrown
exceptions in service level because all commands should be treated
generically.
Change-Id: Ieef072a382fcd0add195fa6747c31473901337e2
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Fri, 27 May 2016 08:39:46 +0000 (17:39 +0900)]
Don't bind process to make task for pushing thread pool
Sometimes crash occured on dtor of binded std::function after moved to
thread pool task queue. We can avoid it by using inbuf as shared ptr so
as to being delivered into lamda capture.
Change-Id: I76d68d91ca75bdc0c37bfb5b125a1e2956744010
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Fri, 27 May 2016 08:37:28 +0000 (17:37 +0900)]
Don't call seekp for every log print
ostringstream is always newly created instance so no needed to being initialized
Change-Id: I4a9330077dca0119010daab661d75d9e134658b6
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Fri, 27 May 2016 08:38:59 +0000 (17:38 +0900)]
log level changed for file read EACCES case
It can be generally occured when scan dir
Change-Id: I987b5768ccf7a714c71dddec137c3bd1f3517e74
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Fri, 27 May 2016 09:15:45 +0000 (18:15 +0900)]
Dir path canonicalize before async op dispatch
Canonicalization can throw exception related file system e.g., file not
exist / permission denied. Client can receive this error directly by
return code of dir_async API
Change-Id: I85db1a4a84ed0bd419cac35fb2ad67f4a5bac7ef
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>