PolicyKit: Branch 'master'

David Zeuthen david at kemper.freedesktop.org
Sun Feb 1 13:20:42 PST 2009


 docs/polkit/Makefile.am             |    7 
 docs/polkit/polkit-docs.xml         |    3 
 docs/polkit/polkit-sections.txt     |  262 ++++++++++++++++++++++++++++++++++++
 docs/polkit/polkit.types            |   19 ++
 src/polkit/polkitauthority.c        |  224 +++++++++++++++++++++++++++++-
 src/polkit/polkitauthority.h        |    2 
 src/polkit/polkitauthoritymanager.c |    1 
 src/programs/polkit.c               |    3 
 8 files changed, 503 insertions(+), 18 deletions(-)

New commits:
commit 1581cff19de827dec8234a8ca5d040874a3dca89
Author: David Zeuthen <davidz at redhat.com>
Date:   Sun Feb 1 16:18:25 2009 -0500

    add API docs for PolkitAuthority
    
    Also slightly rearrange the doc layout.

diff --git a/docs/polkit/Makefile.am b/docs/polkit/Makefile.am
index e74fb5c..3660163 100644
--- a/docs/polkit/Makefile.am
+++ b/docs/polkit/Makefile.am
@@ -66,14 +66,17 @@ endif
 
 CLEANFILES +=   *~				\
 		polkit-scan.*			\
-		polkit.*			\
+		polkit.args			\
+		polkit.hierarchy		\
+		polkit.interfaces		\
+		polkit.prerequisites		\
+		polkit.signals			\
 		*.bak				\
 		polkit-decl-list.txt		\
 		polkit-decl.txt			\
 		polkit-overrides.txt		\
 		polkit-undeclared.txt		\
 		polkit-undocumented.txt		\
-		polkit-sections.txt		\
 		*.stamp				\
 		-rf html xml			\
 		$(NULL)
diff --git a/docs/polkit/polkit-docs.xml b/docs/polkit/polkit-docs.xml
index d486dbb..5488f75 100644
--- a/docs/polkit/polkit-docs.xml
+++ b/docs/polkit/polkit-docs.xml
@@ -59,10 +59,9 @@
     <title>Core API Reference</title>
     <xi:include href="xml/polkitauthority.xml"/>
     <xi:include href="xml/polkiterror.xml"/>
-    <xi:include href="xml/polkitauthorizationresult.xml"/>
     <xi:include href="xml/polkitactiondescription.xml"/>
+    <xi:include href="xml/polkitauthoritymanager.xml"/>
     <xi:include href="xml/polkitauthorization.xml"/>
-    <xi:include href="xml/polkitimplicitauthorization.xml"/>
     <chapter id="subjects">
       <title>Subjects</title>
       <xi:include href="xml/polkitsubject.xml"/>
