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
8 Given 2 users: UserA and UserB
10 If UserA is connected to a wifi service, then UserB is not allowed
11 to set wifi technology properties.
13 Change-Id: Ia783b22bc28e9e487ddfa3a4c249c9d1ea76bde8
15 src/technology.c | 15 +++++++++++++++
16 1 file changed, 15 insertions(+)
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,
24 DBG("property %s", name);
26 + if (technology->type == CONNMAN_SERVICE_TYPE_WIFI && technology->connected) {
28 + if (connman_dbus_get_connection_unix_user_sync(conn,
29 + dbus_message_get_sender(msg),
31 + DBG("Can not get unix user id!");
32 + return __connman_error_permission_denied(msg);
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);
41 if (g_str_equal(name, "Tethering")) {
42 dbus_bool_t tethering;