PolicyKit: Branch 'master'
David Zeuthen
david at kemper.freedesktop.org
Tue Jun 19 17:12:01 PDT 2007
modules/Makefile.am | 3 --
modules/allow-all/polkit-module-allow-all.c | 22 +++++++---------
modules/deny-all/polkit-module-deny-all.c | 22 +++++++---------
modules/run-program/polkit-module-run-program.c | 32 +++---------------------
4 files changed, 25 insertions(+), 54 deletions(-)
New commits:
diff-tree 1d16acb6935a8188a98699d431e1e9ec327bdf9d (from 2ec20531b4976576f650acee5ed8f5fa3a3a9541)
Author: David Zeuthen <davidz at redhat.com>
Date: Tue Jun 19 20:12:00 2007 -0400
build fixes
diff --git a/modules/Makefile.am b/modules/Makefile.am
index 700fa84..010ed66 100644
--- a/modules/Makefile.am
+++ b/modules/Makefile.am
@@ -1,6 +1,5 @@
-#SUBDIRS = default allow-all deny-all run-program grant
-SUBDIRS = default grant
+SUBDIRS = default allow-all deny-all run-program grant
polkitconfdir = $(sysconfdir)/PolicyKit
dist_polkitconf_DATA = PolicyKit.conf
diff --git a/modules/allow-all/polkit-module-allow-all.c b/modules/allow-all/polkit-module-allow-all.c
index 0d32478..06a15d2 100644
--- a/modules/allow-all/polkit-module-allow-all.c
+++ b/modules/allow-all/polkit-module-allow-all.c
@@ -45,21 +45,19 @@ _module_shutdown (PolKitModuleInterface
}
static PolKitResult
-_module_can_session_access_resource (PolKitModuleInterface *module_interface,
- PolKitContext *pk_context,
- PolKitAction *action,
- PolKitResource *resource,
- PolKitSession *session)
+_module_can_session_do_action (PolKitModuleInterface *module_interface,
+ PolKitContext *pk_context,
+ PolKitAction *action,
+ PolKitSession *session)
{
return POLKIT_RESULT_YES;
}
static PolKitResult
-_module_can_caller_access_resource (PolKitModuleInterface *module_interface,
- PolKitContext *pk_context,
- PolKitAction *action,
- PolKitResource *resource,
- PolKitCaller *caller)
+_module_can_caller_do_action (PolKitModuleInterface *module_interface,
+ PolKitContext *pk_context,
+ PolKitAction *action,
+ PolKitCaller *caller)
{
return POLKIT_RESULT_YES;
}
@@ -75,8 +73,8 @@ polkit_module_set_functions (PolKitModul
polkit_module_set_func_initialize (module_interface, _module_init);
polkit_module_set_func_shutdown (module_interface, _module_shutdown);
- polkit_module_set_func_can_session_access_resource (module_interface, _module_can_session_access_resource);
- polkit_module_set_func_can_caller_access_resource (module_interface, _module_can_caller_access_resource);
+ polkit_module_set_func_can_session_do_action (module_interface, _module_can_session_do_action);
+ polkit_module_set_func_can_caller_do_action (module_interface, _module_can_caller_do_action);
ret = TRUE;
out:
diff --git a/modules/deny-all/polkit-module-deny-all.c b/modules/deny-all/polkit-module-deny-all.c
index 0306e19..829c570 100644
--- a/modules/deny-all/polkit-module-deny-all.c
+++ b/modules/deny-all/polkit-module-deny-all.c
@@ -45,21 +45,19 @@ _module_shutdown (PolKitModuleInterface
}
static PolKitResult
-_module_can_session_access_resource (PolKitModuleInterface *module_interface,
- PolKitContext *pk_context,
- PolKitAction *action,
- PolKitResource *resource,
- PolKitSession *session)
+_module_can_session_do_action (PolKitModuleInterface *module_interface,
+ PolKitContext *pk_context,
+ PolKitAction *action,
+ PolKitSession *session)
{
return POLKIT_RESULT_NO;
}
static PolKitResult
-_module_can_caller_access_resource (PolKitModuleInterface *module_interface,
- PolKitContext *pk_context,
- PolKitAction *action,
- PolKitResource *resource,
- PolKitCaller *caller)
+_module_can_caller_do_action (PolKitModuleInterface *module_interface,
+ PolKitContext *pk_context,
+ PolKitAction *action,
+ PolKitCaller *caller)
{
return POLKIT_RESULT_NO;
}
@@ -75,8 +73,8 @@ polkit_module_set_functions (PolKitModul
polkit_module_set_func_initialize (module_interface, _module_init);
polkit_module_set_func_shutdown (module_interface, _module_shutdown);
- polkit_module_set_func_can_session_access_resource (module_interface, _module_can_session_access_resource);
- polkit_module_set_func_can_caller_access_resource (module_interface, _module_can_caller_access_resource);
+ polkit_module_set_func_can_session_do_action (module_interface, _module_can_session_do_action);
+ polkit_module_set_func_can_caller_do_action (module_interface, _module_can_caller_do_action);
ret = TRUE;
out:
diff --git a/modules/run-program/polkit-module-run-program.c b/modules/run-program/polkit-module-run-program.c
index e08235f..e5c00dc 100644
--- a/modules/run-program/polkit-module-run-program.c
+++ b/modules/run-program/polkit-module-run-program.c
@@ -110,22 +110,6 @@ error:
}
static polkit_bool_t
-_add_resource_to_env (PolKitResource *resource, GPtrArray *envp)
-{
- char *r_type;
- char *r_id;
- if (!polkit_resource_get_resource_type (resource, &r_type))
- goto error;
- if (!polkit_resource_get_resource_id (resource, &r_id))
- goto error;
- g_ptr_array_add (envp, g_strdup_printf ("POLKIT_RESOURCE_TYPE=%s", r_type));
- g_ptr_array_add (envp, g_strdup_printf ("POLKIT_RESOURCE_ID=%s", r_id));
- return TRUE;
-error:
- return FALSE;
-}
-
-static polkit_bool_t
_add_seat_to_env (PolKitSeat *seat, GPtrArray *envp)
{
char *s_ck_objref;
@@ -257,10 +241,9 @@ error:
static PolKitResult
-_module_can_session_access_resource (PolKitModuleInterface *module_interface,
+_module_can_session_do_action (PolKitModuleInterface *module_interface,
PolKitContext *pk_context,
PolKitAction *action,
- PolKitResource *resource,
PolKitSession *session)
{
PolKitResult result;
@@ -276,9 +259,6 @@ _module_can_session_access_resource (Pol
if (!_add_action_to_env (action, envp))
goto error;
- if (resource != NULL)
- if (!_add_resource_to_env (resource, envp))
- goto error;
if (!_add_session_to_env (session, envp))
goto error;
g_ptr_array_add (envp, g_strdup ("PATH=/usr/bin:/bin"));
@@ -297,10 +277,9 @@ error:
}
static PolKitResult
-_module_can_caller_access_resource (PolKitModuleInterface *module_interface,
+_module_can_caller_do_action (PolKitModuleInterface *module_interface,
PolKitContext *pk_context,
PolKitAction *action,
- PolKitResource *resource,
PolKitCaller *caller)
{
PolKitResult result;
@@ -314,9 +293,6 @@ _module_can_caller_access_resource (PolK
envp = g_ptr_array_new ();
if (!_add_action_to_env (action, envp))
goto error;
- if (resource != NULL)
- if (!_add_resource_to_env (resource, envp))
- goto error;
if (!_add_caller_to_env (caller, envp))
goto error;
g_ptr_array_add (envp, g_strdup ("PATH=/usr/bin:/bin"));
@@ -344,8 +320,8 @@ polkit_module_set_functions (PolKitModul
polkit_module_set_func_initialize (module_interface, _module_init);
polkit_module_set_func_shutdown (module_interface, _module_shutdown);
- polkit_module_set_func_can_session_access_resource (module_interface, _module_can_session_access_resource);
- polkit_module_set_func_can_caller_access_resource (module_interface, _module_can_caller_access_resource);
+ polkit_module_set_func_can_session_do_action (module_interface, _module_can_session_do_action);
+ polkit_module_set_func_can_caller_do_action (module_interface, _module_can_caller_do_action);
ret = TRUE;
out:
More information about the hal-commit
mailing list