platform/core/security/askuser.git
6 years agoRelease version 0.2.0 22/141022/1 submit/tizen/20170727.154157
Zofia Abramowska [Thu, 27 Jul 2017 14:08:55 +0000 (16:08 +0200)]
Release version 0.2.0

This release changes whole architecture of askuser.
Askuser is no longer a cynara agent, but a pair of client
and service providing API for privacy privilege permission
requests.

Change-Id: Id8e865e2558fb64b5f1752430c90155c1e0f09f0

6 years agoMerge remote-tracking branch 'origin/privacy-popup-issue' into tizen 44/140844/1
Zofia Abramowska [Wed, 26 Jul 2017 15:12:20 +0000 (17:12 +0200)]
Merge remote-tracking branch 'origin/privacy-popup-issue' into tizen

Change-Id: If994debbb93bdd4e3f69ad91eb2b69a7f78fe539

6 years agoProtect from passing zero-length privileges to API 19/140319/5 privacy-popup-issue
Piotr Sawicki [Mon, 24 Jul 2017 11:59:31 +0000 (13:59 +0200)]
Protect from passing zero-length privileges to API

Change-Id: I33c076339812e9bb0dedec047112793be90aaf5a

6 years agoAdd auto mode to the CAPI test app 18/140318/4
Piotr Sawicki [Mon, 24 Jul 2017 11:30:06 +0000 (13:30 +0200)]
Add auto mode to the CAPI test app

The client sends randomly generated privilege at random intervals
of time. The server responds with 'deny once' to all pending requests
also at random intervals. This mode allows to perform stress tests of
the IPC module.

Change-Id: I52aa284fef5d50daec6831b02f3bc34a6679d12a

6 years agoNotify logic of popup response from popupper 27/140327/3
Zofia Abramowska [Mon, 24 Jul 2017 12:13:57 +0000 (14:13 +0200)]
Notify logic of popup response from popupper

Change-Id: Idf46c6b9f1a761bfdf7af25dcce06f9a13d0f7e0

6 years agoFix accessor types of channels methods 68/140068/2
Zofia Abramowska [Fri, 21 Jul 2017 17:01:30 +0000 (19:01 +0200)]
Fix accessor types of channels methods

* Channel : move onAccept, onClose, onReceive, onSend to protected
* ServerChannel, ClientChannel : move above methods to private

Change-Id: If689984a5de7cc40fb6df4b8c6f79e3328664f3e

6 years agoMerge "Show popup only for "Ask user" policy" into privacy-popup-issue
Zofia Abramowska [Fri, 21 Jul 2017 15:16:25 +0000 (15:16 +0000)]
Merge "Show popup only for "Ask user" policy" into privacy-popup-issue

6 years agoMerge "Fix ServerCallbacks" into privacy-popup-issue
Zofia Abramowska [Fri, 21 Jul 2017 15:16:19 +0000 (15:16 +0000)]
Merge "Fix ServerCallbacks" into privacy-popup-issue

6 years agoMove the src/capi/doc folder to the main project folder 98/139998/3
Piotr Sawicki [Fri, 21 Jul 2017 08:15:16 +0000 (10:15 +0200)]
Move the src/capi/doc folder to the main project folder

According to ACR requirements, the doc folder has to be located
in the main project folder.

Change-Id: Iae208d2747dd41e051ad94ba16be9eb19aa908b9

6 years agoClarify the CAPI documentation 17/139917/5
Piotr Sawicki [Fri, 21 Jul 2017 04:59:52 +0000 (06:59 +0200)]
Clarify the CAPI documentation

There are devices that don't have the hardware back
and home buttons. Descriptions of enums have been simplified.
Fix typos and other mistakes.

Change-Id: I7db5311934717d04d91820b1c95550f5488c969a

6 years agoShow popup only for "Ask user" policy 32/139832/1
Zofia Abramowska [Thu, 20 Jul 2017 14:30:15 +0000 (16:30 +0200)]
Show popup only for "Ask user" policy

Change-Id: Id0e2b9fb13f8b06ad39668e623d35034ee89c52e

6 years agoFix ServerCallbacks 31/139831/1
Zofia Abramowska [Thu, 20 Jul 2017 13:30:50 +0000 (15:30 +0200)]
Fix ServerCallbacks

* add missing include
* remove unused member m_popupper

Change-Id: I64f095349ecc7fdd4c09c43e729287d11a23072c

6 years agoFix doxygen documentation after renaming ipc files 15/139815/1
Piotr Sawicki [Thu, 20 Jul 2017 12:21:29 +0000 (14:21 +0200)]
Fix doxygen documentation after renaming ipc files

