remove the distinction for local vs. remote users
authorDavid Zeuthen <davidz@redhat.com>
Tue, 19 Jun 2007 20:41:49 +0000 (16:41 -0400)
committerDavid Zeuthen <davidz@redhat.com>
Tue, 19 Jun 2007 20:41:49 +0000 (16:41 -0400)
Again, we punt this to the applications/mechanisms - they know better.

polkit-grant/polkit-grant.c
polkit/polkit-policy-default.c
polkit/polkit-policy-default.h
polkit/polkit-policy-file-entry.c
polkit/polkit-policy-file.c
tools/polkit-list-actions.c

index fcd2511..39385eb 100644 (file)
@@ -413,8 +413,8 @@ polkit_grant_initiate_auth (PolKitGrant  *polkit_grant,
 
         /* TODO: verify incoming args */
 
-        helper_argv[0] = "/home/davidz/Hacking/PolicyKit/polkit-grant/.libs/polkit-grant-helper";
-        // TODO FIXME: helper_argv[0] = PACKAGE_LIBEXEC_DIR "/polkit-grant-helper";
+        /* helper_argv[0] = "/home/davidz/Hacking/PolicyKit/polkit-grant/.libs/polkit-grant-helper"; */
+        helper_argv[0] = PACKAGE_LIBEXEC_DIR "/polkit-grant-helper";
         if (dbus_name == NULL)
                 helper_argv[1] = "";
         else
index d9949cb..510d6ad 100644 (file)
 struct PolKitPolicyDefault
 {
         int refcount;
-        PolKitResult default_remote_inactive;
-        PolKitResult default_remote_active;
-        PolKitResult default_local_inactive;
-        PolKitResult default_local_active;
+        PolKitResult default_inactive;
+        PolKitResult default_active;
 };
 
-extern PolKitPolicyDefault *_polkit_policy_default_new (PolKitResult defaults_allow_remote_inactive,
-                                                        PolKitResult defaults_allow_remote_active,
-                                                        PolKitResult defaults_allow_local_inactive,
-                                                        PolKitResult defaults_allow_local_active);
+extern PolKitPolicyDefault *_polkit_policy_default_new (PolKitResult defaults_allow_inactive,
+                                                        PolKitResult defaults_allow_active);
 
 PolKitPolicyDefault *
-_polkit_policy_default_new (PolKitResult defaults_allow_remote_inactive,
-                            PolKitResult defaults_allow_remote_active,
-                            PolKitResult defaults_allow_local_inactive,
-                            PolKitResult defaults_allow_local_active)
+_polkit_policy_default_new (PolKitResult defaults_allow_inactive,
+                            PolKitResult defaults_allow_active)
 {
         PolKitPolicyDefault *pd;
 
         pd = g_new0 (PolKitPolicyDefault, 1);
         pd->refcount = 1;
-        pd->default_remote_inactive = defaults_allow_remote_inactive;
-        pd->default_remote_active = defaults_allow_remote_active;
-        pd->default_local_inactive = defaults_allow_local_inactive;
-        pd->default_local_active = defaults_allow_local_active;
+        pd->default_inactive = defaults_allow_inactive;
+        pd->default_active = defaults_allow_active;
         return pd;
 }
 
@@ -130,15 +122,11 @@ polkit_policy_default_debug (PolKitPolicyDefault *policy_default)
 {
         g_return_if_fail (policy_default != NULL);
         _pk_debug ("PolKitPolicyDefault: refcount=%d\n"
-                   "  default_remote_inactive=%s\n"
-                   "    default_remote_active=%s\n"
-                   "   default_local_inactive=%s\n"
-                   "     default_local_active=%s", 
+                   "   default_inactive=%s\n"
+                   "     default_active=%s", 
                    policy_default->refcount,
-                   polkit_result_to_string_representation (policy_default->default_remote_inactive),
-                   polkit_result_to_string_representation (policy_default->default_remote_active),
-                   polkit_result_to_string_representation (policy_default->default_local_inactive),
-                   polkit_result_to_string_representation (policy_default->default_local_active));
+                   polkit_result_to_string_representation (policy_default->default_inactive),
+                   polkit_result_to_string_representation (policy_default->default_active));
 }
 
 