diff --git a/docs/polkit/polkit-sections.txt b/docs/polkit/polkit-sections.txt
new file mode 100644
index 0000000..2094a3f
--- /dev/null
+++ b/docs/polkit/polkit-sections.txt
@@ -0,0 +1,262 @@
+<SECTION>
+<FILE>polkitunixuser</FILE>
+PolkitUnixUser
+polkit_unix_user_new
+polkit_unix_user_new_for_name
+polkit_unix_user_get_uid
+polkit_unix_user_set_uid
+<SUBSECTION Standard>
+PolkitUnixUserClass
+POLKIT_UNIX_USER
+POLKIT_IS_UNIX_USER
+POLKIT_TYPE_UNIX_USER
+polkit_unix_user_get_type
+POLKIT_UNIX_USER_CLASS
+POLKIT_IS_UNIX_USER_CLASS
+POLKIT_UNIX_USER_GET_CLASS
+</SECTION>
+
+<SECTION>
+<FILE>polkitauthoritymanager</FILE>
+PolkitAuthorityManager
+polkit_authority_manager_get
+polkit_authority_manager_enumerate_users_sync
+polkit_authority_manager_enumerate_groups_sync
+polkit_authority_manager_enumerate_authorizations_sync
+polkit_authority_manager_add_authorization_sync
+polkit_authority_manager_remove_authorization_sync
+polkit_authority_manager_enumerate_users
+polkit_authority_manager_enumerate_users_finish
+polkit_authority_manager_enumerate_groups
+polkit_authority_manager_enumerate_groups_finish
+polkit_authority_manager_enumerate_authorizations
+polkit_authority_manager_enumerate_authorizations_finish
+polkit_authority_manager_add_authorization
+polkit_authority_manager_add_authorization_finish
+polkit_authority_manager_remove_authorization
+polkit_authority_manager_remove_authorization_finish
+<SUBSECTION Standard>
+PolkitAuthorityManagerClass
+POLKIT_AUTHORITY_MANAGER
+POLKIT_IS_AUTHORITY_MANAGER
+POLKIT_TYPE_AUTHORITY_MANAGER
+polkit_authority_manager_get_type
+POLKIT_AUTHORITY_MANAGER_CLASS
+POLKIT_IS_AUTHORITY_MANAGER_CLASS
+POLKIT_AUTHORITY_MANAGER_GET_CLASS
+</SECTION>
+
+<SECTION>
+<FILE>polkitauthority</FILE>
+PolkitAuthority
+PolkitCheckAuthorizationFlags
+PolkitAuthorizationResult
+polkit_authority_get
+polkit_authority_enumerate_actions_sync
+polkit_authority_check_authorization_sync
+polkit_authority_register_authentication_agent_sync
+polkit_authority_unregister_authentication_agent_sync
+polkit_authority_authentication_agent_response_sync
+polkit_authority_enumerate_actions
+polkit_authority_enumerate_actions_finish
+polkit_authority_check_authorization
+polkit_authority_check_authorization_finish
+polkit_authority_register_authentication_agent
+polkit_authority_register_authentication_agent_finish
+polkit_authority_unregister_authentication_agent
+polkit_authority_unregister_authentication_agent_finish
+polkit_authority_authentication_agent_response
+polkit_authority_authentication_agent_response_finish
+<SUBSECTION Standard>
+PolkitAuthorityClass
+POLKIT_AUTHORITY
+POLKIT_IS_AUTHORITY
+POLKIT_TYPE_AUTHORITY
+polkit_authority_get_type
+POLKIT_AUTHORITY_CLASS
+POLKIT_IS_AUTHORITY_CLASS
+POLKIT_AUTHORITY_GET_CLASS
+</SECTION>
+
+<SECTION>
+<FILE>polkitsystembusname</FILE>
+PolkitSystemBusName
+polkit_system_bus_name_new
+polkit_system_bus_name_get_name
+polkit_system_bus_name_set_name
+<SUBSECTION Standard>
+PolkitSystemBusNameClass
+POLKIT_SYSTEM_BUS_NAME
+POLKIT_IS_SYSTEM_BUS_NAME
+POLKIT_TYPE_SYSTEM_BUS_NAME
+polkit_system_bus_name_get_type
+POLKIT_SYSTEM_BUS_NAME_CLASS
+POLKIT_IS_SYSTEM_BUS_NAME_CLASS
+POLKIT_SYSTEM_BUS_NAME_GET_CLASS
+</SECTION>
+
+<SECTION>
+<FILE>polkitunixgroup</FILE>
+PolkitUnixGroup
+polkit_unix_group_new
+polkit_unix_group_new_for_name
+polkit_unix_group_get_gid
+polkit_unix_group_set_gid
+<SUBSECTION Standard>
+PolkitUnixGroupClass
+POLKIT_UNIX_GROUP
+POLKIT_IS_UNIX_GROUP
+POLKIT_TYPE_UNIX_GROUP
+polkit_unix_group_get_type
+POLKIT_UNIX_GROUP_CLASS
+POLKIT_IS_UNIX_GROUP_CLASS
+POLKIT_UNIX_GROUP_GET_CLASS
+</SECTION>
+
+<SECTION>
+<FILE>polkitauthorization</FILE>
+PolkitAuthorization
+polkit_authorization_new
+polkit_authorization_get_action_id
+polkit_authorization_get_subject
+polkit_authorization_get_is_negative
+<SUBSECTION Standard>
+PolkitAuthorizationClass
+POLKIT_AUTHORIZATION
+POLKIT_IS_AUTHORIZATION
+POLKIT_TYPE_AUTHORIZATION
+polkit_authorization_get_type
+POLKIT_AUTHORIZATION_CLASS
+POLKIT_IS_AUTHORIZATION_CLASS
+POLKIT_AUTHORIZATION_GET_CLASS
+</SECTION>
+
+<SECTION>
+<FILE>polkitunixsession</FILE>
+PolkitUnixSession
+polkit_unix_session_new
+polkit_unix_session_get_session_id
+polkit_unix_session_set_session_id
+<SUBSECTION Standard>
+PolkitUnixSessionClass
+POLKIT_UNIX_SESSION
+POLKIT_IS_UNIX_SESSION
+POLKIT_TYPE_UNIX_SESSION
+polkit_unix_session_get_type
+POLKIT_UNIX_SESSION_CLASS
+POLKIT_IS_UNIX_SESSION_CLASS
+POLKIT_UNIX_SESSION_GET_CLASS
+</SECTION>
+
+<SECTION>
+<FILE>polkitunixprocess</FILE>
+PolkitUnixProcess
+polkit_unix_process_new
+polkit_unix_process_new_full
+polkit_unix_process_get_pid
+polkit_unix_process_get_start_time
+polkit_unix_process_set_pid
+<SUBSECTION Standard>
+PolkitUnixProcessClass
+POLKIT_UNIX_PROCESS
+POLKIT_IS_UNIX_PROCESS
+POLKIT_TYPE_UNIX_PROCESS
+polkit_unix_process_get_type
+POLKIT_UNIX_PROCESS_CLASS
+POLKIT_IS_UNIX_PROCESS_CLASS
+POLKIT_UNIX_PROCESS_GET_CLASS
+</SECTION>
+
+<SECTION>
+<FILE>polkitidentity</FILE>
+PolkitIdentity
+PolkitIdentityIface
+polkit_identity_hash
+polkit_identity_equal
+polkit_identity_to_string
+polkit_identity_from_string
+<SUBSECTION Standard>
+POLKIT_IDENTITY
+POLKIT_IS_IDENTITY
+POLKIT_TYPE_IDENTITY
+polkit_identity_get_type
+POLKIT_IDENTITY_GET_IFACE
+</SECTION>
+
+<SECTION>
+<FILE>polkitsubject</FILE>
+PolkitSubject
+PolkitSubjectIface
+polkit_subject_hash
+polkit_subject_equal
+polkit_subject_to_string
+polkit_subject_from_string
+<SUBSECTION Standard>
+POLKIT_SUBJECT
+POLKIT_IS_SUBJECT
+POLKIT_TYPE_SUBJECT
+polkit_subject_get_type
+POLKIT_SUBJECT_GET_IFACE
+</SECTION>
+
+<SECTION>
+<FILE>polkitactiondescription</FILE>
+PolkitActionDescription
+PolkitImplicitAuthorization
+polkit_action_description_get_action_id
+polkit_action_description_get_description
+polkit_action_description_get_message
+polkit_action_description_get_vendor_name
+polkit_action_description_get_vendor_url
+polkit_action_description_get_icon
+polkit_action_description_get_implicit_any
+polkit_action_description_get_implicit_inactive
+polkit_action_description_get_implicit_active
+polkit_action_description_get_annotation
+<SUBSECTION Standard>
+PolkitActionDescriptionClass
+POLKIT_ACTION_DESCRIPTION
+POLKIT_IS_ACTION_DESCRIPTION
+POLKIT_TYPE_ACTION_DESCRIPTION
+polkit_action_description_get_type
+POLKIT_ACTION_DESCRIPTION_CLASS
+POLKIT_IS_ACTION_DESCRIPTION_CLASS
+POLKIT_ACTION_DESCRIPTION_GET_CLASS
+</SECTION>
+
+<SECTION>
+<FILE>polkitcheckauthorizationflags</FILE>
+POLKIT_TYPE_CHECK_AUTHORIZATION_FLAGS
+PolkitCheckAuthorizationFlags
+<SUBSECTION Standard>
+polkit_check_authorization_flags_get_type
+</SECTION>
+
+<SECTION>
+<FILE>polkitimplicitauthorization</FILE>
+POLKIT_TYPE_IMPLICIT_AUTHORIZATION
+PolkitImplicitAuthorization
+polkit_implicit_authorization_to_string
+polkit_implicit_authorization_from_string
+<SUBSECTION Standard>
+polkit_implicit_authorization_get_type
+</SECTION>
+
+<SECTION>
+<FILE>polkiterror</FILE>
+POLKIT_ERROR
+POLKIT_TYPE_ERROR
+PolkitError
+<SUBSECTION Standard>
+polkit_error_quark
+polkit_error_get_type
+</SECTION>
+
+<SECTION>
+<FILE>polkitauthorizationresult</FILE>
+POLKIT_TYPE_AUTHORIZATION_RESULT
+PolkitAuthorizationResult
+<SUBSECTION Standard>
+polkit_authorization_result_get_type
+</SECTION>
+
diff --git a/docs/polkit/polkit.types b/docs/polkit/polkit.types
new file mode 100644
index 0000000..c47d206
--- /dev/null
+++ b/docs/polkit/polkit.types
@@ -0,0 +1,19 @@
+polkit_authority_get_type
+polkit_authority_manager_get_type
+
+polkit_authorization_get_type
+polkit_action_description_get_type
+
+polkit_check_authorization_flags_get_type
+polkit_implicit_authorization_get_type
+
+polkit_identity_get_type
+polkit_unix_user_get_type
+polkit_unix_group_get_type
+
+polkit_subject_get_type
+polkit_unix_process_get_type
+polkit_unix_session_get_type
+polkit_system_bus_name_get_type
+polkit_error_get_type
+polkit_authorization_result_get_type
diff --git a/src/polkit/polkitauthority.c b/src/polkit/polkitauthority.c
index 2d591a3..6bcedc7 100644
--- a/src/polkit/polkitauthority.c
+++ b/src/polkit/polkitauthority.c
@@ -33,12 +33,27 @@
  * SECTION:polkitauthority
  * @title: PolkitAuthority
  * @short_description: Authority