Change-Id: Ia3f34fc1af0a0605d19638ff2bee54d3e03f685f

6 years agoTailor CAPI to meet the requirements of ACR 02/139602/13
Piotr Sawicki [Wed, 19 Jul 2017 11:53:34 +0000 (13:53 +0200)]
Tailor CAPI to meet the requirements of ACR

* Adjust doxygen documentation
* Change names of functions and enums in CAPI
* Adapt the source code to the above changes

Change-Id: Iaa2bb8817305c755fb9164a2a8013bff8b509723

6 years agoAdd a guide for CAPI 09/139509/9
Piotr Sawicki [Wed, 19 Jul 2017 07:34:49 +0000 (09:34 +0200)]
Add a guide for CAPI

Change-Id: I9ba183a703e8e73dab22de44b22afe6eeda1f1db

6 years agoFix popping from empty queue 36/139536/1
Zofia Abramowska [Wed, 19 Jul 2017 08:40:26 +0000 (10:40 +0200)]
Fix popping from empty queue

Change-Id: Iba4ced7ae4ddceb3a8a8922bf95b51775d19fe9f

6 years agoBring back missing manifest from test rpm 86/139386/1
Zofia Abramowska [Tue, 18 Jul 2017 15:34:01 +0000 (17:34 +0200)]
Bring back missing manifest from test rpm

Change-Id: Iedb062e8ce2fcd0e177806483772ca870926eb4c

6 years agoMake the CAPI documentation more consistent 65/139165/3
Piotr Sawicki [Mon, 17 Jul 2017 14:33:52 +0000 (16:33 +0200)]
Make the CAPI documentation more consistent

Change-Id: I3c7048d8ec9a568f6125f25d17e4cda64a1cee9b

6 years agoAdd the 'privilege' parameter to popup response callback 64/139164/3
Piotr Sawicki [Mon, 17 Jul 2017 13:54:18 +0000 (15:54 +0200)]
Add the 'privilege' parameter to popup response callback

Apart from that, a protection against sending multiple requests
with the same privilege has been added. A new status code:
PRIVACY_PRIVILEGE_MANAGER_ERROR_ALREADY_IN_PROGRESS informs
an application when the above error occurs.

Change-Id: Ifb2397c99452d56f7327f0be3f54ce33b766488f

6 years agoRemove unnecessary @version tags from documentation 63/139163/3
Piotr Sawicki [Mon, 17 Jul 2017 11:24:30 +0000 (13:24 +0200)]
Remove unnecessary @version tags from documentation

Change-Id: I9ac859af5c2effd8a560810fd443b442021baba6

6 years agoFix warnings detected by static code analyzers 62/139162/3
Piotr Sawicki [Mon, 17 Jul 2017 09:48:19 +0000 (11:48 +0200)]
Fix warnings detected by static code analyzers

Change-Id: Ib7feacd42ab63b3841efcf025f9241c044f4e57f

6 years agoAdd 's' command to the CAPI test application 61/139161/3
Piotr Sawicki [Mon, 17 Jul 2017 09:36:36 +0000 (11:36 +0200)]
Add 's' command to the CAPI test application

From now on, the application has the 's' command which sends a pop-up
request, in the same way as 'r' command does, but after receiving
'deny forever' response it stops the application. Also, the source
code has been reorganised to achieve better readability.

Change-Id: If2bb7fcee45489ac8246bdbf6703ab0f88fdf87c

6 years agoReduce number of generated rpms 87/139287/3
Zofia Abramowska [Mon, 17 Jul 2017 12:32:19 +0000 (14:32 +0200)]
Reduce number of generated rpms

* libs are not used standalone - squash them to common
* plugins don't make sense without service - move plugins to main rpm
* squash tests to one rpm
* squash devels to one rpm

Change-Id: I2f4c3462ca76ab43032e5979975d5e4b80c49728

6 years agoRename files 86/139286/2
Zofia Abramowska [Wed, 12 Jul 2017 16:22:26 +0000 (18:22 +0200)]
Rename files

* remove redundant ask-user- prefix
* remove askuser-notification directory
* rename ipc-lib to ipc

Change-Id: Iccfb2c4664b0aa8e05b12220b78db73fb82c8ead

6 years agoDistinguish no policy for asked privilege 85/139285/2
Zofia Abramowska [Mon, 17 Jul 2017 12:00:20 +0000 (14:00 +0200)]
Distinguish no policy for asked privilege

Change-Id: I90a0b9454573924c89079e03ee61528773d0d387

6 years agoAdd extensive logging to Sock and channel classes 83/138183/6
Piotr Sawicki [Tue, 11 Jul 2017 06:54:20 +0000 (08:54 +0200)]
Add extensive logging to Sock and channel classes

