X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=plugins%2Fpolkit.c;h=ae38364ac1e13add852f6619aed7fdaa786c2935;hb=e2aacb30e612fed1db0ab4a35b922b55d52e90ae;hp=76e645216eb0365ec21a3e68a3b705610f060848;hpb=b7b518712d302a7c372e62582c3b60af4020f13c;p=platform%2Fupstream%2Fconnman.git diff --git a/plugins/polkit.c b/plugins/polkit.c old mode 100644 new mode 100755 index 76e6452..ae38364 --- a/plugins/polkit.c +++ b/plugins/polkit.c @@ -2,7 +2,7 @@ * * Connection Manager * - * Copyright (C) 2007-2008 Intel Corporation. All rights reserved. + * Copyright (C) 2007-2012 Intel Corporation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -23,17 +23,33 @@ #include #endif +#include + +#define CONNMAN_API_SUBJECT_TO_CHANGE #include -#include +#include + +static const GDBusSecurityTable polkit_security[] = { + { CONNMAN_PRIVILEGE_MODIFY, "net.connman.modify", + G_DBUS_SECURITY_FLAG_BUILTIN | + G_DBUS_SECURITY_FLAG_ALLOW_INTERACTION }, + { CONNMAN_PRIVILEGE_SECRET, "net.connman.secret", + G_DBUS_SECURITY_FLAG_BUILTIN | + G_DBUS_SECURITY_FLAG_ALLOW_INTERACTION }, + { } +}; static int polkit_init(void) { + g_dbus_register_security(polkit_security); + return 0; } static void polkit_exit(void) { + g_dbus_unregister_security(polkit_security); } -CONNMAN_PLUGIN_DEFINE("polkit", "PolicyKit authorization plugin", VERSION, - polkit_init, polkit_exit) +CONNMAN_PLUGIN_DEFINE(polkit, "PolicyKit authorization plugin", VERSION, + CONNMAN_PLUGIN_PRIORITY_DEFAULT, polkit_init, polkit_exit)