summaryrefslogtreecommitdiff
path: root/src/nullbackend
diff options
context:
space:
mode:
authorDavid Zeuthen <davidz@redhat.com>2012-05-23 16:39:25 -0400
committerDavid Zeuthen <davidz@redhat.com>2012-05-23 16:39:25 -0400
commit0f830c76048229895164837f8ce01869d88a2616 (patch)
tree015f0ac20dce8f204553aa93fb2ff353abe60ce5 /src/nullbackend
parent29950854f6b9e9b8ea2d96d67c79eeec1046a4f1 (diff)
Nuke polkitbackend library, localauthority backend and extension system
Any backend can now be implemented in JavaScript (if so desired) so we don't need any of this any more. Note that the libpolkitbackend library was never declared stable (the preprocessor symbol POLKIT_BACKEND_I_KNOW_API_IS_SUBJECT_TO_CHANGE had to be defined) so removing it is not an API/ABI break. Signed-off-by: David Zeuthen <davidz@redhat.com>
Diffstat (limited to 'src/nullbackend')
-rw-r--r--src/nullbackend/50-nullbackend.conf16
-rw-r--r--src/nullbackend/Makefile.am50
-rw-r--r--src/nullbackend/nullbackend.c34
-rw-r--r--src/nullbackend/polkitbackendnullauthority.c195
-rw-r--r--src/nullbackend/polkitbackendnullauthority.h59
5 files changed, 0 insertions, 354 deletions
diff --git a/src/nullbackend/50-nullbackend.conf b/src/nullbackend/50-nullbackend.conf
deleted file mode 100644
index 3497677..0000000
--- a/src/nullbackend/50-nullbackend.conf
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# Configuration file for the PolicyKit null backend.
-#
-# DO NOT EDIT THIS FILE, it will be overwritten on update.
-#
-# To change configuration, create another file in this directory with
-# a filename that is sorted after the 50-nullback.conf and make
-# sure it has the .conf extension.
-#
-# Only a single configuration item, Priority, is supported.
-#
-# See the PolicyKit documentation for more information about PolicyKit.
-#
-
-[Configuration]
-Priority=-10
diff --git a/src/nullbackend/Makefile.am b/src/nullbackend/Makefile.am
deleted file mode 100644
index c683818..0000000
--- a/src/nullbackend/Makefile.am
+++ /dev/null
@@ -1,50 +0,0 @@
-
-NULL =
-
-module_flags = -export_dynamic -avoid-version -module -no-undefined -export-symbols-regex '^g_io_module_(load|unload)'
-
-INCLUDES = \
- -I$(top_builddir)/src \
- -I$(top_srcdir)/src \
- -DPACKAGE_LIBEXEC_DIR=\""$(libexecdir)"\" \
- -DPACKAGE_SYSCONF_DIR=\""$(sysconfdir)"\" \
- -DPACKAGE_DATA_DIR=\""$(datadir)"\" \
- -DPACKAGE_BIN_DIR=\""$(bindir)"\" \
- -DPACKAGE_LOCALSTATE_DIR=\""$(localstatedir)"\" \
- -DPACKAGE_LOCALE_DIR=\""$(localedir)"\" \
- -DPACKAGE_LIB_DIR=\""$(libdir)"\" \
- -D_POSIX_PTHREAD_SEMANTICS \
- -D_REENTRANT \
- -D_POLKIT_BACKEND_COMPILATION \
- $(NULL)
-
-polkitmodulesdir = $(libdir)/polkit-1/extensions
-polkitmodules_LTLIBRARIES = libnullbackend.la
-
-libnullbackend_la_SOURCES = \
- nullbackend.c \
- polkitbackendnullauthority.c polkitbackendnullauthority.h \
- $(NULL)
-
-libnullbackend_la_CFLAGS = \
- -DPOLKIT_BACKEND_I_KNOW_API_IS_SUBJECT_TO_CHANGE \
- -DG_LOG_DOMAIN=\"PolkitNullBackend\" \
- $(GLIB_CFLAGS) \
- $(NULL)
-
-libnullbackend_la_LDFLAGS = \
- $(module_flags) \
- $(GLIB_LIBS) \
- $(top_builddir)/src/polkitbackend/libpolkit-backend-1.la \
- $(NULL)
-
-libnullbackend_la_LIBADD = \
- $(NULL)
-
-nullconfigdir = $(sysconfdir)/polkit-1/nullbackend.conf.d
-nullconfig_DATA = 50-nullbackend.conf
-
-EXTRA_DIST = $(nullconfig_DATA)
-
-clean-local :
- rm -f *~
diff --git a/src/nullbackend/nullbackend.c b/src/nullbackend/nullbackend.c
deleted file mode 100644
index 0436cf0..0000000
--- a/src/nullbackend/nullbackend.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2009 Red Hat, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General
- * Public License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: David Zeuthen <davidz@redhat.com>
- */
-
-#include "polkitbackendnullauthority.h"
-
-void
-g_io_module_load (GIOModule *module)
-{
- polkit_backend_null_authority_register (module);
-}
-
-void
-g_io_module_unload (GIOModule *module)
-{
-}
-
diff --git a/src/nullbackend/polkitbackendnullauthority.c b/src/nullbackend/polkitbackendnullauthority.c
deleted file mode 100644
index 7491540..0000000
--- a/src/nullbackend/polkitbackendnullauthority.c
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * Copyright (C) 2008 Red Hat, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General
- * Public License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: David Zeuthen <davidz@redhat.com>
- */
-
-#include "config.h"
-#include <errno.h>
-#include <pwd.h>
-#include <grp.h>
-#include <string.h>
-#include <glib/gstdio.h>
-
-#include "polkitbackend/polkitbackendconfigsource.h"
-#include "polkitbackendnullauthority.h"
-
-struct _PolkitBackendNullAuthorityPrivate
-{
- gint foo;
-};
-
-static GList *authority_enumerate_actions (PolkitBackendAuthority *authority,
- PolkitSubject *caller,
- const gchar *locale,
- GError **error);
-
-static void authority_check_authorization (PolkitBackendAuthority *authority,
- PolkitSubject *caller,
- PolkitSubject *subject,
- const gchar *action_id,
- PolkitDetails *details,
- PolkitCheckAuthorizationFlags flags,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-
-static PolkitAuthorizationResult *authority_check_authorization_finish (PolkitBackendAuthority *authority,
- GAsyncResult *res,
- GError **error);
-
-G_DEFINE_DYNAMIC_TYPE (PolkitBackendNullAuthority, polkit_backend_null_authority,POLKIT_BACKEND_TYPE_AUTHORITY);
-
-static void
-polkit_backend_null_authority_init (PolkitBackendNullAuthority *authority)
-{
- authority->priv = G_TYPE_INSTANCE_GET_PRIVATE (authority,
- POLKIT_BACKEND_TYPE_NULL_AUTHORITY,
- PolkitBackendNullAuthorityPrivate);
-}
-
-static void
-polkit_backend_null_authority_finalize (GObject *object)
-{
- G_OBJECT_CLASS (polkit_backend_null_authority_parent_class)->finalize (object);
-}
-
-static const gchar *
-authority_get_name (PolkitBackendAuthority *authority)
-{
- return "null";
-}
-
-static const gchar *
-authority_get_version (PolkitBackendAuthority *authority)
-{
- return PACKAGE_VERSION;
-}
-
-static PolkitAuthorityFeatures
-authority_get_features (PolkitBackendAuthority *authority)
-{
- return POLKIT_AUTHORITY_FEATURES_NONE;
-}
-
-static void
-polkit_backend_null_authority_class_init (PolkitBackendNullAuthorityClass *klass)
-{
- GObjectClass *gobject_class;
- PolkitBackendAuthorityClass *authority_class;
-
- gobject_class = G_OBJECT_CLASS (klass);
- authority_class = POLKIT_BACKEND_AUTHORITY_CLASS (klass);
-
- gobject_class->finalize = polkit_backend_null_authority_finalize;
-
- authority_class->get_name = authority_get_name;
- authority_class->get_version = authority_get_version;
- authority_class->get_features = authority_get_features;
- authority_class->enumerate_actions = authority_enumerate_actions;
- authority_class->check_authorization = authority_check_authorization;
- authority_class->check_authorization_finish = authority_check_authorization_finish;
-
- g_type_class_add_private (klass, sizeof (PolkitBackendNullAuthorityPrivate));
-}
-
-static void
-polkit_backend_null_authority_class_finalize (PolkitBackendNullAuthorityClass *klass)
-{
-}
-
-void
-polkit_backend_null_authority_register (GIOModule *module)
-{
- gint priority;
- GFile *directory;
- PolkitBackendConfigSource *source;
-
- directory = g_file_new_for_path (PACKAGE_SYSCONF_DIR "/polkit-1/nullbackend.conf.d");
- source = polkit_backend_config_source_new (directory);
-
- priority = polkit_backend_config_source_get_integer (source, "Configuration", "Priority", NULL);
-
- polkit_backend_null_authority_register_type (G_TYPE_MODULE (module));
-
- g_print ("Registering null backend at priority %d\n", priority);
-
- g_io_extension_point_implement (POLKIT_BACKEND_AUTHORITY_EXTENSION_POINT_NAME,
- POLKIT_BACKEND_TYPE_NULL_AUTHORITY,
- "null backend " PACKAGE_VERSION,
- priority);
-
- g_object_unref (directory);
- g_object_unref (source);
-}
-
-/* ---------------------------------------------------------------------------------------------------- */
-
-static GList *
-authority_enumerate_actions (PolkitBackendAuthority *authority,
- PolkitSubject *caller,
- const gchar *locale,
- GError **error)
-{
- /* We don't know any actions */
- return NULL;
-}
-
-static void
-authority_check_authorization (PolkitBackendAuthority *authority,
- PolkitSubject *caller,
- PolkitSubject *subject,
- const gchar *action_id,
- PolkitDetails *details,
- PolkitCheckAuthorizationFlags flags,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
-{
- GSimpleAsyncResult *simple;
-
- /* complete immediately */
- simple = g_simple_async_result_new (G_OBJECT (authority),
- callback,
- user_data,
- authority_check_authorization);
- g_simple_async_result_complete (simple);
- g_object_unref (simple);
-}
-
-static PolkitAuthorizationResult *
-authority_check_authorization_finish (PolkitBackendAuthority *authority,
- GAsyncResult *res,
- GError **error)
-{
- GSimpleAsyncResult *simple;
- PolkitAuthorizationResult *result;
-
- simple = G_SIMPLE_ASYNC_RESULT (res);
-
- g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == authority_check_authorization);
-
- /* we always return NOT_AUTHORIZED, never an error */
- result = polkit_authorization_result_new (FALSE, FALSE, NULL);
-
- if (g_simple_async_result_propagate_error (simple, error))
- goto out;
-
- out:
- return result;
-}
diff --git a/src/nullbackend/polkitbackendnullauthority.h b/src/nullbackend/polkitbackendnullauthority.h
deleted file mode 100644
index 318e482..0000000
--- a/src/nullbackend/polkitbackendnullauthority.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2009 Red Hat, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General
- * Public License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: David Zeuthen <davidz@redhat.com>
- */
-
-#ifndef __POLKIT_BACKEND_NULL_AUTHORITY_H
-#define __POLKIT_BACKEND_NULL_AUTHORITY_H
-
-#include <polkitbackend/polkitbackend.h>
-
-G_BEGIN_DECLS
-
-#define POLKIT_BACKEND_TYPE_NULL_AUTHORITY (polkit_backend_null_authority_get_type ())
-#define POLKIT_BACKEND_NULL_AUTHORITY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), POLKIT_BACKEND_TYPE_NULL_AUTHORITY, PolkitBackendNullAuthority))
-#define POLKIT_BACKEND_NULL_AUTHORITY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), POLKIT_BACKEND_TYPE_NULL_AUTHORITY, PolkitBackendNullAuthorityClass))
-#define POLKIT_BACKEND_NULL_AUTHORITY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), POLKIT_BACKEND_TYPE_NULL_AUTHORITY,PolkitBackendNullAuthorityClass))
-#define POLKIT_BACKEND_IS_NULL_AUTHORITY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), POLKIT_BACKEND_TYPE_NULL_AUTHORITY))
-#define POLKIT_BACKEND_IS_NULL_AUTHORITY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), POLKIT_BACKEND_TYPE_NULL_AUTHORITY))
-
-typedef struct _PolkitBackendNullAuthority PolkitBackendNullAuthority;
-typedef struct _PolkitBackendNullAuthorityClass PolkitBackendNullAuthorityClass;
-typedef struct _PolkitBackendNullAuthorityPrivate PolkitBackendNullAuthorityPrivate;
-
-struct _PolkitBackendNullAuthority
-{
- PolkitBackendAuthority parent_instance;
- PolkitBackendNullAuthorityPrivate *priv;
-};
-
-struct _PolkitBackendNullAuthorityClass
-{
- PolkitBackendAuthorityClass parent_class;
-
-};
-
-GType polkit_backend_null_authority_get_type (void) G_GNUC_CONST;
-
-void polkit_backend_null_authority_register (GIOModule *module);
-
-G_END_DECLS
-
-#endif /* __POLKIT_BACKEND_NULL_AUTHORITY_H */
-