* add logging of unusual situations
* add handling of unlink() errors

Change-Id: Ibc41a6bc1df29531f6405433f15817abe0bcc250

6 years agoRemove superfluous check in Sock 82/138182/5
Piotr Sawicki [Tue, 11 Jul 2017 07:00:29 +0000 (09:00 +0200)]
Remove superfluous check in Sock

Change-Id: I160c69f448e0b3b92061392ed5729a7c3e97ce70

6 years agoAdd ConnectionException 81/138181/5
Piotr Sawicki [Tue, 11 Jul 2017 06:14:12 +0000 (08:14 +0200)]
Add ConnectionException

Change-Id: Ia523ba65284ad7612ecbaf165a0cfddf9a96d9a0

6 years agoFix doxygen documentation in ipc-lib 80/138180/5
Piotr Sawicki [Tue, 11 Jul 2017 10:22:47 +0000 (12:22 +0200)]
Fix doxygen documentation in ipc-lib

Change-Id: I631f094555f5c81f535e88e42f85f406571c57be

6 years agoRemove unused headers 79/138179/5
Piotr Sawicki [Tue, 11 Jul 2017 10:21:55 +0000 (12:21 +0200)]
Remove unused headers

* remove unused #include directives
* remove unused header file

Change-Id: Ic433b713cd08b45366e66170a0fea4071f1b8e28

6 years agoPrevent from undefined behaviour during destruction of channel users 59/137959/6
Piotr Sawicki [Mon, 10 Jul 2017 11:36:06 +0000 (13:36 +0200)]
Prevent from undefined behaviour during destruction of channel users

Change-Id: I07339e74068e066ec61a724b8a1ef6c2dd9670a0

6 years agoFix doxygen documentation for CAPI 26/137926/6
Piotr Sawicki [Mon, 10 Jul 2017 08:56:56 +0000 (10:56 +0200)]
Fix doxygen documentation for CAPI

Change-Id: I65e4d19deab4f4e04710770050e1db6f65ce0f5c

6 years agoImplement app to test CAPI and simulate server side 43/137743/7
Piotr Sawicki [Thu, 6 Jul 2017 15:08:16 +0000 (17:08 +0200)]
Implement app to test CAPI and simulate server side

* Add more detailed help
* Add switches for working as client or service

Change-Id: Iaef748054279cafc44f763be036d8c26db3e671d

6 years agoAdapt test sources to C++ 42/137742/3
Piotr Sawicki [Thu, 6 Jul 2017 13:54:13 +0000 (15:54 +0200)]
Adapt test sources to C++

Change-Id: I8e91afce91aa941015e454549b2f6f673889ce49

6 years agoInitialize local variable before passing it to client API 41/137741/2
Piotr Sawicki [Fri, 7 Jul 2017 09:57:21 +0000 (11:57 +0200)]
Initialize local variable before passing it to client API

Change-Id: I6d28837e691a6e70d38af8a55fe68e4d5572c99c

6 years agoFree remaining callbacks while destroying a client 40/137740/1
Piotr Sawicki [Fri, 7 Jul 2017 07:40:48 +0000 (09:40 +0200)]
Free remaining callbacks while destroying a client

After calling a registered callback it has to be freed
to prevent from calling it again.

Change-Id: Iacd1e345f4e1ff43827044c461d6cb6db75a5911

6 years agoCheck if dynamic cast fails 39/137539/2
Zofia Abramowska [Thu, 6 Jul 2017 08:42:08 +0000 (10:42 +0200)]
Check if dynamic cast fails

Change-Id: I256398d47cad30c9f4ce03f1cd0e974fe719f062

6 years agoDon't move event from vector 14/137414/4
Zofia Abramowska [Wed, 5 Jul 2017 15:16:31 +0000 (17:16 +0200)]
Don't move event from vector

Moved event was used later, which resulted in error.

Change-Id: I920f285d2cd649aba5d2237aab8f5d1e1b70a810

6 years agoRemove fetching pkgLabel twice 13/137413/4
Zofia Abramowska [Thu, 6 Jul 2017 08:37:02 +0000 (10:37 +0200)]
Remove fetching pkgLabel twice

Creating popup message unnecessarily fetched pkg label
from pkg label.

Change-Id: Ie98a9e5e170a2d86a68856c39153c7581f598c42

6 years agoProperly set current event id 12/137412/4
Zofia Abramowska [Thu, 6 Jul 2017 08:36:48 +0000 (10:36 +0200)]
Properly set current event id

Service side current event id wasn't set at all.

Change-Id: Ic8a82e9d2954bb69dd8da6e86a0dd00222d94d7c