+ * @stability: Stable
  *
- * Checking claims.
+ * #PolkitAuthority is used for checking whether a given subject is
+ * authorized to perform a given action. Typically privileged system
+ * daemons or suid helpers will use this when handling requests from
+ * untrusted clients.
+ *
+ * User sessions can register an authentication agent with the
+ * authority. This is used for requests from untrusted clients where
+ * system policy requires that the user needs to acknowledge (through
+ * proving he is the user or the administrator) a given action.
  */
 
+/**
+ * PolkitAuthority:
+ *
+ * The #PolkitAuthority struct should not be accessed directly.
+ */
 struct _PolkitAuthority
 {
+  /*< private >*/
   GObject parent_instance;
 
   EggDBusConnection *system_bus;
@@ -133,6 +148,13 @@ polkit_authority_class_init (PolkitAuthorityClass *klass)
                                           0);
 }
 
+/**
+ * polkit_authority_get:
+ *
+ * Gets a reference to the authority.
+ *
+ * Returns: A #PolkitAuthority. Free it with g_object_unref() when done with it.
+ **/
 PolkitAuthority *
 polkit_authority_get (void)
 {
@@ -170,7 +192,6 @@ generic_async_cb (GObject      *source_obj,
 
 static guint
 polkit_authority_enumerate_actions_async (PolkitAuthority     *authority,
-                                          const gchar         *locale,
                                           GCancellable        *cancellable,
                                           GAsyncReadyCallback  callback,
                                           gpointer             user_data)
@@ -185,7 +206,7 @@ polkit_authority_enumerate_actions_async (PolkitAuthority     *authority,
 
   call_id = _polkit_authority_enumerate_actions (authority->real,
                                                  EGG_DBUS_CALL_FLAGS_NONE,
-                                                 locale,
+                                                 "", /* TODO: use current locale */
                                                  cancellable,
                                                  generic_async_cb,
                                                  simple);
@@ -193,16 +214,39 @@ polkit_authority_enumerate_actions_async (PolkitAuthority     *authority,
   return call_id;
 }
 
+/**
+ * polkit_authority_enumerate_actions:
+ * @authority: A #PolkitAuthority.
+ * @cancellable: A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: The data to pass to @callback.
+ *
+ * Asynchronously retrieves all registered actions.
+ *
+ * When the operation is finished, @callback will be invoked. You can then
+ * call polkit_authority_enumerate_actions_finish() to get the result of
+ * the operation.
+ **/
 void
 polkit_authority_enumerate_actions (PolkitAuthority     *authority,
-                                    const gchar         *locale,
                                     GCancellable        *cancellable,
                                     GAsyncReadyCallback  callback,
                                     gpointer             user_data)
 {
-  polkit_authority_enumerate_actions_async (authority, locale, cancellable, callback, user_data);
+  polkit_authority_enumerate_actions_async (authority, cancellable, callback, user_data);
 }
 
+/**
+ * polkit_authority_enumerate_actions_finish:
+ * @authority: A #PolkitAuthority.
+ * @res: A #GAsyncResult obtained from the callback.
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes retrieving all registered actions.
+ *
+ * Returns: A list of #PolkitActionDescription or %NULL if @error is set. The returned list
+ * should be freed with g_list_free() after each element have been freed with g_object_unref().
+ **/
 GList *
 polkit_authority_enumerate_actions_finish (PolkitAuthority *authority,
                                            GAsyncResult    *res,
@@ -246,9 +290,19 @@ polkit_authority_enumerate_actions_finish (PolkitAuthority *authority,
 }
 
 
+/**
+ * polkit_authority_enumerate_actions_sync:
+ * @authority: A #PolkitAuthority.
+ * @cancellable: A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Synchronously retrieves all registered actions.
+ *
+ * Returns: A list of #PolkitActionDescription or %NULL if @error is set. The returned list
+ * should be freed with g_list_free() after each element have been freed with g_object_unref().
+ **/
 GList *
 polkit_authority_enumerate_actions_sync (PolkitAuthority *authority,
-                                         const gchar     *locale,
                                          GCancellable    *cancellable,
                                          GError         **error)
 {
@@ -256,7 +310,7 @@ polkit_authority_enumerate_actions_sync (PolkitAuthority *authority,
   GAsyncResult *res;
   GList *result;
 
-  call_id = polkit_authority_enumerate_actions_async (authority, locale, cancellable, generic_cb, &res);
+  call_id = polkit_authority_enumerate_actions_async (authority, cancellable, generic_cb, &res);
 
   egg_dbus_connection_pending_call_block (authority->system_bus, call_id);
 
@@ -268,7 +322,6 @@ polkit_authority_enumerate_actions_sync (PolkitAuthority *authority,
 }
 
 /* ---------------------------------------------------------------------------------------------------- */
-
 static guint
 polkit_authority_check_authorization_async (PolkitAuthority               *authority,
                                             PolkitSubject                 *subject,
@@ -303,6 +356,23 @@ polkit_authority_check_authorization_async (PolkitAuthority               *autho
   return call_id;
 }
 
+/**
+ * polkit_authority_check_authorization:
+ * @authority: A #PolkitAuthority.
+ * @subject: A #PolkitSubject.
+ * @action_id: The action to check for.
+ * @flags: A set of #PolkitCheckAuthorizationFlags.
+ * @cancellable: A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: The data to pass to @callback.
+ *
+ * Asynchronously checks if @subject is authorized to perform the action represented
+ * by @action_id.
+ *
+ * When the operation is finished, @callback will be invoked. You can then
+ * call polkit_authority_check_authorization_finish() to get the result of
+ * the operation.
+ **/
 void
 polkit_authority_check_authorization (PolkitAuthority               *authority,
                                       PolkitSubject                 *subject,
@@ -321,6 +391,16 @@ polkit_authority_check_authorization (PolkitAuthority               *authority,
                                               user_data);
 }
 
+/**
+ * polkit_authority_check_authorization_finish:
+ * @authority: A #PolkitAuthority.
+ * @res: A #GAsyncResult obtained from the callback.
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes checking if a subject is authorized for an action.
+ *
+ * Returns: A #PolkitAuthorizationResult.
+ **/
 PolkitAuthorizationResult
 polkit_authority_check_authorization_finish (PolkitAuthority          *authority,
                                              GAsyncResult             *res,
@@ -348,6 +428,20 @@ polkit_authority_check_authorization_finish (PolkitAuthority          *authority
   return result;
 }
 
+/**
+ * polkit_authority_check_authorization:
+ * @authority: A #PolkitAuthority.
+ * @subject: A #PolkitSubject.
+ * @action_id: The action to check for.
+ * @flags: A set of #PolkitCheckAuthorizationFlags.
+ * @cancellable: A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: The data to pass to @callback.
+ *
+ * Checks if @subject is authorized to perform the action represented by @action_id.
+ *
+ * Returns: A #PolkitAuthorizationResult.
+ */
 PolkitAuthorizationResult
 polkit_authority_check_authorization_sync (PolkitAuthority               *authority,
                                            PolkitSubject                 *subject,
@@ -404,6 +498,20 @@ polkit_authority_register_authentication_agent_async (PolkitAuthority      *auth
   return call_id;
 }
 
+/**
+ * polkit_authority_register_authentication_agent:
+ * @authority: A #PolkitAuthority.
+ * @object_path: The object path for the authentication agent.
+ * @cancellable: A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: The data to pass to @callback.
+ *
+ * Asynchronously registers an authentication agent.
+ *
+ * When the operation is finished, @callback will be invoked. You can then
+ * call polkit_authority_register_authentication_agent_finish() to get the result of
+ * the operation.
+ **/
 void
 polkit_authority_register_authentication_agent (PolkitAuthority      *authority,
                                                 const gchar          *object_path,
@@ -418,6 +526,16 @@ polkit_authority_register_authentication_agent (PolkitAuthority      *authority,
                                                         user_data);
 }
 
+/**
+ * polkit_authority_register_authentication_agent_finish:
+ * @authority: A #PolkitAuthority.
+ * @res: A #GAsyncResult obtained from the callback.
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes registering an authentication agent.
+ *
+ * Returns: %TRUE if the authentication agent was successfully registered, %FALSE if @error is set.
+ **/
 gboolean
 polkit_authority_register_authentication_agent_finish (PolkitAuthority *authority,
                                                        GAsyncResult    *res,
@@ -445,6 +563,17 @@ polkit_authority_register_authentication_agent_finish (PolkitAuthority *authorit
 }
 
 
+/**
+ * polkit_authority_register_authentication_agent_sync:
+ * @authority: A #PolkitAuthority.
+ * @object_path: The object path for the authentication agent.
+ * @cancellable: A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Registers an authentication agent.
+ *
+ * Returns: %TRUE if the authentication agent was successfully registered, %FALSE if @error is set.
+ **/
 gboolean
 polkit_authority_register_authentication_agent_sync (PolkitAuthority     *authority,
                                                      const gchar         *object_path,
@@ -497,6 +626,20 @@ polkit_authority_unregister_authentication_agent_async (PolkitAuthority      *au
   return call_id;
 }
 
+/**
+ * polkit_authority_unregister_authentication_agent:
+ * @authority: A #PolkitAuthority.
+ * @object_path: The object path that the authentication agent is registered at.
+ * @cancellable: A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: The data to pass to @callback.
+ *
+ * Asynchronously unregisters an authentication agent.
+ *
+ * When the operation is finished, @callback will be invoked. You can then
+ * call polkit_authority_unregister_authentication_agent_finish() to get the result of
+ * the operation.
+ **/
 void
 polkit_authority_unregister_authentication_agent (PolkitAuthority      *authority,
                                                   const gchar          *object_path,
@@ -511,6 +654,16 @@ polkit_authority_unregister_authentication_agent (PolkitAuthority      *authorit
                                                         user_data);
 }
 
+/**
+ * polkit_authority_unregister_authentication_agent_finish:
+ * @authority: A #PolkitAuthority.
+ * @res: A #GAsyncResult obtained from the callback.
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes unregistering an authentication agent.
+ *
+ * Returns: %TRUE if the authentication agent was successfully unregistered, %FALSE if @error is set.
+ **/
 gboolean
 polkit_authority_unregister_authentication_agent_finish (PolkitAuthority *authority,
                                                          GAsyncResult    *res,
@@ -537,7 +690,17 @@ polkit_authority_unregister_authentication_agent_finish (PolkitAuthority *author
   return ret;
 }
 
-
+/**
+ * polkit_authority_unregister_authentication_agent_sync:
+ * @authority: A #PolkitAuthority.
+ * @object_path: The object path that the authentication agent is registered at.
+ * @cancellable: A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Unregisters an authentication agent.
+ *
+ * Returns: %TRUE if the authentication agent was successfully unregistered, %FALSE if @error is set.
+ **/
 gboolean
 polkit_authority_unregister_authentication_agent_sync (PolkitAuthority     *authority,
                                                        const gchar         *object_path,
@@ -597,6 +760,25 @@ polkit_authority_authentication_agent_response_async (PolkitAuthority      *auth
   return call_id;
 }
 
+/**
+ * polkit_authority_authentication_agent_response:
+ * @authority: A #PolkitAuthority.
+ * @cookie: The cookie passed to the authentication agent from the authority.
+ * @identity: The identity that was authenticated.
+ * @cancellable: A #GCancellable or %NULL.
+ * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
+ * @user_data: The data to pass to @callback.
+ *
+ * Asynchronously provide response that @identity successfully authenticated
+ * for the authentication request identified by @cookie.
+ *
+ * This function is only used by the privileged bits of an authentication agent.
+ * It will fail if the caller is not sufficiently privileged (typically uid 0).
+ *
+ * When the operation is finished, @callback will be invoked. You can then
+ * call polkit_authority_authentication_agent_response_finish() to get the result of
+ * the operation.
+ **/
 void
 polkit_authority_authentication_agent_response (PolkitAuthority      *authority,
                                                 const gchar          *cookie,
@@ -613,6 +795,16 @@ polkit_authority_authentication_agent_response (PolkitAuthority      *authority,
                                                         user_data);
 }
 
+/**
+ * polkit_authority_authentication_agent_response_finish:
+ * @authority: A #PolkitAuthority.
+ * @res: A #GAsyncResult obtained from the callback.
+ * @error: Return location for error or %NULL.
+ *
+ * Finishes providing response from an authentication agent.
+ *
+ * Returns: %TRUE if @authority acknowledged the call, %FALSE if @error is set.
+ **/
 gboolean
 polkit_authority_authentication_agent_response_finish (PolkitAuthority *authority,
                                                        GAsyncResult    *res,
@@ -640,6 +832,20 @@ polkit_authority_authentication_agent_response_finish (PolkitAuthority *authorit
 }
 
 
+/**
+ * polkit_authority_authentication_agent_response_sync:
+ * @authority: A #PolkitAuthority.
+ * @cookie: The cookie passed to the authentication agent from the authority.
+ * @identity: The identity that was authenticated.
+ * @cancellable: A #GCancellable or %NULL.
+ * @error: Return location for error or %NULL.
+ *
+ * Provide response that @identity successfully authenticated for the
+ * authentication request identified by @cookie. See polkit_authority_authentication_agent_response()
+ * for limitations on who is allowed is to call this method.
+ *
+ * Returns: %TRUE if @authority acknowledged the call, %FALSE if @error is set.
+ **/
 gboolean
 polkit_authority_authentication_agent_response_sync (PolkitAuthority     *authority,
                                                      const gchar         *cookie,
diff --git a/src/polkit/polkitauthority.h b/src/polkit/polkitauthority.h
index db1bb46..0ed5647 100644
--- a/src/polkit/polkitauthority.h
+++ b/src/polkit/polkitauthority.h
@@ -47,7 +47,6 @@ PolkitAuthority *polkit_authority_get (void);
 /* ---------------------------------------------------------------------------------------------------- */
 
 GList                     *polkit_authority_enumerate_actions_sync (PolkitAuthority *authority,
-                                                                    const gchar     *locale,
                                                                     GCancellable    *cancellable,
                                                                     GError         **error);
 
@@ -102,7 +101,6 @@ gboolean                   polkit_authority_authentication_agent_response_sync (
 /* ---------------------------------------------------------------------------------------------------- */
 
 void                       polkit_authority_enumerate_actions (PolkitAuthority     *authority,
-                                                               const gchar         *locale,
                                                                GCancellable        *cancellable,
                                                                GAsyncReadyCallback  callback,
                                                                gpointer             user_data);
diff --git a/src/polkit/polkitauthoritymanager.c b/src/polkit/polkitauthoritymanager.c
index 55a4530..0984bda 100644
--- a/src/polkit/polkitauthoritymanager.c
+++ b/src/polkit/polkitauthoritymanager.c
@@ -31,6 +31,7 @@
  * SECTION:polkitauthoritymanager
  * @title: PolkitAuthorityManager
  * @short_description: Authority Manager
+ * @stability: Unstable
  *
  * Checking claims.
  */
diff --git a/src/programs/polkit.c b/src/programs/polkit.c
index c183909..db89d81 100644
--- a/src/programs/polkit.c
+++ b/src/programs/polkit.c
@@ -457,7 +457,6 @@ show_action (const gchar *action_id)
   error = NULL;
   actions = polkit_authority_enumerate_actions_sync (authority,
                                                      NULL,
-                                                     NULL,
                                                      &error);
   if (error != NULL)
     {
@@ -509,7 +508,6 @@ list_actions (void)
   error = NULL;
   actions = polkit_authority_enumerate_actions_sync (authority,
                                                      NULL,
-                                                     NULL,
                                                      &error);
   if (error != NULL)
     {
@@ -792,7 +790,6 @@ list_authorizations (void)
   error = NULL;
   actions = polkit_authority_enumerate_actions_sync (authority,
                                                      NULL,
-                                                     NULL,
                                                      &error);
   if (error != NULL)
     {


More information about the hal-commit mailing list