@@ -175,18 +163,13 @@ polkit_policy_default_can_session_do_action (PolKitPolicyDefault *policy_default
         if (!polkit_session_get_ck_is_active (session, &is_active))
                 goto out;
 
-        if (is_local) {
-                if (is_active) {
-                        ret = policy_default->default_local_active;
-                } else {
-                        ret = policy_default->default_local_inactive;
-                }
+        if (!is_local)
+                goto out;
+
+        if (is_active) {
+                ret = policy_default->default_active;
         } else {
-                if (is_active) {
-                        ret = policy_default->default_remote_active;
-                } else {
-                        ret = policy_default->default_remote_inactive;
-                }
+                ret = policy_default->default_inactive;
         }
 out:
         return ret;
@@ -230,55 +213,21 @@ polkit_policy_default_can_caller_do_action (PolKitPolicyDefault *policy_default,
         if (!polkit_session_get_ck_is_active (session, &is_active))
                 goto out;
 
-        if (is_local) {
-                if (is_active) {
-                        ret = policy_default->default_local_active;
-                } else {
-                        ret = policy_default->default_local_inactive;
-                }
+        if (!is_local)
+                goto out;
+
+        if (is_active) {
+                ret = policy_default->default_active;
         } else {
-                if (is_active) {
-                        ret = policy_default->default_remote_active;
-                } else {
-                        ret = policy_default->default_remote_inactive;
-                }
+                ret = policy_default->default_inactive;
         }
+
 out:
         return ret;
 }
 
 /**
- * polkit_policy_default_get_allow_remote_inactive:
- * @policy_default: the object
- * 
- * Get default policy.
- * 
- * Returns: default policy
- **/
-PolKitResult
-polkit_policy_default_get_allow_remote_inactive (PolKitPolicyDefault *policy_default)
-{
-        g_return_val_if_fail (policy_default != NULL, POLKIT_RESULT_NO);
-        return policy_default->default_remote_inactive;
-}
-
-/**
- * polkit_policy_default_get_allow_remote_active:
- * @policy_default: the object
- * 
- * Get default policy.
- * 
- * Returns: default policy
- **/
-PolKitResult
-polkit_policy_default_get_allow_remote_active (PolKitPolicyDefault *policy_default)
-{
-        g_return_val_if_fail (policy_default != NULL, POLKIT_RESULT_NO);
-        return policy_default->default_remote_active;
-}
-
-/**
- * polkit_policy_default_get_allow_local_inactive:
+ * polkit_policy_default_get_allow_inactive:
  * @policy_default: the object
  * 
  * Get default policy.
@@ -286,14 +235,14 @@ polkit_policy_default_get_allow_remote_active (PolKitPolicyDefault *policy_defau
  * Returns: default policy
  **/
 PolKitResult
-polkit_policy_default_get_allow_local_inactive (PolKitPolicyDefault *policy_default)
+polkit_policy_default_get_allow_inactive (PolKitPolicyDefault *policy_default)
 {
         g_return_val_if_fail (policy_default != NULL, POLKIT_RESULT_NO);
-        return policy_default->default_local_inactive;
+        return policy_default->default_inactive;
 }
 
 /**
- * polkit_policy_default_get_allow_local_active:
+ * polkit_policy_default_get_allow_active:
  * @policy_default: the object
  * 
  * Get default policy.
@@ -301,9 +250,9 @@ polkit_policy_default_get_allow_local_inactive (PolKitPolicyDefault *policy_defa
  * Returns: default policy
  **/
 PolKitResult
-polkit_policy_default_get_allow_local_active (PolKitPolicyDefault *policy_default)
+polkit_policy_default_get_allow_active (PolKitPolicyDefault *policy_default)
 {
         g_return_val_if_fail (policy_default != NULL, POLKIT_RESULT_NO);
-        return policy_default->default_local_active;
+        return policy_default->default_active;
 }
 
index 68b6946..2a6b48a 100644 (file)
@@ -51,10 +51,8 @@ PolKitResult polkit_policy_default_can_caller_do_action (PolKitPolicyDefault *po
                                                          PolKitAction        *action,
                                                          PolKitCaller        *caller);
 
-PolKitResult polkit_policy_default_get_allow_remote_inactive (PolKitPolicyDefault *policy_default);
-PolKitResult polkit_policy_default_get_allow_remote_active (PolKitPolicyDefault *policy_default);
-PolKitResult polkit_policy_default_get_allow_local_inactive (PolKitPolicyDefault *policy_default);
-PolKitResult polkit_policy_default_get_allow_local_active (PolKitPolicyDefault *policy_default);
+PolKitResult polkit_policy_default_get_allow_inactive (PolKitPolicyDefault *policy_default);
+PolKitResult polkit_policy_default_get_allow_active (PolKitPolicyDefault *policy_default);
 
 /* TODO: export knobs for "default policy" */
 
index c0c7941..988b9c2 100644 (file)
@@ -63,39 +63,27 @@ struct PolKitPolicyFileEntry
         PolKitPolicyDefault *defaults;
 
         char *group_description;
-        char *group_description_short;
         char *policy_description;
-        char *policy_missing;
-        char *policy_apply_all_mnemonic;
 };
 
 extern void _polkit_policy_file_entry_set_descriptions (PolKitPolicyFileEntry *pfe,
                                                         const char *group_description,
-                                                        const char *group_description_short,
-                                                        const char *policy_description,
-                                                        const char *policy_missing,
-                                                        const char *policy_apply_all_mnemonic);
+                                                        const char *policy_description);
 
 
-extern PolKitPolicyDefault *_polkit_policy_default_new (PolKitResult defaults_allow_remote_inactive,
-                                                        PolKitResult defaults_allow_remote_active,
-                                                        PolKitResult defaults_allow_local_inactive,
-                                                        PolKitResult defaults_allow_local_active);
+extern PolKitPolicyDefault *_polkit_policy_default_new (PolKitResult defaults_allow_inactive,
+                                                        PolKitResult defaults_allow_active);
 
 extern PolKitPolicyFileEntry *_polkit_policy_file_entry_new   (const char *action_group_id,
                                                                const char *action_id, 
-                                                               PolKitResult defaults_allow_remote_inactive,
-                                                               PolKitResult defaults_allow_remote_active,
-                                                               PolKitResult defaults_allow_local_inactive,
-                                                               PolKitResult defaults_allow_local_active);
+                                                               PolKitResult defaults_allow_inactive,
+                                                               PolKitResult defaults_allow_active);
 
 extern PolKitPolicyFileEntry *
 _polkit_policy_file_entry_new   (const char *action_group_id,
                                  const char *action_id, 
-                                 PolKitResult defaults_allow_remote_inactive,
-                                 PolKitResult defaults_allow_remote_active,
-                                 PolKitResult defaults_allow_local_inactive,
-                                 PolKitResult defaults_allow_local_active)
+                                 PolKitResult defaults_allow_inactive,
+                                 PolKitResult defaults_allow_active)
 {
         PolKitPolicyFileEntry *pfe;
 
@@ -104,10 +92,8 @@ _polkit_policy_file_entry_new   (const char *action_group_id,
         pfe->action = g_strdup (action_id);
         pfe->group = g_strdup (action_group_id);
 
-        pfe->defaults = _polkit_policy_default_new (defaults_allow_remote_inactive,
-                                                    defaults_allow_remote_active,
-                                                    defaults_allow_local_inactive,
-                                                    defaults_allow_local_active);
+        pfe->defaults = _polkit_policy_default_new (defaults_allow_inactive,
+                                                    defaults_allow_active);
         if (pfe->defaults == NULL)
                 goto error;
 
@@ -121,17 +107,11 @@ error:
 void 
 _polkit_policy_file_entry_set_descriptions (PolKitPolicyFileEntry *policy_file_entry,
                                             const char *group_description,
-                                            const char *group_description_short,
-                                            const char *policy_description,
-                                            const char *policy_missing,
-                                            const char *policy_apply_all_mnemonic)
+                                            const char *policy_description)
 {
         g_return_if_fail (policy_file_entry != NULL);
         policy_file_entry->group_description = g_strdup (group_description);
-        policy_file_entry->group_description_short = g_strdup (group_description_short);
         policy_file_entry->policy_description = g_strdup (policy_description);
-        policy_file_entry->policy_missing = g_strdup (policy_missing);
-        policy_file_entry->policy_apply_all_mnemonic = g_strdup (policy_apply_all_mnemonic);
 }
 
 /**
@@ -154,25 +134,6 @@ polkit_policy_file_get_group_description (PolKitPolicyFileEntry *policy_file_ent
 }
 
 /**
- * polkit_policy_file_get_group_description_short:
- * @policy_file_entry: the object
- * 
- * Get the short description of the group that this policy entry describes.
- *
- * Note, if polkit_context_set_load_descriptions() on the
- * #PolKitContext object used to get this object wasn't called, this
- * method will return #NULL.
- * 
- * Returns: string or #NULL if descriptions are not loaded - caller shall not free this string
- **/
-const char *
-polkit_policy_file_get_group_description_short (PolKitPolicyFileEntry *policy_file_entry)
-{
-        g_return_val_if_fail (policy_file_entry != NULL, NULL);
-        return policy_file_entry->group_description_short;
-}
-
-/**
  * polkit_policy_file_get_action_description:
  * @policy_file_entry: the object
  * 
@@ -192,54 +153,6 @@ polkit_policy_file_get_action_description (PolKitPolicyFileEntry *policy_file_en
 }
 
 /**
- * polkit_policy_file_get_action_missing:
- * @policy_file_entry: the object
- * 
- * Get a phrase, for the policy entry in question, that can be shown
- * in the user interface explaining that the caller doesn't possess
- * the privilege to perform the given action.
- *
- * The returned string may contain a single %s entry - the caller
- * should use a printf-style function to replace this with a human
- * readable description of the resource in question.
- *
- * Note, if polkit_context_set_load_descriptions() on the
- * #PolKitContext object used to get this object wasn't called, this
- * method will return #NULL.
- * 
- * Returns: string or #NULL if descriptions are not loaded - caller shall not free this string
- **/
-const char *
-polkit_policy_file_get_action_missing (PolKitPolicyFileEntry *policy_file_entry)
-{
-        g_return_val_if_fail (policy_file_entry != NULL, NULL);
-        return policy_file_entry->policy_missing;
-}
-
-/**
- * polkit_policy_file_get_action_apply_to_all_mnemonic:
- * @policy_file_entry: the object
- * 
- * Get a phrase, for the policy entry in question, that can be shown
- * in the user interface for a checkbox whether the grant of a
- * privilege should apply to all resources. The string may contain a
- * single underscore to indicate a mnemonic shortcut.
- *
- * Note, if polkit_context_set_load_descriptions() on the
- * #PolKitContext object used to get this object wasn't called, this
- * method will return #NULL.
- * 
- * Returns: string or #NULL if descriptions are not loaded - caller shall not free this string
- **/
-const char *
-polkit_policy_file_get_action_apply_to_all_mnemonic (PolKitPolicyFileEntry *policy_file_entry)
-{
-        g_return_val_if_fail (policy_file_entry != NULL, NULL);
-        return policy_file_entry->policy_apply_all_mnemonic;
-}
-
-
-/**
  * polkit_policy_file_entry_ref:
  * @policy_file_entry: the policy file object
  * 
@@ -275,10 +188,7 @@ polkit_policy_file_entry_unref (PolKitPolicyFileEntry *policy_file_entry)
                 polkit_policy_default_unref (policy_file_entry->defaults);
 
         g_free (policy_file_entry->group_description);
-        g_free (policy_file_entry->group_description_short);
         g_free (policy_file_entry->policy_description);
-        g_free (policy_file_entry->policy_missing);
-        g_free (policy_file_entry->policy_apply_all_mnemonic);
 
         g_free (policy_file_entry);
 }
index 043fe90..7e67a15 100644 (file)
@@ -66,26 +66,19 @@ struct PolKitPolicyFile
 
 extern PolKitPolicyFileEntry *_polkit_policy_file_entry_new   (const char *action_group_id,
                                                                const char *action_id, 
-                                                               PolKitResult defaults_allow_remote_inactive,
-                                                               PolKitResult defaults_allow_remote_active,
-                                                               PolKitResult defaults_allow_local_inactive,
-                                                               PolKitResult defaults_allow_local_active);
+                                                               PolKitResult defaults_allow_inactive,
+                                                               PolKitResult defaults_allow_active);
 
 enum {
         STATE_NONE,
         STATE_IN_POLICY_CONFIG,
         STATE_IN_GROUP,
         STATE_IN_GROUP_DESCRIPTION,
-        STATE_IN_GROUP_DESCRIPTION_SHORT,
         STATE_IN_POLICY,
         STATE_IN_POLICY_DESCRIPTION,
-        STATE_IN_POLICY_MISSING,
-        STATE_IN_POLICY_APPLY_TO_ALL_MNEMONIC,
         STATE_IN_DEFAULTS,
-        STATE_IN_DEFAULTS_ALLOW_REMOTE_INACTIVE,
-        STATE_IN_DEFAULTS_ALLOW_REMOTE_ACTIVE,
-        STATE_IN_DEFAULTS_ALLOW_LOCAL_INACTIVE,
-        STATE_IN_DEFAULTS_ALLOW_LOCAL_ACTIVE
+        STATE_IN_DEFAULTS_ALLOW_INACTIVE,
+        STATE_IN_DEFAULTS_ALLOW_ACTIVE
 };
 
 typedef struct {
@@ -94,20 +87,15 @@ typedef struct {
         char *group_id;
         char *action_id;
 
-        PolKitResult defaults_allow_remote_inactive;
-        PolKitResult defaults_allow_remote_active;
-        PolKitResult defaults_allow_local_inactive;
-        PolKitResult defaults_allow_local_active;
+        PolKitResult defaults_allow_inactive;
+        PolKitResult defaults_allow_active;
 
         PolKitPolicyFile *pf;
 
         polkit_bool_t load_descriptions;
 
         char *group_description;
-        char *group_description_short;
         char *policy_description;
-        char *policy_missing;
-        char *policy_apply_all_mnemonic;
 } ParserData;
 
 static void
@@ -137,9 +125,7 @@ _start (void *data, const char *el, const char **attr)
                         state = STATE_IN_GROUP;
 
                         g_free (pd->group_description);
-                        g_free (pd->group_description_short);
                         pd->group_description = NULL;
-                        pd->group_description_short = NULL;
                 }
                 break;
         case STATE_IN_GROUP:
@@ -151,57 +137,33 @@ _start (void *data, const char *el, const char **attr)
                         state = STATE_IN_POLICY;
 
                         pd->policy_description = NULL;
-                        pd->policy_missing = NULL;
-                        pd->policy_apply_all_mnemonic = NULL;
 
                         /* initialize defaults */
-                        pd->defaults_allow_remote_inactive = POLKIT_RESULT_NO;
-                        pd->defaults_allow_remote_active = POLKIT_RESULT_NO;
-                        pd->defaults_allow_local_inactive = POLKIT_RESULT_NO;
-                        pd->defaults_allow_local_active = POLKIT_RESULT_NO;
+                        pd->defaults_allow_inactive = POLKIT_RESULT_NO;
+                        pd->defaults_allow_active = POLKIT_RESULT_NO;
                 }
                 else if (strcmp (el, "description") == 0)
                         state = STATE_IN_GROUP_DESCRIPTION;