6 years agoImplement checkPrivilege() 33/136933/22
Piotr Sawicki [Mon, 3 Jul 2017 14:36:54 +0000 (16:36 +0200)]
Implement checkPrivilege()

Change-Id: I91768ce30cced026bc7f15bc5381be5d5df7afc6

6 years agoImplement framing for protocol library 75/136875/27
Piotr Sawicki [Mon, 3 Jul 2017 08:31:01 +0000 (10:31 +0200)]
Implement framing for protocol library

Change-Id: I4d8a7215107c88220fe6b8be79ea456bf00f452a

6 years agoAdd handling exceptions to the client API 74/136874/23
Piotr Sawicki [Mon, 3 Jul 2017 07:51:57 +0000 (09:51 +0200)]
Add handling exceptions to the client API

Change-Id: I0e4c32b1329bdd266c0424534c86970c5a0f6ce1

6 years agoImplement CAPI 69/136669/25
Piotr Sawicki [Fri, 30 Jun 2017 10:34:27 +0000 (12:34 +0200)]
Implement CAPI

* Bind askuser-client API to the GLib main loop mechanism.
* Add simple test program.
* Add an unknown error code type to API

Change-Id: Icc04d7021003bc7547f2294920011ec46eaa0344

6 years agoAdd fetching credentials from socket fd 31/136431/22
Piotr Sawicki [Thu, 29 Jun 2017 09:19:56 +0000 (11:19 +0200)]
Add fetching credentials from socket fd

Change-Id: I5adc2b5e01b1747c86846eb3c1a565b7643892cc

6 years agoImplement client side asynchronous channel 22/136222/24
Piotr Sawicki [Wed, 5 Jul 2017 11:30:43 +0000 (13:30 +0200)]
Implement client side asynchronous channel

* Implement an abstract channel and async client/server channels
* Adjust other modules to this new changes

Change-Id: I6788d01a220dfba3eb3ad2226a8a9ee96878153b

6 years agoChange visibility to hidden for client API 97/137397/2
Piotr Sawicki [Wed, 5 Jul 2017 06:45:51 +0000 (08:45 +0200)]
Change visibility to hidden for client API

Change-Id: Icf6acc6bbd2c5195f3ed1d750ab01d66668a6d78

6 years agoMove protocol to ipc-lib 21/136221/20
Piotr Sawicki [Wed, 28 Jun 2017 14:06:22 +0000 (16:06 +0200)]
Move protocol to ipc-lib

Change-Id: I42f4b1f3f8b28f7f1da52a281984e27e49768130

6 years agoAdd a skeleton of CAPI 05/135805/22
Piotr Sawicki [Mon, 26 Jun 2017 14:12:49 +0000 (16:12 +0200)]
Add a skeleton of CAPI

Change-Id: I0dc73a7f1169f7857804a11c8a9a76c5a468959d

6 years agoAdd a skeleton of client API implementation 04/135804/13
Piotr Sawicki [Thu, 22 Jun 2017 11:53:56 +0000 (13:53 +0200)]
Add a skeleton of client API implementation

Change-Id: I067a35ae6b712c7f67076e30a29efdbf0ced6d79

6 years agoMove policy to commons library 91/136891/2
Zofia Abramowska [Mon, 3 Jul 2017 09:09:34 +0000 (11:09 +0200)]
Move policy to commons library

* bring back commons library and rpm
* move Policy and PkgInfo to commons

Change-Id: Ic5e5c1f4ffc642e09100ac3f7a3cb6dc2d7db0d4

6 years agoCheck if popup should be shown 69/135969/3
Zofia Abramowska [Fri, 30 Jun 2017 16:32:12 +0000 (18:32 +0200)]
Check if popup should be shown

Application can use askuser-notification API to show user
popup requesting permission to privilege. These popups have
high priority and abusing this API might make system unusable.
This commit makes askuser-notification check if policy for
application is not yet set (is not "Allow" or "Deny"). Only then
requested popup is shown.

Change-Id: Ibc9696bea24831f77c1ca71314122dca0b52798f

6 years agoRedo askuser-notification 39/135939/4
Zofia Abramowska [Fri, 23 Jun 2017 18:09:07 +0000 (20:09 +0200)]
Redo askuser-notification

* Remove redundant event/element ids
* Move PolicyUpdater to askuser-notification
* Implement new logic of askuser-notification

Change-Id: I32f104f20bcb640f00e05c6edfc140786e73c2de

6 years agoMerge "Fix improper delete for new[]" into tizen
Zofia Abramowska [Wed, 28 Jun 2017 16:21:32 +0000 (16:21 +0000)]
Merge "Fix improper delete for new[]" into tizen

