summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2010-01-19 20:36:03 -0500
committerMatthias Clasen <mclasen@redhat.com>2010-01-19 20:36:03 -0500
commit67a2478f610be4beff34258a5a5b36243415b069 (patch)
tree6a0094462368e79a961b5129c854f385dd3e1a3b
parent2c5de6d7361ce94907dc678c396d963b3eb38d80 (diff)
downloadgconf-67a2478f610be4beff34258a5a5b36243415b069.tar.gz
Make the defaults mechanism find the right polkit action
Due to a thinko in the code, the mechanism was always using the default privileges.
-rw-r--r--defaults/gconf-defaults.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/defaults/gconf-defaults.c b/defaults/gconf-defaults.c
index 11a38ad4..b84c632d 100644
--- a/defaults/gconf-defaults.c
+++ b/defaults/gconf-defaults.c
@@ -286,8 +286,8 @@ polkit_action_for_gconf_path (GConfDefaults *mechanism,
PolkitActionDescription *action_description;
const gchar *annotation;
+ g_debug ("finding action for path '%s'", path);
prefix = g_strdup (path);
-
while (1) {
for (l = action_descriptions; l; l = l->next) {
action_description = l->data;
@@ -295,8 +295,8 @@ polkit_action_for_gconf_path (GConfDefaults *mechanism,
annotation = polkit_action_description_get_annotation (action_description, annotation_key);
if (g_strcmp0 (prefix, annotation) == 0) {
action = polkit_action_description_get_action_id (action_description);
- g_debug ("action for path '%s': '%s'\n", action, path);
- break;
+ g_debug ("action for prefix '%s': '%s'\n", prefix, action);
+ goto found;
}
}
@@ -310,6 +310,7 @@ polkit_action_for_gconf_path (GConfDefaults *mechanism,
*p = 0;
}
+ found:
g_free (prefix);
return action;