-                else if (strcmp (el, "description_short") == 0)
-                        state = STATE_IN_GROUP_DESCRIPTION_SHORT;
                 break;
         case STATE_IN_GROUP_DESCRIPTION:
                 break;
-        case STATE_IN_GROUP_DESCRIPTION_SHORT:
-                break;
         case STATE_IN_POLICY:
                 if (strcmp (el, "defaults") == 0)
                         state = STATE_IN_DEFAULTS;
                 else if (strcmp (el, "description") == 0)
                         state = STATE_IN_POLICY_DESCRIPTION;
-                else if (strcmp (el, "missing") == 0)
-                        state = STATE_IN_POLICY_MISSING;
-                else if (strcmp (el, "apply_to_all_mnemonic") == 0)
-                        state = STATE_IN_POLICY_APPLY_TO_ALL_MNEMONIC;
                 break;
         case STATE_IN_POLICY_DESCRIPTION:
                 break;
-        case STATE_IN_POLICY_MISSING:
-                break;
-        case STATE_IN_POLICY_APPLY_TO_ALL_MNEMONIC:
-                break;
         case STATE_IN_DEFAULTS:
-                if (strcmp (el, "allow_remote_inactive") == 0)
-                        state = STATE_IN_DEFAULTS_ALLOW_REMOTE_INACTIVE;
-                else if (strcmp (el, "allow_remote_active") == 0)
-                        state = STATE_IN_DEFAULTS_ALLOW_REMOTE_ACTIVE;
-                else if (strcmp (el, "allow_local_inactive") == 0)
-                        state = STATE_IN_DEFAULTS_ALLOW_LOCAL_INACTIVE;
-                else if (strcmp (el, "allow_local_active") == 0)
-                        state = STATE_IN_DEFAULTS_ALLOW_LOCAL_ACTIVE;
-                break;
-        case STATE_IN_DEFAULTS_ALLOW_REMOTE_INACTIVE:
+                if (strcmp (el, "allow_inactive") == 0)
+                        state = STATE_IN_DEFAULTS_ALLOW_INACTIVE;
+                else if (strcmp (el, "allow_active") == 0)
+                        state = STATE_IN_DEFAULTS_ALLOW_ACTIVE;
                 break;