6 years agoFix improper delete for new[] 62/131762/2
Zofia Abramowska [Tue, 30 May 2017 13:31:40 +0000 (15:31 +0200)]
Fix improper delete for new[]

Change-Id: I20a59c851412ab2f25a39a3a3f22f515187c6780

6 years agoMerge spec files 96/135796/2
Zofia Abramowska [Thu, 22 Jun 2017 12:22:05 +0000 (14:22 +0200)]
Merge spec files

Separate spec files are no longer needed

Change-Id: Icb2d0a15d55b034cb816c57791521fd5b82d29d6

6 years agoMove daemon sources higher in source tree 92/135492/3
Zofia Abramowska [Thu, 22 Jun 2017 12:05:06 +0000 (14:05 +0200)]
Move daemon sources higher in source tree

Askuser-notification is no longer a part of askuser agent.

Change-Id: Ib01f37ae9875f4ac034bac52aeeb115c36c7e50c

6 years agoRemove building of unnecessary components 00/135300/3
Zofia Abramowska [Thu, 22 Jun 2017 11:58:05 +0000 (13:58 +0200)]
Remove building of unnecessary components

Remove:
* askuser agent
* askuser privacy plugins
* askuser client plugin
* askuser commons

Change-Id: I4f9e0e768be6e2ea46aa830bb9a9da101ed326bc

6 years agoSimplify service plugin 99/135299/2
Zofia Abramowska [Wed, 21 Jun 2017 16:31:00 +0000 (18:31 +0200)]
Simplify service plugin

Service side plugin supports Ask user policy and translates
it to DENY.

Change-Id: If9a8601e18da68d59b116a2b5d8f6f0872748a4e

6 years agoUpdate service side to new requirements 97/135297/2
Zofia Abramowska [Wed, 21 Jun 2017 14:38:59 +0000 (16:38 +0200)]
Update service side to new requirements

* No more toasts - remove datagram socket
* Popup request passes only privilege as argument
* Add credentials to service callbacks

Change-Id: I86ef7253490dcd2c063943f9225dacc6b0f626bc

6 years agoRemove dependency between Ask User and DBUS 39/134539/1
jin-gyu.kim [Mon, 19 Jun 2017 06:23:15 +0000 (15:23 +0900)]
Remove dependency between Ask User and DBUS

- Cherry-pick from https://review.tizen.org/gerrit/#/c/116696/

Change-Id: Idf2be449ec0f34d3504912d139d1a93b6a1ba9f5

7 years agoRevert of changes related to privacy popups issue 99/125999/1
Radoslaw Bartosiak [Wed, 19 Apr 2017 19:14:03 +0000 (21:14 +0200)]
Revert of changes related to privacy popups issue

This commit reverts all commits made after the release 0.1.13
(824473a3621f2345c43c4f1680b72f45fb0d6d06)

Change-Id: I792729175832e0434823db4848357a734fab02b6
Signed-off-by: Radoslaw Bartosiak <r.bartosiak@samsung.com>
7 years agoFix possible use after free 44/123144/1 submit/tizen/20170405.143506
Zofia Abramowska [Tue, 4 Apr 2017 15:40:07 +0000 (17:40 +0200)]
Fix possible use after free

Change-Id: Ia146fbf57bb2bad47b931212da3224a687590ca9

7 years agoHandle exceptions from popup/toast creation 43/123143/1
Zofia Abramowska [Tue, 4 Apr 2017 15:36:34 +0000 (17:36 +0200)]
Handle exceptions from popup/toast creation

Return error when creating popup/toast fails

Change-Id: Ica628d41e23707d485ecf40a2f45d0d12c6da85f

7 years agoFix hw key handler segfault 41/123141/2
Zofia Abramowska [Tue, 4 Apr 2017 15:09:09 +0000 (17:09 +0200)]
Fix hw key handler segfault

Hardware key can be intercepted when no popup is visible

Change-Id: I0c3b562962393d2297aecdedb655811b81be4be8

7 years agoMerge "Fix hw key handling bug" into tizen
Rafal Krypa [Tue, 4 Apr 2017 13:41:39 +0000 (06:41 -0700)]
Merge "Fix hw key handling bug" into tizen

7 years agoMerge "Add ASKUSER_NONE response to libaskuser-notification" into tizen
Rafal Krypa [Tue, 4 Apr 2017 13:41:12 +0000 (06:41 -0700)]
Merge "Add ASKUSER_NONE response to libaskuser-notification" into tizen

7 years agoFix hw key handling bug 90/123090/6
Yunjin Lee [Tue, 4 Apr 2017 10:38:12 +0000 (19:38 +0900)]
Fix hw key handling bug

