From b7b518712d302a7c372e62582c3b60af4020f13c Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 13 Aug 2008 00:49:21 +0200 Subject: [PATCH] Add skeleton for PolicyKit plugin --- configure.ac | 1 + plugins/Makefile.am | 24 ++++++++++++++++-------- plugins/polkit.c | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 8 deletions(-) create mode 100644 plugins/polkit.c diff --git a/configure.ac b/configure.ac index c9534a2..096711f 100644 --- a/configure.ac +++ b/configure.ac @@ -77,6 +77,7 @@ AM_CONDITIONAL(HAL, test "${hal_found}" = "yes") PKG_CHECK_MODULES(POLKIT, polkit-dbus >= 0.7, polkit_found=yes, polkit_found=no) AC_SUBST(POLKIT_CFLAGS) AC_SUBST(POLKIT_LIBS) +AM_CONDITIONAL(POLKIT, test "${polkit_found}" = "yes") PKG_CHECK_MODULES(SQLITE, sqlite3, sqlite_found=yes, sqlite_found=no) AC_SUBST(SQLITE_CFLAGS) diff --git a/plugins/Makefile.am b/plugins/Makefile.am index 2358d33..96b59b3 100644 --- a/plugins/Makefile.am +++ b/plugins/Makefile.am @@ -4,14 +4,6 @@ plugindir = $(libdir)/connman/plugins plugin_LTLIBRARIES = rtnllink.la ethernet.la wifi.la bluetooth.la \ dhclient.la ipv4.la resolvconf.la resolvfile.la -if HAL -plugin_LTLIBRARIES += hal.la - -hal_la_SOURCES = hal.c -hal_la_LIBADD = @HAL_LIBS@ -hal_la_CFLAGS = @GLIB_CFLAGS@ @HAL_CFLAGS@ -endif - rtnllink_la_SOURCES = rtnllink.c ethernet_la_SOURCES = ethernet.c @@ -30,6 +22,22 @@ resolvconf_la_SOURCES = resolvconf.c resolvfile_la_SOURCES = resolvfile.c +if HAL +plugin_LTLIBRARIES += hal.la + +hal_la_SOURCES = hal.c +hal_la_LIBADD = @HAL_LIBS@ +hal_la_CFLAGS = @GLIB_CFLAGS@ @HAL_CFLAGS@ +endif + +if POLKIT +plugin_LTLIBRARIES += polkit.la + +polkit_la_SOURCES = polkit.c +polkit_la_LIBADD = @POLKIT_LIBS@ +polkit_la_CFLAGS = @GLIB_CFLAGS@ @POLKIT_CFLAGS@ +endif + AM_LDFLAGS = -no-undefined -module -avoid-version \ -export-symbols-regex connman_plugin_desc diff --git a/plugins/polkit.c b/plugins/polkit.c new file mode 100644 index 0000000..76e6452 --- /dev/null +++ b/plugins/polkit.c @@ -0,0 +1,39 @@ +/* + * + * Connection Manager + * + * Copyright (C) 2007-2008 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 + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +static int polkit_init(void) +{ + return 0; +} + +static void polkit_exit(void) +{ +} + +CONNMAN_PLUGIN_DEFINE("polkit", "PolicyKit authorization plugin", VERSION, + polkit_init, polkit_exit) -- 1.7.9.5