-        case STATE_IN_DEFAULTS_ALLOW_REMOTE_ACTIVE:
+        case STATE_IN_DEFAULTS_ALLOW_INACTIVE:
                 break;
-        case STATE_IN_DEFAULTS_ALLOW_LOCAL_INACTIVE:
-                break;
-        case STATE_IN_DEFAULTS_ALLOW_LOCAL_ACTIVE:
+        case STATE_IN_DEFAULTS_ALLOW_ACTIVE:
                 break;
         default:
                 break;
@@ -231,42 +193,17 @@ _cdata (void *data, const char *s, int len)
                         pd->group_description = g_strdup (str);
                 break;
                 
-        case STATE_IN_GROUP_DESCRIPTION_SHORT:
-                if (pd->load_descriptions)
-                        pd->group_description_short = g_strdup (str);
-                break;
-
         case STATE_IN_POLICY_DESCRIPTION:
                 if (pd->load_descriptions)
                         pd->policy_description = g_strdup (str);
                 break;
 
-        case STATE_IN_POLICY_MISSING:
-                if (pd->load_descriptions)
-                        pd->policy_missing = g_strdup (str);
-                break;
-
-        case STATE_IN_POLICY_APPLY_TO_ALL_MNEMONIC:
-                if (pd->load_descriptions)
-                        pd->policy_apply_all_mnemonic = g_strdup (str);
-                break;
-
-                
-
-        case STATE_IN_DEFAULTS_ALLOW_REMOTE_INACTIVE:
-                if (!polkit_result_from_string_representation (str, &pd->defaults_allow_remote_inactive))
-                        goto error;
-                break;
-        case STATE_IN_DEFAULTS_ALLOW_REMOTE_ACTIVE:
-                if (!polkit_result_from_string_representation (str, &pd->defaults_allow_remote_active))
-                        goto error;
-                break;
-        case STATE_IN_DEFAULTS_ALLOW_LOCAL_INACTIVE:
-                if (!polkit_result_from_string_representation (str, &pd->defaults_allow_local_inactive))
+        case STATE_IN_DEFAULTS_ALLOW_INACTIVE:
+                if (!polkit_result_from_string_representation (str, &pd->defaults_allow_inactive))
                         goto error;
                 break;