- hwKeyClickedCb passed meaningless value to response handler
- remove meaningless class member m_currentElementId and replace it to m_elementPtr->getId() to handle h/w input properly
- fix passed response type to NResponse::None

Change-Id: I7ff41bcea76b27aa4e2d295ccb63cbd62df89b8a
Signed-off-by: Yunjin Lee <yunjin-.lee@samsung.com>
7 years agoAdd ASKUSER_NONE response to libaskuser-notification 12/123112/1
Zofia Abramowska [Tue, 4 Apr 2017 11:57:15 +0000 (13:57 +0200)]
Add ASKUSER_NONE response to libaskuser-notification

H/W key pressed will generate ASKUSER_NONE response
instead of ASKUSER_DENY_ONCE

Change-Id: I268f7b1573dad56279f733e5f562762df2a769d1

7 years agoUpdate message strings and language files 33/122933/6
Yunjin Lee [Tue, 4 Apr 2017 04:29:00 +0000 (13:29 +0900)]
Update message strings and language files

Change-Id: If25b2b597d2a05740e043cb2527ea164bd6b1305
Signed-off-by: Yunjin Lee <yunjin-.lee@samsung.com>
7 years agoRename libaskuser-notification-ipc to libaskuser-notification 61/122861/2
Rafal Krypa [Mon, 3 Apr 2017 21:27:30 +0000 (23:27 +0200)]
Rename libaskuser-notification-ipc to libaskuser-notification

Keep the names simple. The CMake name conflict can be avoided.
Additionally fixed some coupling:
- don't include local copy of procotocol headers in plugin and agent code
- do a pkg-config module check on libaskuser-notification in plugin CMake

Change-Id: I539fe5a5325ac45575d2a19de0c9e39aeae5bca0
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
7 years agoPackaging refactoring 60/122860/2
Rafal Krypa [Mon, 3 Apr 2017 19:18:44 +0000 (21:18 +0200)]
Packaging refactoring

Fix broken package separation between askuser and askuser-notification:
- Build askuser-notification-ipc together with askuser-notification, not
  askuser. This breaks a dependency cycly: askuser -> security-manager ->
  askuser-notificattion-ipc -> askuser
- Move askuser-notification-test to a separate package, breaking another cycle
- Put all Cynara plugins in single package, don't split them
- Don't keep the same manifest file in separate copies
- Adapt package names to RPM convention

Change-Id: If814da04e65f02d0292e9e9b206629b4774bdb69
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
7 years agoMerge "Add build dependency for libaskuser-notification to askuser" into tizen
Rafal Krypa [Mon, 3 Apr 2017 19:04:54 +0000 (12:04 -0700)]
Merge "Add build dependency for libaskuser-notification to askuser" into tizen

7 years agoTrigger toast messages in cynara PrivacyPlugin, once per session 59/122859/1
Rafal Krypa [Mon, 3 Apr 2017 19:00:34 +0000 (21:00 +0200)]
Trigger toast messages in cynara PrivacyPlugin, once per session

Toast messages will be generated from server side cynara plugin. The answer
is then cached on client as long as the session parameter of cynara check
is unchanged. When client performs a check with changes session argument,
the cached value will be discarded, client will send check request to cynara
service again, triggering another pop-up.

Change-Id: I28d2eb43bdbf54362c9088dfb1405016a4bd271a
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
7 years agoChange implementation of string splitting to support zero-length components 32/122832/2
Rafal Krypa [Mon, 3 Apr 2017 10:56:58 +0000 (12:56 +0200)]
Change implementation of string splitting to support zero-length components

Previous code responsible from splitting a space-separated string used
stringstream for this purpose. If one of the components used to create such
string was empty, it resulted in two consecutive spaces that were "swallowed"
by stringstream.

Now the string is parsed using std::string::find method to manually detect
locations of delimiting spaces and cut the string to pieces.

Change-Id: I2aa964716f0d41f13807bbef5c8aab6c55715a34
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
7 years agoAdd build dependency for libaskuser-notification to askuser 58/122858/1
Rafal Krypa [Mon, 3 Apr 2017 18:39:21 +0000 (20:39 +0200)]
Add build dependency for libaskuser-notification to askuser

Although askuser doesn't need libaskuser-notification for now, it build
depends on libsecurity-manager-client, which is linked against
libaskuser-notification.
Such dependency should be resolved automatically by gbs, but it's not for
some reason. Probably gbs doesn't handle too well dependencies between
two spec files built from single repository.

Adding this dependency manually. It will be need anyway soon, when askuser
original functionality is restored for run-time pop-ups.

