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>
Kyungwook Tak [Fri, 27 May 2016 07:26:21 +0000 (16:26 +0900)]
Use ASSERT_SUCCESS in engine manager API test
Change-Id: Icf15c930b791262756d5ec771f937bef9e9c245b
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Fri, 27 May 2016 07:27:40 +0000 (16:27 +0900)]
Add noexcept and this-> when accessing class members
Change-Id: I9cba3160da5451c5ef07ddd8bd5f242e3d74f1ad
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Fri, 27 May 2016 00:38:10 +0000 (09:38 +0900)]
Exclude unremovable app from scanning list
Refactor file systems for handling additional conditions more easily.
If scan request for file in unremovable app, it will return permission denied.
When getting scannable list, unremovable app isn't inserted to list silently.
Change-Id: Iea660092293460486073b7bd862c521a48e247d8
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Dongsun Lee [Thu, 26 May 2016 10:58:12 +0000 (19:58 +0900)]
Changes API names for ACR
[Callback related changed API]
- csr_cs_on_detected_cb --> csr_cs_detected_cb
- csr_cs_on_completed_cb --> csr_cs_completed_cb
- csr_cs_on_cancelled_cb --> csr_cs_cancelled_cb
- csr_cs_on_error_cb --> csr_cs_error_cb
- csr_cs_on_file_scanned_cb --> csr_cs_file_scanned_cb
- csr_cs_set_callback_on_detected --> csr_cs_set_detected_cb
- csr_cs_set_callback_on_completed --> csr_cs_set_completed_cb
- csr_cs_set_callback_on_cancelled --> csr_cs_set_cancelled_cb
- csr_cs_set_callback_on_error --> csr_cs_set_on_error_cb
- csr_cs_set_callback_on_file_scanned --> csr_cs_set_file_scanned_cb
[Removed API]
- csr_get_error_string
[Changed API]
- struct: csr_cs_detected_h --> csr_cs_malware_h
- struct: csr_cs_detected_list_h --> csr_cs_malware_list_h
- csr_cs_detected_get_severity --> csr_cs_malware_get_severity
- csr_cs_detected_get_malware_name --> csr_cs_malware_get_malware_name
- csr_cs_detected_get_detailed_url --> csr_cs_malware_get_detailed_url
- csr_cs_detected_get_timestamp --> csr_cs_malware_get_timestamp
- csr_cs_detected_get_file_name --> csr_cs_malware_get_file_name
- csr_cs_detected_get_user_response --> csr_cs_malware_get_user_response
- csr_cs_detected_is_app --> csr_cs_malware_is_app
- csr_cs_detected_get_pkg_id --> csr_cs_malware_get_pkg_id
- csr_cs_dlist_get_detected --> csr_cs_malware_list_get_detected
Change-Id: I35def7f3f106a38f6a1c1ed2896620f3d1fed9f3
Signed-off-by: Dongsun Lee <ds73.lee@samsung.com>
Dongsun Lee [Thu, 26 May 2016 10:38:52 +0000 (19:38 +0900)]
add doc directory and document headers
Change-Id: Ib460337c9992cedb3c8201719e593665b9a3f5f7
Signed-off-by: Dongsun Lee <ds73.lee@samsung.com>
Dongsun Lee [Thu, 26 May 2016 09:49:50 +0000 (18:49 +0900)]
API descryption changes for ACR
- Added @retval CSR_ERROR_PERMISSION_DENIED for privileged APIs
- Fix some TYPOs
- Changes @brief strings to start with a Uppercase character
- Changes #include "~~" to #include <~~>
- Change parameter description with "@a"
- Add tagging for csr_engine_h
Change-Id: I514ac0a3f859ca73efd01f38832a8c8cb2389a44
Signed-off-by: Dongsun Lee <ds73.lee@samsung.com>
Kyungwook Tak [Thu, 26 May 2016 07:19:53 +0000 (16:19 +0900)]
[CAPI Changed] Client should free returned cstring
Change-Id: I825f187f87a6f47b8fef849956ce252543f16d60
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Dongsun Lee [Thu, 26 May 2016 06:28:01 +0000 (15:28 +0900)]
change API header file names
[src/include/csr directory]
- content-screening-types.h => csr-content-screening-types.h
- content-screening.h => csr-content-screening.h
- engine-manager.h => csr-engine-manager.h
- error.h => csr-error.h
- web-protection-types.h => csr-web-protection-types.h
- web-protection.h => csr-web-protection.h
[src/include/csre directory]
- content-screening-engine-info.h => csre-content-screening-engine-info.h
- content-screening-types.h => csre-content-screening-types.h
- content-screening.h => csre-content-screening.h
- error.h => csre-error.h
- web-protection-engine-info.h => csre-web-protection-engine-info.h
- web-protection-types.h => csre-web-protection-types.h
- web-protection.h => csre-web-protection.h
Change-Id: Iaeb2f9a02994824ebc8d5d5b6223d5db8c22b53e
Signed-off-by: Dongsun Lee <ds73.lee@samsung.com>
sangwan.kwon [Thu, 26 May 2016 06:01:43 +0000 (15:01 +0900)]
Fix white-space character in popup
* elm_object_text does not recognize '\n'
* So, change to '<br>'
Change-Id: Ic5dd833dac344b74f9a1b23e7a946dff29e7aea3
Kyungwook Tak [Wed, 25 May 2016 07:39:32 +0000 (16:39 +0900)]
Convert engine ec (file not found) to capi ec
When processing async request, engine returned internal error if
file permission changed/removed after scannable list provided by server.
Only file system related error code is ignored on async logic so it
would be considered as another error if it comes to engine internal.
So file not found ec in csre/error.h should be converted to capi ec.
Change-Id: I685e23d04e947d9cbe9c6e1dfee410a7ef8dc4e3
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Wed, 25 May 2016 06:33:18 +0000 (15:33 +0900)]
Fix crash in onMessageProcess
Crash rarely occured when bind dtor in onMessageProcess.
Traced by gdb and there's crash when dtor std::vector(RawBuffer)
parameter.
So don't write code tightly in order to value used as rvalue for
automatically moved. Assign lvalues to inbuf/outbuf/task and move it by
std::move when needed manually.
Change-Id: I2b381331546f1b24c0c500851725376cf100a1cc
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Wed, 25 May 2016 02:35:24 +0000 (11:35 +0900)]
Change sample engine dir to inside of ro csr dir
Change-Id: Iea8f21b1d3a41119757031dc75a7383e5e102533
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Wed, 25 May 2016 04:52:40 +0000 (13:52 +0900)]
Use pkg path to extract metadata for app
When scan file requested on file which is in app and no perm to read,
app metadata cannot extracted. It could be fixed automatically if
default smack rule inserted(for reading all of app directory), but
there's a lot of logics in app directory and we can be safe by this
additional fence.
Change-Id: Id244933dcd70b41d05a5258857a1fd6898b22213
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Wed, 25 May 2016 04:50:56 +0000 (13:50 +0900)]
DB detected item cleanup only when history exist
When scan heavily at first time, it's too much overhead.
Delete item only when needed.
Change-Id: Iefa55b5e9b04f9a3eb5ea25007b1ee6e42690bfd
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Wed, 25 May 2016 04:38:03 +0000 (13:38 +0900)]
Ignore all file system exceptions in dir scanning
In async logic, the scan file list is provided by server so client just
use it. So this exceptions can be occured when the file is removed /
changed between the time from server extracts scannable files to scan
the each file.
Change-Id: Ic6c0d3ac2f855663c3bba7532b2f3942549814bd
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Wed, 25 May 2016 04:37:05 +0000 (13:37 +0900)]
Print log of command id that service received
Change-Id: I2b4173d1e5405c0d1fe61367aa9a09383838dc7d
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Wed, 25 May 2016 04:31:19 +0000 (13:31 +0900)]
Return SchemaVersion::NOT_EXIST
Instead of throw exception, return enum value which means not exist when
get schema version in Db::Manager ctor.
And don't throw exception in Db::Statement dtor. it's useless and
uncatchable.
Change-Id: I0f93df10d21d8d0685c3b9a25b0aa5fc4406b0aa
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Wed, 25 May 2016 04:29:46 +0000 (13:29 +0900)]
Canonicalize path when scan file.
Throw appropriate exception when file not found on canonicalization.
Change-Id: Iaba4e51c124c7d47188b288260ca8175260edcfe
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Wed, 25 May 2016 04:29:00 +0000 (13:29 +0900)]
[BugFix] open and not close fd in cs sample engine
Change-Id: I4a7d71acfccd862362716adbded0e66eedd7a7e9
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Tue, 24 May 2016 02:57:11 +0000 (11:57 +0900)]
Fix 64-bit arch portability issue
With time_t type serialization overloading function...
in 64bit arch: compile error. conflicted with int64_t type function.
in 32bit arch: works fine.
Without time_t type serialization overloading function...
in 64bit arch: works fine.
in 32bit arch: compile error. time_t type overloaded function not found.
So time_t type serialization overloading is removed and it's converted
to int64_type when serialize/deserialize. Then it works fine on both of
architectures
Change-Id: Ic85d9e1de31fd6d6b64b57f3f8dcaae54f5bb290
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Tue, 24 May 2016 01:51:24 +0000 (10:51 +0900)]
Add cynara backend
For now, smack backend & 2.4 platform version base selected.
access control backend is selected by macro defined in top of the spec
file. pkgmgr API is bit different between 3.0 and lower because of
multi-user so it's branched by preprocessor by PLATFORM_VERSION_3 definition.
Change-Id: I1b587e7a9fd8c8e120be53d6065b03b6d5aed4d9
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Dongsun Lee [Thu, 19 May 2016 02:23:29 +0000 (11:23 +0900)]
Add TC: async scan and engine management
Change-Id: If67eeb7000c15442939c69468577bd3ae0b12aad
Signed-off-by: Dongsun Lee <ds73.lee@samsung.com>
Kyungwook Tak [Mon, 23 May 2016 08:00:10 +0000 (17:00 +0900)]
Check pkg id by pkgmgr-info API additionally
Change-Id: I614e244da92bc68d38c5719dfac8f8959a672ffe
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Mon, 23 May 2016 05:27:04 +0000 (14:27 +0900)]
Return no task error in case of nothing to stop
Change-Id: I5fc3740c1e990eec816fff7d19a476204d04ea2d
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Mon, 23 May 2016 01:46:20 +0000 (10:46 +0900)]
Set dir timestamp at the end of scan dir
Change-Id: Ib83e33ad175857d6dd4ec77e94a0432bdcd86405
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Dongsun Lee [Fri, 20 May 2016 07:03:17 +0000 (16:03 +0900)]
network bug fix for large data transportation
- bug fix of bucket in binary-queue
- write data size before writing real data
Change-Id: Ia63fc767484dd31228927038208fb106941a154c
Signed-off-by: Dongsun Lee <ds73.lee@samsung.com>
Kyungwook Tak [Mon, 16 May 2016 11:21:07 +0000 (20:21 +0900)]
Turn on feature: engine state (enable / disable)
Change-Id: Ife9f6930211854e37fb5419c882e89a4ebe36e5d
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Thu, 19 May 2016 07:52:49 +0000 (16:52 +0900)]
Do not wait for complete event when uninstall app
Sometimes timeout callback behaves undefine way.
Even though pkgmgr_client_uninstall API returns success and it's
uninstalled really on pkgmgr server side but timeout callback runs
immediately several times on csr server side.
So we just believe pkgmgr_client_uninstall returned value. Other pkgmgr
client API users(settings, homescreen, menubar, etc.) uses it like
this(without g_main_loop and end callback).
Change-Id: I5e5b0894303752ae33bb3e9e4f7232d8e79f2cb4
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Dongsun Lee [Tue, 17 May 2016 01:43:53 +0000 (10:43 +0900)]
[CAPI Changed] add ec and remove fields in enum
error code added: CSR_ERROR_FILE_CHANGED
error code typo fixed: CSR_ERROR_ENGINE_DISABLED
enum field removed from csr_cs_response_e: CSR_CS_SKIP, CSR_CS_IGNORE.
CSR_CS_IGNORE -> replaced with CSR_CS_PROCESSING_ALLOWED
CSR_CS_SKIP -> replaced with CSR_CS_PROCESSING_DISALLOWED
Change-Id: I3fb45053bb3e541b36c4027c1a2f738f8ac86dc7
Signed-off-by: Dongsun Lee <ds73.lee@samsung.com>
Kyungwook Tak [Wed, 18 May 2016 13:56:56 +0000 (22:56 +0900)]
Determine file changed by changed time
For modified time (st_mtime field in struct stat), it isn't updated on
tpk package in same cases. The modified time is fixed on when it
packaged, so use changed time instead.
Change-Id: Id8ea85ebca8a8c8b5fec224b936c538c44807592
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Thu, 19 May 2016 06:06:53 +0000 (15:06 +0900)]
Fix indexing of db schema and add foreign key pragma
Change-Id: I4cbf6513b43aea48688a42669235bce67331d74e
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Thu, 19 May 2016 05:09:03 +0000 (14:09 +0900)]
See fileInAppPath when judge status of app
Change-Id: I02689184f134bca02255bce9eb629f5f7c0d0f06
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Wed, 18 May 2016 14:53:04 +0000 (23:53 +0900)]
Add smack rule for uninstall app
Change-Id: I0e30ef0d8f4a2675f51af7fd230a917d6c9681c8
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Wed, 18 May 2016 14:50:29 +0000 (23:50 +0900)]
Make header for common test resource definition
Change-Id: I71f20bc2a78465e5e38b723b0d669545a989ba6a
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Wed, 18 May 2016 02:57:52 +0000 (11:57 +0900)]
Redesign db schema for app history handling
Change-Id: I75e0ce4ada946b3c3ad4b39fdabb09c6a3bbcd48
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Tue, 17 May 2016 08:38:35 +0000 (17:38 +0900)]
Fix failed test cases and make test common lib
Test common library for all of test binaries
Change-Id: I41a72a170050e1c86662c5c75c0e1fc1b4ae131e
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Tue, 17 May 2016 02:12:35 +0000 (11:12 +0900)]
Don't return ignored items as detected
Change-Id: Ieba3da918ab3f28ea5875047cc8ba7fd3bdec2ba
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Mon, 16 May 2016 10:21:35 +0000 (19:21 +0900)]
Keep single instance of loaders and db manager
loaders and db manager instance is created in service layer and being
delivered as reference to logics respectively.
loader global init/deinit in ctor/dtor and can be re-plugged by 'reset'
member function. This will be used for switching engine library later.
Change-Id: I76f6cd2571de0a09a9394df5d0c8252b47fa8270
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Dongsun Lee [Tue, 17 May 2016 04:31:15 +0000 (13:31 +0900)]
add TCs for web protection
Change-Id: I546c2b856327687a3cf877c26fae4f11eca43971
Signed-off-by: Dongsun Lee <ds73.lee@samsung.com>
Dongsun Lee [Fri, 13 May 2016 02:28:16 +0000 (11:28 +0900)]
add TCs for contents scanning
Change-Id: Ia1da131da0aab74efec0be15995e0a8496ff36f1
Signed-off-by: Dongsun Lee <ds73.lee@samsung.com>
Kyungwook Tak [Mon, 16 May 2016 12:16:36 +0000 (21:16 +0900)]
[BUGFIX] candidate target name
individual detected malware history in app's target name should be
file's path instead of pkg path.
Change-Id: Id1becbd7ef3954b9722f1eae9a30e196b6326aed
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Mon, 16 May 2016 08:48:09 +0000 (17:48 +0900)]
Inserts detected history per file when scan app
Change-Id: I060421272f7ddc14bcca6942356b2e8979ed5e04
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Mon, 16 May 2016 07:44:28 +0000 (16:44 +0900)]
Fix file system internal tc related modified time
Change-Id: I4a91d8f2220f161b29bc79e2f4f885671f081bde
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Mon, 16 May 2016 07:17:39 +0000 (16:17 +0900)]
Set null to optionally deserializable objects
Change-Id: Ia9e7a0bc123a9cb9e75e21c4aee8fd1a8891d52f
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Mon, 16 May 2016 05:36:17 +0000 (14:36 +0900)]
Integrate core-usage class to cs-logic
Change-Id: I08439cebbc93867b5a286a083b043c1ad4cd1055
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Mon, 16 May 2016 02:43:49 +0000 (11:43 +0900)]
Refactor core-usage class
Simplify interface. Only set/reset functionality needed.
Change-Id: I0a8fcdc9ffb75f5852835239b9974db69ac808ef
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Mon, 16 May 2016 04:44:34 +0000 (13:44 +0900)]
Conditional statement changed to detected modified
Treat as not-modified if stat modified time == modifiedSince time.
Change-Id: I39c25752bdc26bd57bf883cb533d42579eec43be
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Mon, 16 May 2016 04:33:33 +0000 (13:33 +0900)]
Remove useless catch & returning error statements
Change-Id: Id0cbb854c59b6952968654f40ab92cfb2799be23
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Mon, 16 May 2016 01:16:38 +0000 (10:16 +0900)]
Use std::invalid_argument instead of InvalidParam
std::invalid_argument exception can perfectly replaced with
InvalidParam custom exception
Change-Id: I2734d73d1c44480b0b969cb0255fffcbb74dfb74
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Fri, 13 May 2016 11:29:00 +0000 (20:29 +0900)]
Convert engine ec to CAPI ec by exception
Change-Id: Ifa2c94ff39dff24a12cad0541270e6fa6f751961
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Fri, 13 May 2016 10:38:54 +0000 (19:38 +0900)]
Check all parent dirs when getting last scan time
Change-Id: Ib994a45548f967cd367dbc60328d860f0719385f
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Fri, 13 May 2016 07:44:19 +0000 (16:44 +0900)]
Access control of privileged APIs
Access control performed in server-service layer, not by
smack-labeled socket. It's for two reasons below
1) for 3.0, privilege access control will be done by cynara.
2) judge status command is dispatched through CS socket but
privileged Admin (which is mapped to ADMIN socket) so there's
exception.
cynara integration will be done later by separated commit
with access-control-cynara.cpp
Change-Id: I8a747cd624e1b3d54ef91bbbf018d43da1d081a5
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Fri, 13 May 2016 06:00:01 +0000 (15:00 +0900)]
Separate logic codes per domain (cs, wp, admin)
Change-Id: I7bd1a9c88a7ae22b6385a6347600d73bf6857bc8
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Fri, 13 May 2016 02:36:07 +0000 (11:36 +0900)]
Canonicalize file/dir path set
Change-Id: Ib962c0ac99e75fd76db9d52fe673887447712aba
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Fri, 13 May 2016 03:00:02 +0000 (12:00 +0900)]
Return invalid handle ec appropriately on client
Change-Id: Icaf77dcdff29321b97a57242e7d3a11f378c272c
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Fri, 13 May 2016 02:46:37 +0000 (11:46 +0900)]
[BUGFIX] Some fields handling missed in CsDetected
isApp field and pkgId field is missed from all processes:
serilaize / deserialize / move ctor / move assignment
Change-Id: I167cb446da49d80ebc03f597ecd165bbcffd7d08
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Dongsun Lee [Thu, 12 May 2016 03:14:06 +0000 (12:14 +0900)]
change the API list with antivirus.admin privilege
Change-Id: Iaa75ab07cfd7190efacdef112e67bb79e2043b47
Signed-off-by: Dongsun Lee <ds73.lee@samsung.com>
Kyungwook Tak [Thu, 12 May 2016 10:51:14 +0000 (19:51 +0900)]
Add smack rule for scanning media directory
Change-Id: I79f9f9facd4e2b0d06d1b2ad3eff2cfeec30d68e
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Thu, 12 May 2016 11:03:22 +0000 (20:03 +0900)]
Change detected class instance validation check
changed from target name to malware name.
In case of scan data, target name can be empty by default so
we cannot validate with target name's emptiness.
Malware name field is mandatory so always filled if detected
item is valid.
Change-Id: I7e2444019fa773e763910a1e83090bf9a705dc4e
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Wed, 11 May 2016 11:19:17 +0000 (20:19 +0900)]
Impl full-stack of engine-manager feature
Change-Id: Id16e10ef5d6fe8253796d833f8f15b8a1299aed7
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Thu, 12 May 2016 04:50:39 +0000 (13:50 +0900)]
Use socket per module (CS, WP, ADMIN)
Change-Id: Ifb0d21c101d51a538eda5c16b2744cf81cdd505d
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Mon, 9 May 2016 06:26:43 +0000 (15:26 +0900)]
Make app-aware for scan on cloud option
Change-Id: I83cd1c9a573a34ad3faf86a12a11d08dc7835aad
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Dongsun Lee [Wed, 11 May 2016 06:34:38 +0000 (15:34 +0900)]
add @tizen_since, @privlevel, and @privilege to API headers
Change-Id: I0b1d5d3194761ee52dd317eb80837be10d4ef254
Signed-off-by: Dongsun Lee <ds73.lee@samsung.com>
Kyungwook Tak [Mon, 9 May 2016 04:42:13 +0000 (13:42 +0900)]
FIX: Prompting user is missed in some case
in scan file helper, prompt user is missed.
handling user response is packed to member method.
Change-Id: I55e5245df0b55f5c25afc921dbf67315afd7dfa1
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Mon, 9 May 2016 02:34:05 +0000 (11:34 +0900)]
Move regexpr for app directory aware to static
Change-Id: I482d57deb18981dffa21f068e1c67be5dc15f623
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Wed, 4 May 2016 08:11:06 +0000 (17:11 +0900)]
Fix descriptions of CAPI
Change-Id: Id7b78729a04fe7e46b45ba1d0345a6705f50cc99
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Wed, 4 May 2016 07:43:17 +0000 (16:43 +0900)]
Remove duplicated ldconfig requires definition
Change-Id: I64b0ea04b4ba5d7b8b4b1aad4b3d287823077c27
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Wed, 4 May 2016 05:08:34 +0000 (14:08 +0900)]
File removal on server side
No client credential check needed for file removal
Change-Id: I4e241c6eec5231a0dc53ed868cdaf1b973f1e21e
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Dongsun Lee [Mon, 9 May 2016 00:29:46 +0000 (17:29 -0700)]
Merge "add csr-framework-engine-devel rpm" into devel
Dongsun Lee [Wed, 4 May 2016 06:09:48 +0000 (15:09 +0900)]
add csr-framework-engine-devel rpm
Change-Id: I8b8fcff4919a8fa3852645c513d0dd40dd24d089
Signed-off-by: Dongsun Lee <ds73.lee@samsung.com>
Kyungwook Tak [Wed, 4 May 2016 05:09:30 +0000 (14:09 +0900)]
Add libsmack to buildrequires list
Change-Id: Ia159c2137367e9a427223dfeeada991ca9d9d261
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Wed, 4 May 2016 04:55:45 +0000 (13:55 +0900)]
[CAPI changed] Remove threattype field in detected
Change-Id: I10ce04d2bf3130823ab77b184acc150d5d2b01a9
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Kyungwook Tak [Wed, 4 May 2016 04:33:21 +0000 (13:33 +0900)]
Disable ask user option for async operations
Change-Id: I3a708cbd55a3f467359323370ef8e8c264e9da22
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>