-        case STATE_IN_DEFAULTS_ALLOW_LOCAL_ACTIVE:
-                if (!polkit_result_from_string_representation (str, &pd->defaults_allow_local_active))
+        case STATE_IN_DEFAULTS_ALLOW_ACTIVE:
+                if (!polkit_result_from_string_representation (str, &pd->defaults_allow_active))
                         goto error;
                 break;
         default:
@@ -282,10 +219,7 @@ error:
 
 extern void _polkit_policy_file_entry_set_descriptions (PolKitPolicyFileEntry *pfe,
                                                         const char *group_description,
-                                                        const char *group_description_short,
-                                                        const char *policy_description,
-                                                        const char *policy_missing,
-                                                        const char *policy_apply_all_mnemonic);
+                                                        const char *policy_description);
 
 static void
 _end (void *data, const char *el)
@@ -307,28 +241,20 @@ _end (void *data, const char *el)
         case STATE_IN_GROUP_DESCRIPTION:
                 state = STATE_IN_GROUP;
                 break;
-        case STATE_IN_GROUP_DESCRIPTION_SHORT:
-                state = STATE_IN_GROUP;
-                break;
         case STATE_IN_POLICY:
         {
                 PolKitPolicyFileEntry *pfe;
 
                 pfe = _polkit_policy_file_entry_new (pd->group_id, pd->action_id, 
-                                                     pd->defaults_allow_remote_inactive,
-                                                     pd->defaults_allow_remote_active,
-                                                     pd->defaults_allow_local_inactive,
-                                                     pd->defaults_allow_local_active);
+                                                     pd->defaults_allow_inactive,
+                                                     pd->defaults_allow_active);
                 if (pfe == NULL)
                         goto error;
 
                 if (pd->load_descriptions)
                         _polkit_policy_file_entry_set_descriptions (pfe,
                                                                     pd->group_description,
-                                                                    pd->group_description_short,
-                                                                    pd->policy_description,
-                                                                    pd->policy_missing,
-                                                                    pd->policy_apply_all_mnemonic);
+                                                                    pd->policy_description);
 
                 pd->pf->entries = g_slist_prepend (pd->pf->entries, pfe);
 