Change-Id: Ief4084d90094070e609d21575aee246acb747f4a
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
7 years agoFix privilege info 03/122503/9
Zofia Abramowska [Sun, 2 Apr 2017 12:50:26 +0000 (14:50 +0200)]
Fix privilege info

* Fix possible incorrect memory access (use after free)
* Don't throw when privilege_info fails, return input parameter
instead (behave like dgettext)

Change-Id: Ia3ef07e06282a88c39d9a6dd98644f5bbda40dc9

7 years agoSwitch to new implementation 90/122490/13
Zofia Abramowska [Fri, 31 Mar 2017 19:48:50 +0000 (21:48 +0200)]
Switch to new implementation

Remove unused AskUserTalker and GuiRunner.
Switch to Logic class in main.

Change-Id: I7b109c2bbcc6253b845b3d51ecbc702c4b8b0d9d

7 years agoImplement logic 10/122210/17
Zofia Abramowska [Mon, 3 Apr 2017 17:51:22 +0000 (19:51 +0200)]
Implement logic

Implement whole logic of new askuser-notification.

Change-Id: I9d8f2df3530c1607020ee058028617e3c6f92800

7 years agoImplement ServiceCallbacks 08/122208/16
Zofia Abramowska [Thu, 30 Mar 2017 13:05:10 +0000 (15:05 +0200)]
Implement ServiceCallbacks

Add implemenation of ServiceCallbacks for handling
client requests.

Change-Id: I7fd1bde8bfc9f2ba3d630375aadfdcf16028effc

7 years agoAdd UI request Events 07/122207/16
Zofia Abramowska [Thu, 30 Mar 2017 13:03:26 +0000 (15:03 +0200)]
Add UI request Events

Add classes processing libaskuser-notification UI requests.

Change-Id: I983e85daafc0dc649db2a84d52f4072673fb1606

7 years agoAdd UI controller class 06/122206/15
Zofia Abramowska [Thu, 30 Mar 2017 13:02:51 +0000 (15:02 +0200)]
Add UI controller class

Add popupper class responsible for creating proper popups and toast,
destroying them and listening on UI events

Change-Id: I2cee78ac35108b31d36c77d0c70d5ea8a9b71f02

7 years agoAdd answerable interface for popups 09/122209/11
Zofia Abramowska [Mon, 3 Apr 2017 17:44:56 +0000 (19:44 +0200)]
Add answerable interface for popups

Add class for evaluating answers from popups (with buttons
and with or without checkbox).

Change-Id: I88cdf10ede966a8de1510284432b8563abc1e180

7 years agoAdd popups/toast implementation 04/122204/10
Zofia Abramowska [Thu, 30 Mar 2017 13:01:41 +0000 (15:01 +0200)]
Add popups/toast implementation

Add classes to separate popup creation.
Add implementation for old check popup and new launch popup.
Use libnotification to display toasts.

Change-Id: I109edbd1e0c2ea5311fe1b1d04861ed48991868b

7 years agoAdd translation wrapper 05/122205/10
Zofia Abramowska [Thu, 30 Mar 2017 13:02:20 +0000 (15:02 +0200)]
Add translation wrapper

Add classes wrapping po transaltion for popup messages

Change-Id: Icd4d360742231ffe18c8ca459f47aa9dc9a1bcb9

7 years agoAdd example translations for new popup/toast messages 03/122203/7
Zofia Abramowska [Thu, 30 Mar 2017 12:59:45 +0000 (14:59 +0200)]
Add example translations for new popup/toast messages

Add example translation for launch popup, launch toast
and deny toast in polish and english.

Change-Id: I9eca06aa661ffcaf2f70d173a1a520f1d9f7b0d0

7 years agoRemove redundant language setting 02/122202/7
Zofia Abramowska [Tue, 28 Mar 2017 17:11:26 +0000 (19:11 +0200)]
Remove redundant language setting

Change-Id: I2dc8e2b61133e7cb7a49ef972536f8e02668f54c

7 years agoMove PkgInfo to separate file 01/122201/7
Zofia Abramowska [Tue, 28 Mar 2017 17:11:13 +0000 (19:11 +0200)]
Move PkgInfo to separate file

PkgInfo will be used separately from Policy wrappers

Change-Id: I33cd2643b2f854f991a9db9bb98e809f009ed0e9

7 years agoFix errors in askuser-notification library 89/122489/13
Bartlomiej Grzelewski [Sun, 2 Apr 2017 12:15:47 +0000 (14:15 +0200)]
Fix errors in askuser-notification library

* Fix name conflict between askuser-notification service and
  askuser-notification library
