PolicyKit: Branch 'master' - 10 commits

Miloslav Trmac mitr at kemper.freedesktop.org
Fri Apr 19 12:28:11 PDT 2013


 docs/polkit/Makefile.am                   |    6 ++++--
 docs/polkit/polkit-1-docs.xml             |    2 ++
 docs/polkit/polkit-1-sections.txt         |   30 ++++++++++--------------------
 src/polkit/polkitauthority.c              |   30 +++++++++++++++---------------
 src/polkit/polkitimplicitauthorization.c  |    8 --------
 src/polkit/polkitprivate.h                |   15 +++++++++++++++
 src/polkit/polkittemporaryauthorization.h |    5 -----
 src/polkit/polkitunixnetgroup.c           |    2 +-
 src/polkit/polkitunixprocess.c            |    7 +++++++
 src/polkitagent/polkitagentlistener.c     |   11 ++++++++++-
 10 files changed, 64 insertions(+), 52 deletions(-)

New commits:
commit 18d97c95c022bb381efab8fb6ac80312bd7fbc11
Author: Miloslav Trmač <mitr at redhat.com>
Date:   Thu Apr 18 19:54:59 2013 +0200

    Add a FIXME to polkitprivate.h
    
    See discussion in https://bugs.freedesktop.org/show_bug.cgi?id=63573 .

diff --git a/src/polkit/polkitprivate.h b/src/polkit/polkitprivate.h
index 3567cc0..9f07063 100644
--- a/src/polkit/polkitprivate.h
+++ b/src/polkit/polkitprivate.h
@@ -28,6 +28,16 @@
 #include "polkitauthorizationresult.h"
 #include "polkittemporaryauthorization.h"
 
+/* FIXME: This header file is currently installed among other public header
+   files, and the symbols are exported in the shared library.
+
+   For application writers: relying on any function here is strongly
+   discouraged.
+
+   For polkit maintainers: This should be made private if a large ABI break
+   were necessary in the future.  In the meantime, consider that there is
+   non-zero risk that changing these functions might break some applications. */
+
 PolkitActionDescription  *polkit_action_description_new_for_gvariant (GVariant *value);
 GVariant *polkit_action_description_to_gvariant (PolkitActionDescription *action_description);
 
commit 2717d8595d33b378f07d51395eaa3b35bb3d8762
Author: Miloslav Trmač <mitr at redhat.com>
Date:   Mon Apr 15 23:08:21 2013 +0200

    Add annotations for element types of returned lists
    
    ... to silence warnings when g-ir-scanner warnings are enabled.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=63573

