PolicyKit: Branch 'master'

David Zeuthen david at kemper.freedesktop.org
Sun Nov 11 16:07:19 PST 2007


 src/polkit/polkit-authorization-db-dummy.c |   17 +++++++++++++++++
 src/polkit/polkit-authorization.c          |   11 +++++++++++
 src/polkit/polkit-policy-file-entry.c      |    3 +++
 3 files changed, 31 insertions(+)

New commits:
commit 20fa8e0d76bb34712c7854179ff305d7eedab5c1
Author: David Zeuthen <davidz at redhat.com>
Date:   Sun Nov 11 19:03:46 2007 -0500

    fix build for dummy backend

diff --git a/src/polkit/polkit-authorization-db-dummy.c b/src/polkit/polkit-authorization-db-dummy.c
index 11ed887..5bc3822 100644
--- a/src/polkit/polkit-authorization-db-dummy.c
+++ b/src/polkit/polkit-authorization-db-dummy.c
@@ -43,6 +43,7 @@
 #include "polkit-authorization-db.h"
 #include "polkit-utils.h"
 #include "polkit-private.h"
+#include "polkit-test.h"
 
 /* PolKitAuthorizationDB structure is defined in polkit/polkit-private.h */
 
@@ -188,3 +189,19 @@ polkit_authorization_db_revoke_entry (PolKitAuthorizationDB *authdb,
 }
 
 
+#ifdef POLKIT_BUILD_TESTS
+
+static polkit_bool_t
+_run_test (void)
+{
+        return TRUE;
+}
+
+PolKitTest _test_authorization_db = {
+        "polkit_authorization_db",
+        NULL,
+        NULL,
+        _run_test
+};
+
+#endif /* POLKIT_BUILD_TESTS */
diff --git a/src/polkit/polkit-authorization.c b/src/polkit/polkit-authorization.c
index f8abf05..d4121d5 100644
--- a/src/polkit/polkit-authorization.c
+++ b/src/polkit/polkit-authorization.c
@@ -591,6 +591,8 @@ polkit_authorization_get_constraint (PolKitAuthorization *auth)
 
 #ifdef POLKIT_BUILD_TESTS
 
+#ifdef POLKIT_AUTHDB_DEFAULT
+
 typedef struct {
         const char *entry;
         PolKitAuthorizationScope scope;
@@ -770,6 +772,15 @@ _run_test (void)
         return TRUE;
 }
 
+#else /* POLKIT_AUTHDB_DEFAULT */
+
+static polkit_bool_t
+_run_test (void)
+{
+        return TRUE;
+}
+
+#endif /* POLKIT_AUTHDB_DEFAULT */
 
 PolKitTest _test_authorization = {
         "polkit_authorization",
diff --git a/src/polkit/polkit-policy-file-entry.c b/src/polkit/polkit-policy-file-entry.c
index a6abe42..dc78ff9 100644
--- a/src/polkit/polkit-policy-file-entry.c
+++ b/src/polkit/polkit-policy-file-entry.c
@@ -426,9 +426,12 @@ _run_test (void)
         }
         
         kit_assert ((d = polkit_policy_file_entry_get_default (pfe)) != NULL);
+
+#ifdef POLKIT_AUTHDB_DEFAULT
         kit_assert (polkit_policy_default_get_allow_any (d) == POLKIT_RESULT_NO);
         kit_assert (polkit_policy_default_get_allow_inactive (d) == POLKIT_RESULT_ONLY_VIA_SELF_AUTH);
         kit_assert (polkit_policy_default_get_allow_active (d) == POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH);
+#endif
         
         polkit_policy_file_entry_ref (pfe);
         polkit_policy_file_entry_unref (pfe);


More information about the hal-commit mailing list