* The datagram socket was marked as stream socket.
* The stream socket was marked as datagram socket.
* Change order of calls: updateFd and erase descriptor.
* Add stream socket and datagram socket to askuser-notification.service.

Change-Id: I05d097ba15f038a4f7e88c323ae8790fe7d3eb14

7 years agoDon't auto start askuser-notification daemon 30/122830/3
Rafal Krypa [Mon, 3 Apr 2017 13:14:16 +0000 (15:14 +0200)]
Don't auto start askuser-notification daemon

This service is socket activated. There is no need to start it automatically.

Change-Id: I4be0f5ddca3ff748610abf0717fbe9b9ccf0668e
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
7 years agoSet access mode of askuser-notification socket files to 0777 29/122829/2
Rafal Krypa [Mon, 3 Apr 2017 13:12:44 +0000 (15:12 +0200)]
Set access mode of askuser-notification socket files to 0777

The socket files are created in /run/user_ext/UID/ directory. It is accessible
to the owner (UID) and system_share group.
Allowing full access to the socket files will make them accessible to members
of system_share group. This is needed to allow access from the context of
cynara service daemon.

Change-Id: I61ad34bca03a87dc317d04b0a704b1d3bf892c5d
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
7 years agoFix receiving sockets from systemd in libaskuser-notification 48/122848/1
Rafal Krypa [Mon, 3 Apr 2017 15:10:02 +0000 (17:10 +0200)]
Fix receiving sockets from systemd in libaskuser-notification

The error was in setting listening=1 argument in sd_is_socket_unix().
We are serving both stream and datagram socket and listening is valind only
for stream sockets. This lead to not catching the datagram socket.

Change-Id: Ie10b289870e12a895a3d8799788f2da4379da06f
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
7 years agoFix building libaskuser-notification against libsystemd 28/122828/1
Rafal Krypa [Mon, 3 Apr 2017 12:41:13 +0000 (14:41 +0200)]
Fix building libaskuser-notification against libsystemd

NOTE: this fix works correctly when BUILD_WITH_SYSTEMD_DAEMON is set but
will fail to build if it's not set and systemd build dependencies are not
installed.

Such case is not cover for a simple reason - this flaw is already present
in several places of this project. It should be fixed in general way by
some other commit.

Change-Id: I422cedcc9f84faaf757a75a72c8a01e37bbe17b7
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
7 years agoUpdate systemd configuration 83/122483/2
Bartlomiej Grzelewski [Fri, 31 Mar 2017 14:54:16 +0000 (16:54 +0200)]
Update systemd configuration

Change-Id: I8f20ce296a0086f912b3d0d19427a6607447005c

7 years agoAdd ipc library to build and packaging process 81/122481/3
Dariusz Michaluk [Fri, 31 Mar 2017 08:36:05 +0000 (10:36 +0200)]
Add ipc library to build and packaging process

Change-Id: Ie698e594751c65a915d6f964a847b1c8485815e3

7 years agoAdd ipc library for ask-user 14/120914/11
Bartlomiej Grzelewski [Fri, 24 Mar 2017 16:30:07 +0000 (17:30 +0100)]
Add ipc library for ask-user

This library is used in communication between privacy denied
plugin/security manager and ask user service.

Change-Id: If9e71a3a716095eba8b909cc28d08a1853ba2951

7 years agoMake askuser-notification independent from cynara 87/121587/10
Dariusz Michaluk [Tue, 28 Mar 2017 07:44:40 +0000 (09:44 +0200)]
Make askuser-notification independent from cynara

Change-Id: Ia5e1d85eba1d007f01e2b926a4ac433f6f2b452d

7 years agoMake askuser-notification independent from security-manager 92/120892/11
Dariusz Michaluk [Fri, 24 Mar 2017 08:03:33 +0000 (09:03 +0100)]
Make askuser-notification independent from security-manager

Change-Id: I65ebc0780e0fe34770523d7db9dc1bee2bc7953b

7 years agoSplit askuser and askuser-notification to separate spec files 67/120667/9
Dariusz Michaluk [Thu, 23 Mar 2017 09:25:41 +0000 (10:25 +0100)]
Split askuser and askuser-notification to separate spec files

Change-Id: I9a1a46fcbb7840bd5f4208b8587acb42f8ac2de4

7 years agoPrivacyDenied plugin implementation 92/120392/9
Bartlomiej Grzelewski [Wed, 22 Mar 2017 14:16:07 +0000 (15:16 +0100)]
PrivacyDenied plugin implementation

Some tizen 2.4 applications are crashing while waiting
for popup answer. New plugins return answer immediately.

Change-Id: Idc11ad818ebdf404245e81d2e18cfe3c21c519d8