diff --git a/src/polkit/polkitauthority.c b/src/polkit/polkitauthority.c
index 9947cf3..75619ab 100644
--- a/src/polkit/polkitauthority.c
+++ b/src/polkit/polkitauthority.c
@@ -680,10 +680,10 @@ polkit_authority_enumerate_actions (PolkitAuthority     *authority,
  *
  * Finishes retrieving all registered actions.
  *
- * Returns: (transfer full): A list of #PolkitActionDescription
- * objects 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().
+ * Returns: (element-type Polkit.ActionDescription) (transfer full): A list of
+ * #PolkitActionDescription objects 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,
@@ -736,9 +736,9 @@ polkit_authority_enumerate_actions_finish (PolkitAuthority *authority,
  * is blocked until a reply is received. See
  * polkit_authority_enumerate_actions() for the asynchronous version.
  *
- * Returns: (transfer full): 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
+ * Returns: (element-type Polkit.ActionDescription) (transfer full): 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 *
@@ -1656,10 +1656,10 @@ polkit_authority_enumerate_temporary_authorizations (PolkitAuthority     *author
  *
  * Finishes retrieving all registered actions.
  *
- * Returns: (transfer full): A list of #PolkitTemporaryAuthorization
- * objects 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().
+ * Returns: (element-type Polkit.TemporaryAuthorization) (transfer full): A
+ * list of #PolkitTemporaryAuthorization objects 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_temporary_authorizations_finish (PolkitAuthority *authority,
@@ -1723,10 +1723,10 @@ polkit_authority_enumerate_temporary_authorizations_finish (PolkitAuthority *aut
  * polkit_authority_enumerate_temporary_authorizations() for the
  * asynchronous version.
  *
- * Returns: (transfer full): A list of #PolkitTemporaryAuthorization
- * objects 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().
+ * Returns: (element-type Polkit.TemporaryAuthorization) (transfer full): A
+ * list of #PolkitTemporaryAuthorization objects 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_temporary_authorizations_sync (PolkitAuthority     *authority,
diff --git a/src/polkitagent/polkitagentlistener.c b/src/polkitagent/polkitagentlistener.c
index 29a0fdf..8c333af 100644
--- a/src/polkitagent/polkitagentlistener.c
+++ b/src/polkitagent/polkitagentlistener.c
@@ -749,7 +749,7 @@ polkit_agent_listener_class_init (PolkitAgentListenerClass *klass)
  * @icon_name: A themed icon name representing the action or %NULL.
  * @details: Details describing the action.
  * @cookie: The cookie for the authentication request.
- * @identities: A list of #PolkitIdentity objects that the user can choose to authenticate as.
+ * @identities: (element-type Polkit.Identity): A list of #PolkitIdentity objects that the user can choose to authenticate as.
  * @cancellable: A #GCancellable.
  * @callback: Function to call when the user is done authenticating.
  * @user_data: Data to pass to @callback.
commit 794d6cadaec33ddebbbabc8d0f80380189b71d88
Author: Miloslav Trmač <mitr at redhat.com>
Date:   Wed Apr 10 03:06:59 2013 +0200

    Fix an obvious docstring typo.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=63573

diff --git a/src/polkit/polkitunixnetgroup.c b/src/polkit/polkitunixnetgroup.c
index e4438eb..8a2b369 100644
--- a/src/polkit/polkitunixnetgroup.c
+++ b/src/polkit/polkitunixnetgroup.c
@@ -168,7 +168,7 @@ polkit_unix_netgroup_get_name (PolkitUnixNetgroup *group)
 }
 
 /**
- * polkit_unix_netgroup_set_gid:
+ * polkit_unix_netgroup_set_name:
  * @group: A #PolkitUnixNetgroup.
  * @name: A netgroup name.
  *
commit 0552a3ef4c89a7d87742f63d80878a5ef2574f10
Author: Miloslav Trmač <mitr at redhat.com>
Date:   Wed Apr 10 03:01:16 2013 +0200

    Fold enum documentation into relevant classes
    
    Fold PolkitImplicitAuthorization and PolkitCheckAuthorizationFlags
    into the relevant classes in the section list; polkit-1-docs.xml is
    already not including the enum documents.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=63573

diff --git a/docs/polkit/polkit-1-sections.txt b/docs/polkit/polkit-1-sections.txt
index a773795..e7db6e3 100644
--- a/docs/polkit/polkit-1-sections.txt
+++ b/docs/polkit/polkit-1-sections.txt
@@ -66,6 +66,7 @@ polkit_authority_get_type
 POLKIT_AUTHORITY_CLASS
 POLKIT_IS_AUTHORITY_CLASS
 POLKIT_AUTHORITY_GET_CLASS
+polkit_check_authorization_flags_get_type
 </SECTION>
 
 <SECTION>
@@ -236,6 +237,8 @@ polkit_action_description_get_implicit_inactive
 polkit_action_description_get_implicit_active
 polkit_action_description_get_annotation
 polkit_action_description_get_annotation_keys
+polkit_implicit_authorization_to_string
+polkit_implicit_authorization_from_string
 <SUBSECTION Standard>
 PolkitActionDescriptionClass
 POLKIT_ACTION_DESCRIPTION
@@ -245,23 +248,6 @@ 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>
 
diff --git a/src/polkit/polkitimplicitauthorization.c b/src/polkit/polkitimplicitauthorization.c
index 1d6a933..7dffb3f 100644
--- a/src/polkit/polkitimplicitauthorization.c
+++ b/src/polkit/polkitimplicitauthorization.c
@@ -28,14 +28,6 @@
 #include "polkitimplicitauthorization.h"
 #include "polkitprivate.h"
 
-/**
- * SECTION:polkitimplicitauthorization
- * @title: PolkitImplicitAuthorization
- * @short_description: Implicit Authorizations
- *
- * Possible implicit authorizations.
- */
-
 gboolean
 polkit_implicit_authorization_from_string (const gchar *string,
                                            PolkitImplicitAuthorization *out_implicit_authorization)
commit eec38ce7ad1b4d82bc075490b1011735ffb4e18a
Author: Miloslav Trmač <mitr at redhat.com>
Date:   Wed Apr 10 02:51:34 2013 +0200

    Document deprecated functions.
    
    All of these are a part of public API with some external users.  Do the
    minimum to avoid a warning; ideally we should also add a
    *_DISABLE_DEPRECATED macro etc.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=63573

diff --git a/docs/polkit/polkit-1-sections.txt b/docs/polkit/polkit-1-sections.txt
index dfc407a..a773795 100644
--- a/docs/polkit/polkit-1-sections.txt
+++ b/docs/polkit/polkit-1-sections.txt
@@ -25,6 +25,7 @@ PolkitCheckAuthorizationFlags
 polkit_authority_get_async
 polkit_authority_get_finish
 polkit_authority_get_sync
+polkit_authority_get
 polkit_authority_get_owner
 polkit_authority_get_backend_name
 polkit_authority_get_backend_version
@@ -173,6 +174,7 @@ polkit_unix_process_set_start_time
 polkit_unix_process_get_start_time
 polkit_unix_process_set_uid
 polkit_unix_process_get_uid
+polkit_unix_process_get_owner
 <SUBSECTION Standard>
 PolkitUnixProcessClass
 POLKIT_UNIX_PROCESS
@@ -320,6 +322,7 @@ PolkitAgentRegisterFlags
 polkit_agent_listener_register
 polkit_agent_listener_register_with_options
 polkit_agent_listener_unregister
+polkit_agent_register_listener
 <SUBSECTION Standard>
 POLKIT_AGENT_LISTENER
 POLKIT_AGENT_IS_LISTENER
diff --git a/src/polkit/polkitunixprocess.c b/src/polkit/polkitunixprocess.c
index 913be3a..9d30cd2 100644
--- a/src/polkit/polkitunixprocess.c
+++ b/src/polkit/polkitunixprocess.c
@@ -740,6 +740,13 @@ out:
 }
 
 /* deprecated public method */
+/**
+ * polkit_unix_process_get_owner:
+ * @process: A #PolkitUnixProcess.
+ * @error: Return location for error.
+ *
+ * (deprecated)
+ */
 gint
 polkit_unix_process_get_owner (PolkitUnixProcess  *process,
                                GError            **error)
diff --git a/src/polkitagent/polkitagentlistener.c b/src/polkitagent/polkitagentlistener.c
index 5bddd03..29a0fdf 100644
--- a/src/polkitagent/polkitagentlistener.c
+++ b/src/polkitagent/polkitagentlistener.c
@@ -535,6 +535,15 @@ listener_died (gpointer user_data,
   server_free (server);
 }
 
+/**
+ * polkit_agent_register_listener:
+ * @listener: A #PolkitAgentListener.
+ * @subject: The subject to become an authentication agent for, typically a #PolkitUnixSession object.
+ * @object_path: The D-Bus object path to use for the authentication agent or %NULL for the default object path.
+ * @error: Return location for error.
+ *
+ * (deprecated)
+ */
 gboolean
 polkit_agent_register_listener (PolkitAgentListener  *listener,
                                 PolkitSubject        *subject,
commit 91052183ea45a14fa639ba4c5aaa6c0b3bcb9739
Author: Miloslav Trmač <mitr at redhat.com>
Date:   Wed Apr 10 02:50:39 2013 +0200

    Include documentation of polkit_action_description_get_annotation_keys
    
    This seems a fairly obvious public counterpart of
    polkit_action_description_get_annotation, and it is used in pkaction.c
    in what is pretty much an example of public API use.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=63573

diff --git a/docs/polkit/polkit-1-sections.txt b/docs/polkit/polkit-1-sections.txt
index 47c7835..dfc407a 100644
--- a/docs/polkit/polkit-1-sections.txt
+++ b/docs/polkit/polkit-1-sections.txt
@@ -233,6 +233,7 @@ polkit_action_description_get_implicit_any
 polkit_action_description_get_implicit_inactive
 polkit_action_description_get_implicit_active
 polkit_action_description_get_annotation
+polkit_action_description_get_annotation_keys
 <SUBSECTION Standard>
 PolkitActionDescriptionClass
 POLKIT_ACTION_DESCRIPTION
commit dce12926186314fd0ae8d6bb1af0f99c1c1d023c
Author: Miloslav Trmač <mitr at redhat.com>
Date:   Wed Apr 10 02:47:50 2013 +0200

    Move polkit_temporary_authorization_new to private header file.
    
    The related new_for_gvariant() is private already, this seems also
    intended to be private.  searchco.de doesn't show any external users.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=63573

diff --git a/src/polkit/polkitprivate.h b/src/polkit/polkitprivate.h
index 579cc25..3567cc0 100644
--- a/src/polkit/polkitprivate.h
+++ b/src/polkit/polkitprivate.h
@@ -40,6 +40,11 @@ PolkitIdentity *polkit_identity_new_for_gvariant (GVariant *variant, GError **er
 PolkitAuthorizationResult  *polkit_authorization_result_new_for_gvariant (GVariant *value);
 GVariant *polkit_authorization_result_to_gvariant (PolkitAuthorizationResult *authorization_result);
 
+PolkitTemporaryAuthorization *polkit_temporary_authorization_new    (const gchar                  *id,
+                                                                     const gchar                  *action_id,
+                                                                     PolkitSubject                *subject,
+                                                                     guint64                       time_obtained,
+                                                                     guint64                       time_expires);
 PolkitTemporaryAuthorization *polkit_temporary_authorization_new_for_gvariant (GVariant *value,
                                                                                GError   **error);
 GVariant *polkit_temporary_authorization_to_gvariant (PolkitTemporaryAuthorization *authorization);
diff --git a/src/polkit/polkittemporaryauthorization.h b/src/polkit/polkittemporaryauthorization.h
index 4d0c530..792a3e8 100644
--- a/src/polkit/polkittemporaryauthorization.h
+++ b/src/polkit/polkittemporaryauthorization.h
@@ -45,11 +45,6 @@ typedef struct _PolkitTemporaryAuthorization PolkitTemporaryAuthorization;
 typedef struct _PolkitTemporaryAuthorizationClass PolkitTemporaryAuthorizationClass;
 
 GType          polkit_temporary_authorization_get_type              (void) G_GNUC_CONST;
-PolkitTemporaryAuthorization *polkit_temporary_authorization_new    (const gchar                  *id,
-                                                                     const gchar                  *action_id,
-                                                                     PolkitSubject                *subject,
-                                                                     guint64                       time_obtained,
-                                                                     guint64                       time_expires);
 const gchar   *polkit_temporary_authorization_get_id                (PolkitTemporaryAuthorization *authorization);
 const gchar   *polkit_temporary_authorization_get_action_id         (PolkitTemporaryAuthorization *authorization);
 PolkitSubject *polkit_temporary_authorization_get_subject           (PolkitTemporaryAuthorization *authorization);
commit 1df991e3bfc222dfe16fcb197e97d4738450c8b3
Author: Miloslav Trmač <mitr at redhat.com>
Date:   Wed Apr 10 02:46:38 2013 +0200

    Fix most "undocumented symbol" warnings
    
    - Mark private header files as private.
    - Fix obvious typos in the section file.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=63573

diff --git a/docs/polkit/Makefile.am b/docs/polkit/Makefile.am
index 13ca938..fcfa92a 100644
--- a/docs/polkit/Makefile.am
+++ b/docs/polkit/Makefile.am
@@ -10,7 +10,7 @@ DOC_MODULE=polkit-1
 DOC_MAIN_SGML_FILE=polkit-1-docs.xml
 
 # Extra options to supply to gtkdoc-scan
-SCAN_OPTIONS=--ignore-headers=config.h
+SCAN_OPTIONS=
 
 # Directories containing the source code.
 # gtk-doc will search all .c and .h files beneath these paths
@@ -24,6 +24,8 @@ CFILE_GLOB=$(top_srcdir)/src/polkit*/*.c
 
 # Headers to ignore
 IGNORE_HFILES= \
+	polkitprivate.h \
+	polkitagenthelperprivate.h \
 	$(NULL)
 
 # CFLAGS and LDFLAGS for compiling scan program. Only needed
diff --git a/docs/polkit/polkit-1-sections.txt b/docs/polkit/polkit-1-sections.txt
index 41b37e3..47c7835 100644
--- a/docs/polkit/polkit-1-sections.txt
+++ b/docs/polkit/polkit-1-sections.txt
@@ -355,11 +355,11 @@ polkit_temporary_authorization_get_time_obtained
 polkit_temporary_authorization_get_time_expires
 <SUBSECTION Standard>
 POLKIT_TEMPORARY_AUTHORIZATION
-POLKIT_TEMPORARY_IS_AUTHORIZATION
-POLKIT_TEMPORARY_TYPE_AUTHORIZATION
+POLKIT_IS_TEMPORARY_AUTHORIZATION
+POLKIT_TYPE_TEMPORARY_AUTHORIZATION
 polkit_temporary_authorization_get_type
 POLKIT_TEMPORARY_AUTHORIZATION_CLASS
-POLKIT_TEMPORARY_IS_AUTHORIZATION_CLASS
+POLKIT_IS_TEMPORARY_AUTHORIZATION_CLASS
 POLKIT_TEMPORARY_AUTHORIZATION_GET_CLASS
 </SECTION>
 
commit 3a2d517176f7fe6bc2d19eed74888431090e1cc2
Author: Miloslav Trmač <mitr at redhat.com>
Date:   Wed Apr 10 01:57:20 2013 +0200

    Leave out backend from gtk-doc generation
    
    ... which silences warnings about these classes missing from
    polkit-1-sections.txt
    
    https://bugs.freedesktop.org/show_bug.cgi?id=63573

diff --git a/docs/polkit/Makefile.am b/docs/polkit/Makefile.am
index e0b669a..13ca938 100644
--- a/docs/polkit/Makefile.am
+++ b/docs/polkit/Makefile.am
@@ -16,7 +16,7 @@ SCAN_OPTIONS=--ignore-headers=config.h
 # gtk-doc will search all .c and .h files beneath these paths
 # for inline comments documenting functions and macros.
 # e.g. DOC_SOURCE_DIR=$(top_srcdir)/gtk $(top_srcdir)/gdk
-DOC_SOURCE_DIR=$(top_srcdir)/src
+DOC_SOURCE_DIR=$(top_srcdir)/src/polkit $(top_srcdir)/src/polkitagent
 
 # Used for dependencies
 HFILE_GLOB=$(top_srcdir)/src/polkit*/*.h
commit 2e7c6be92c2892164ca253ebe14ad7d94b802afd
Author: Miloslav Trmač <mitr at redhat.com>
Date:   Wed Apr 10 01:30:11 2013 +0200

    Add annotation glossary
    
    as described at the end of
    https://live.gnome.org/GObjectIntrospection/Annotations.  Fixes a huge
    number of warnings.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=63573

diff --git a/docs/polkit/polkit-1-docs.xml b/docs/polkit/polkit-1-docs.xml
index 549768c..69a7b88 100644
--- a/docs/polkit/polkit-1-docs.xml
+++ b/docs/polkit/polkit-1-docs.xml
@@ -69,6 +69,8 @@
       <xi:include href="xml/tree_index.sgml"/>
   </chapter>
 
+  <xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
+
   <index id="polit-index">
     <title>Index</title>
   </index>


More information about the hal-commit mailing list