@@ -338,25 +264,13 @@ _end (void *data, const char *el)
         case STATE_IN_POLICY_DESCRIPTION:
                 state = STATE_IN_POLICY;
                 break;
-        case STATE_IN_POLICY_MISSING:
-                state = STATE_IN_POLICY;
-                break;
-        case STATE_IN_POLICY_APPLY_TO_ALL_MNEMONIC:
-                state = STATE_IN_POLICY;
-                break;
         case STATE_IN_DEFAULTS:
                 state = STATE_IN_POLICY;
                 break;
-        case STATE_IN_DEFAULTS_ALLOW_REMOTE_INACTIVE:
-                state = STATE_IN_DEFAULTS;
-                break;
-        case STATE_IN_DEFAULTS_ALLOW_REMOTE_ACTIVE:
-                state = STATE_IN_DEFAULTS;
-                break;
-        case STATE_IN_DEFAULTS_ALLOW_LOCAL_INACTIVE:
+        case STATE_IN_DEFAULTS_ALLOW_INACTIVE:
                 state = STATE_IN_DEFAULTS;
                 break;
-        case STATE_IN_DEFAULTS_ALLOW_LOCAL_ACTIVE:
+        case STATE_IN_DEFAULTS_ALLOW_ACTIVE:
                 state = STATE_IN_DEFAULTS;
                 break;
         default:
