neard: move recipe and patches to the proper dir
[scm/bb/meta-tizen.git] / meta-tizen-adaptation / meta / recipes-connectivity / connman / connman / 0028-multi-user-Add-multi-user-support-in-technology.patch
1 From 37cbead2d2cbea4b9bd9f7180caf26a4b653662d Mon Sep 17 00:00:00 2001
2 From: Zhang zhengguang <zhengguang.zhang@intel.com>
3 Date: Sat, 11 Oct 2014 15:09:09 +0800
4 Subject: [PATCH 28/32] multi-user: Add multi-user support in technology
5
6 Use case:
7
8 Given 2 users: UserA and UserB
9
10 If UserA is connected to a wifi service, then UserB is not allowed
11 to set wifi technology properties.
12
13 Change-Id: Ia783b22bc28e9e487ddfa3a4c249c9d1ea76bde8
14 ---
15  src/technology.c | 15 +++++++++++++++
16  1 file changed, 15 insertions(+)
17
18 diff --git a/src/technology.c b/src/technology.c
19 index 679c779..70732f6 100644
20 --- a/src/technology.c
21 +++ b/src/technology.c
22 @@ -862,6 +862,21 @@ static DBusMessage *set_property(DBusConnection *conn,
23  
24         DBG("property %s", name);
25  
26 +       if (technology->type == CONNMAN_SERVICE_TYPE_WIFI && technology->connected) {
27 +               uid_t uid;
28 +               if (connman_dbus_get_connection_unix_user_sync(conn,
29 +                                               dbus_message_get_sender(msg),
30 +                                               &uid) < 0) {
31 +                       DBG("Can not get unix user id!");
32 +                       return __connman_error_permission_denied(msg);
33 +               }
34 +
35 +               if (!__connman_service_is_user_allowed(CONNMAN_SERVICE_TYPE_WIFI, uid)) {
36 +                       DBG("Not allow this user to operate wifi technology now!");
37 +                       return __connman_error_permission_denied(msg);
38 +               }
39 +       }
40 +
41         if (g_str_equal(name, "Tethering")) {
42                 dbus_bool_t tethering;
43                 int err;
44 -- 
45 1.8.1.4
46