@@ -430,10 +344,7 @@ polkit_policy_file_new (const char *path, polkit_bool_t load_descriptions, PolKi
         pd.group_id = NULL;
         pd.action_id = NULL;
         pd.group_description = NULL;
-        pd.group_description_short = NULL;
         pd.policy_description = NULL;
-        pd.policy_missing = NULL;
-        pd.policy_apply_all_mnemonic = NULL;
         pd.pf = pf;
         pd.load_descriptions = load_descriptions;
 
@@ -442,10 +353,7 @@ polkit_policy_file_new (const char *path, polkit_bool_t load_descriptions, PolKi
         g_free (pd.group_id);
         g_free (pd.action_id);
         g_free (pd.group_description);
-        g_free (pd.group_description_short);
         g_free (pd.policy_description);
-        g_free (pd.policy_missing);
-        g_free (pd.policy_apply_all_mnemonic);
 
        if (xml_res == 0) {
                 polkit_error_set_error (error, POLKIT_ERROR_POLICY_FILE_INVALID,
index 756c1d8..aab23a0 100644 (file)
@@ -61,39 +61,28 @@ _print_entry (PolKitPolicyCache *policy_cache,
         const char *action_id;
         const char *group_id;
         PolKitPolicyDefault *def;
-        PolKitResult default_remote_inactive;
-        PolKitResult default_remote_active;
-        PolKitResult default_local_inactive;
-        PolKitResult default_local_active;
+        PolKitResult default_inactive;
+        PolKitResult default_active;
 
         action_id = polkit_policy_file_entry_get_id (pfe);
         group_id = polkit_policy_file_entry_get_group_id (pfe);
         def = polkit_policy_file_entry_get_default (pfe);
-        default_remote_inactive = polkit_policy_default_get_allow_remote_inactive (def);
-        default_remote_active = polkit_policy_default_get_allow_remote_active (def);
-        default_local_inactive = polkit_policy_default_get_allow_local_inactive (def);
-        default_local_active = polkit_policy_default_get_allow_local_active (def);
+        default_inactive = polkit_policy_default_get_allow_inactive (def);
+        default_active = polkit_policy_default_get_allow_active (def);
 
         printf ("Policy\n"
                 "------\n"
-                "group                   = %s ('%s') ('%s')\n"
-                "action                  = %s ('%s') ('%s') ('%s')\n"
-                "default_remote_inactive = %s\n"
-                "default_remote_active   = %s\n"
-                "default_local_inactive  = %s\n"
-                "default_local_active    = %s\n"
+                "group             = %s ('%s')\n"
+                "action            = %s ('%s')\n"
+                "default_inactive  = %s\n"
+                "default_active    = %s\n"
                 "\n", 
                 group_id, 
                 polkit_policy_file_get_group_description (pfe),
-                polkit_policy_file_get_group_description_short (pfe),
                 action_id,
                 polkit_policy_file_get_action_description (pfe),
-                polkit_policy_file_get_action_missing (pfe),
-                polkit_policy_file_get_action_apply_to_all_mnemonic (pfe),
-                polkit_result_to_string_representation (default_remote_inactive),
-                polkit_result_to_string_representation (default_remote_active),
-                polkit_result_to_string_representation (default_local_inactive),
-                polkit_result_to_string_representation (default_local_active));
+                polkit_result_to_string_representation (default_inactive),
+                polkit_result_to_string_representation (default_active));
 }
 
 int