hal: Branch 'master'

David Zeuthen david at kemper.freedesktop.org
Mon Apr 16 22:49:18 PDT 2007


 configure.in             |    2 -
 hald/access-check.c      |   60 +++++++++++++++++++++++------------------------
 hald/dummy/Makefile.am   |    2 -
 hald/freebsd/Makefile.am |    2 -
 hald/hald.c              |   16 ++++++------
 hald/hald.h              |    2 -
 hald/hald_dbus.c         |    2 -
 hald/linux/Makefile.am   |    2 -
 hald/solaris/Makefile.am |    2 -
 tools/hal-acl-tool.c     |   48 ++++++++++++++++++-------------------
 10 files changed, 69 insertions(+), 69 deletions(-)

New commits:
diff-tree b0e7e06138994fac45d08774a20774d04e8245de (from 9dc01220f522f2a84120e9f2c4916a46d8d547ec)
Author: David Zeuthen <davidz at redhat.com>
Date:   Tue Apr 17 01:49:19 2007 -0400

    changes to compile against recent PolicyKit

diff --git a/configure.in b/configure.in
index 2786b5a..4b4247f 100644
--- a/configure.in
+++ b/configure.in
@@ -426,7 +426,7 @@ if test "x$enable_policy_kit" != "xno"; 
    if test "x$enable_console_kit" = "xno"; then
       AC_MSG_ERROR([PolicyKit support requires building with ConsoleKit support too])
    fi
-   PKG_CHECK_MODULES(POLKIT, libpolkit >= 0.3,
+   PKG_CHECK_MODULES(POLKIT, polkit >= 0.3,
 		  	[AM_CONDITIONAL(HAVE_POLKIT, true)
 		   	AC_DEFINE(HAVE_POLKIT, [], [Set if we use PolicyKit])]
                         msg_polkit=yes,
diff --git a/hald/access-check.c b/hald/access-check.c
index 8cd9380..8ff95b7 100644
--- a/hald/access-check.c
+++ b/hald/access-check.c
@@ -39,7 +39,7 @@
 #include <glib.h>
 
 #ifdef HAVE_POLKIT
-#include <libpolkit/libpolkit.h>
+#include <polkit/polkit.h>
 #endif
 
 #include "hald.h"
@@ -117,9 +117,9 @@ get_pk_seat_from_ck_seat (CKSeat *seat)
 {
         char *str;
         PolKitSeat *pk_seat;
-        pk_seat = libpolkit_seat_new ();
+        pk_seat = polkit_seat_new ();
         str = g_strdup_printf ("/org/freedesktop/ConsoleKit/%s", ck_seat_get_id (seat));
-        libpolkit_seat_set_ck_objref (pk_seat, str);
+        polkit_seat_set_ck_objref (pk_seat, str);
         g_free (str);
         return pk_seat;
 }
@@ -139,19 +139,19 @@ get_pk_session_from_ck_session (CKSessio
                 pk_seat = get_pk_seat_from_ck_seat (seat);
         }
 
-        pk_session = libpolkit_session_new ();
+        pk_session = polkit_session_new ();
         if (pk_seat != NULL) {
-                libpolkit_session_set_seat (pk_session, pk_seat);
-                libpolkit_seat_unref (pk_seat);
+                polkit_session_set_seat (pk_session, pk_seat);
+                polkit_seat_unref (pk_seat);
         }
         str = g_strdup_printf ("/org/freedesktop/ConsoleKit/%s", ck_session_get_id (session));
-        libpolkit_session_set_ck_objref (pk_session, str);
+        polkit_session_set_ck_objref (pk_session, str);
         g_free (str);
-        libpolkit_session_set_uid (pk_session, ck_session_get_user (session));
-        libpolkit_session_set_ck_is_active (pk_session, ck_session_is_active (session));
-        libpolkit_session_set_ck_is_local (pk_session, ck_session_is_local (session));
+        polkit_session_set_uid (pk_session, ck_session_get_user (session));
+        polkit_session_set_ck_is_active (pk_session, ck_session_is_active (session));
+        polkit_session_set_ck_is_local (pk_session, ck_session_is_local (session));
         if (!ck_session_is_local (session)) {
-                libpolkit_session_set_ck_remote_host (pk_session, ck_session_get_hostname (session));
+                polkit_session_set_ck_remote_host (pk_session, ck_session_get_hostname (session));
         }
         return pk_session;
 }
@@ -188,14 +188,14 @@ get_pk_caller_from_ci_tracker (CITracker
                 pk_session = get_pk_session_from_ck_session (session);
         }
 
-        pk_caller = libpolkit_caller_new ();
-        libpolkit_caller_set_dbus_name (pk_caller, caller_unique_sysbus_name);
-        libpolkit_caller_set_uid (pk_caller, ci_tracker_caller_get_uid (ci));
-        libpolkit_caller_set_pid (pk_caller, ci_tracker_caller_get_pid (ci));
-        libpolkit_caller_set_selinux_context (pk_caller, ci_tracker_caller_get_selinux_context (ci));
+        pk_caller = polkit_caller_new ();
+        polkit_caller_set_dbus_name (pk_caller, caller_unique_sysbus_name);
+        polkit_caller_set_uid (pk_caller, ci_tracker_caller_get_uid (ci));
+        polkit_caller_set_pid (pk_caller, ci_tracker_caller_get_pid (ci));
+        polkit_caller_set_selinux_context (pk_caller, ci_tracker_caller_get_selinux_context (ci));
         if (pk_session != NULL) {
-                libpolkit_caller_set_ck_session (pk_caller, pk_session);
-                libpolkit_session_unref (pk_session);
+                polkit_caller_set_ck_session (pk_caller, pk_session);
+                polkit_session_unref (pk_session);
         }
 
 out:
@@ -276,7 +276,7 @@ access_check_caller_have_access_to_devic
                 ret = TRUE;
 #ifdef HAVE_POLKIT
                 if (polkit_result_out != NULL)
-                        *polkit_result_out = LIBPOLKIT_RESULT_YES;
+                        *polkit_result_out = POLKIT_RESULT_YES;
 #endif
                 goto out;
         }
@@ -290,24 +290,24 @@ access_check_caller_have_access_to_devic
                 ret = TRUE;
 #ifdef HAVE_POLKIT
                 if (polkit_result_out != NULL)
-                        *polkit_result_out = LIBPOLKIT_RESULT_YES;
+                        *polkit_result_out = POLKIT_RESULT_YES;
 #endif
                 goto out;
         }
 
 #ifdef HAVE_POLKIT
-        pk_action = libpolkit_action_new ();
-        libpolkit_action_set_action_id (pk_action, action);
+        pk_action = polkit_action_new ();
+        polkit_action_set_action_id (pk_action, action);
         
         pk_caller = get_pk_caller_from_ci_tracker (cit, caller_unique_sysbus_name);
         if (pk_caller == NULL)
                 goto out;
 
-        pk_resource = libpolkit_resource_new ();
-        libpolkit_resource_set_resource_type (pk_resource, "hal");
-        libpolkit_resource_set_resource_id (pk_resource, hal_device_get_udi (device));
+        pk_resource = polkit_resource_new ();
+        polkit_resource_set_resource_type (pk_resource, "hal");
+        polkit_resource_set_resource_id (pk_resource, hal_device_get_udi (device));
 
-        pk_result = libpolkit_context_can_caller_access_resource (pk_context,
+        pk_result = polkit_context_can_caller_access_resource (pk_context,
                                                                   pk_action,
                                                                   pk_resource,
                                                                   pk_caller);
@@ -315,7 +315,7 @@ access_check_caller_have_access_to_devic
         if (polkit_result_out != NULL)
                 *polkit_result_out = pk_result;
 
-        if (pk_result != LIBPOLKIT_RESULT_YES)
+        if (pk_result != POLKIT_RESULT_YES)
                 goto out;
 #else
         /* must be tracked by ConsoleKit */
@@ -336,11 +336,11 @@ access_check_caller_have_access_to_devic
 out:
 #ifdef HAVE_POLKIT
         if (pk_caller != NULL)
-                libpolkit_caller_unref (pk_caller);
+                polkit_caller_unref (pk_caller);
         if (pk_resource != NULL)
-                libpolkit_resource_unref (pk_resource);
+                polkit_resource_unref (pk_resource);
         if (pk_action != NULL)
-                libpolkit_action_unref (pk_action);
+                polkit_action_unref (pk_action);
 #endif
         return ret;
 }
diff --git a/hald/dummy/Makefile.am b/hald/dummy/Makefile.am
index 48cebfd..9227dc3 100644
--- a/hald/dummy/Makefile.am
+++ b/hald/dummy/Makefile.am
@@ -6,7 +6,7 @@ INCLUDES = \
 	-DPACKAGE_LOCALE_DIR=\""$(localedir)"\" \
 	-DPACKAGE_LOCALSTATEDIR=\""$(localstatedir)"\" \
 	-I$(top_srcdir) -I.. \
-	@GLIB_CFLAGS@ @DBUS_CFLAGS@
+	@GLIB_CFLAGS@ @DBUS_CFLAGS@ @POLKIT_CFLAGS@
 
 noinst_LTLIBRARIES = libhald_dummy.la
 libhald_dummy_la_SOURCES =                                      \
diff --git a/hald/freebsd/Makefile.am b/hald/freebsd/Makefile.am
index f70f261..0d0bf77 100644
--- a/hald/freebsd/Makefile.am
+++ b/hald/freebsd/Makefile.am
@@ -7,7 +7,7 @@ INCLUDES = \
 	-DPACKAGE_LOCALE_DIR=\""$(localedir)"\" \
 	-DPACKAGE_LOCALSTATEDIR=\""$(localstatedir)"\" \
 	-I$(top_srcdir) -I.. \
-	@GLIB_CFLAGS@ @DBUS_CFLAGS@
+	@GLIB_CFLAGS@ @DBUS_CFLAGS@ @POLKIT_CFLAGS@
 
 if HALD_COMPILE_FREEBSD
 noinst_LTLIBRARIES = libhald_freebsd.la
diff --git a/hald/hald.c b/hald/hald.c
index 240bb07..c9bc2f7 100644
--- a/hald/hald.c
+++ b/hald/hald.c
@@ -752,16 +752,16 @@ main (int argc, char *argv[])
 
 #ifdef HAVE_POLKIT
         p_error = NULL;
-        pk_context = libpolkit_context_new ();
+        pk_context = polkit_context_new ();
         if (pk_context == NULL)
                 DIE (("Could not create PolicyKit context"));
-        libpolkit_context_set_config_changed (pk_context,
-                                              _polkit_config_changed_cb,
-                                              NULL);
-        libpolkit_context_set_file_monitor (pk_context, 
-                                            _polkit_fm_add_watch,
-                                            _polkit_fm_remove_watch);
-        if (!libpolkit_context_init (pk_context, &p_error))
+        polkit_context_set_config_changed (pk_context,
+                                           _polkit_config_changed_cb,
+                                           NULL);
+        polkit_context_set_file_monitor (pk_context, 
+                                         _polkit_fm_add_watch,
+                                         _polkit_fm_remove_watch);
+        if (!polkit_context_init (pk_context, &p_error))
                 DIE (("Could not init PolicyKit context: %s", polkit_error_get_error_message (p_error)));
 #endif
 
diff --git a/hald/hald.h b/hald/hald.h
index 207b0c4..c81bf2f 100644
--- a/hald/hald.h
+++ b/hald/hald.h
@@ -30,7 +30,7 @@
 #include <stdint.h>
 #include <dbus/dbus.h>
 #ifdef HAVE_POLKIT
-#include <libpolkit/libpolkit.h>
+#include <polkit/polkit.h>
 #endif
 
 #include "device_store.h"
diff --git a/hald/hald_dbus.c b/hald/hald_dbus.c
index 453e9f6..8cb09ae 100644
--- a/hald/hald_dbus.c
+++ b/hald/hald_dbus.c
@@ -2257,7 +2257,7 @@ device_is_caller_privileged (DBusConnect
         polkit_result = -1;
         access_check_caller_have_access_to_device (
                 ci_tracker, d, action, caller_sysbus_name, &polkit_result);
-        result = libpolkit_result_to_string_representation (polkit_result);
+        result = polkit_result_to_string_representation (polkit_result);
 
         if (polkit_result < 0 || result == NULL) {
 		raise_error (connection, message, 
diff --git a/hald/linux/Makefile.am b/hald/linux/Makefile.am
index 76df7f5..8933155 100644
--- a/hald/linux/Makefile.am
+++ b/hald/linux/Makefile.am
@@ -8,7 +8,7 @@ INCLUDES = \
 	-DPACKAGE_LOCALE_DIR=\""$(localedir)"\" \
 	-DPACKAGE_LOCALSTATEDIR=\""$(localstatedir)"\" \
 	-I$(top_srcdir) -I.. \
-	@GLIB_CFLAGS@ @DBUS_CFLAGS@
+	@GLIB_CFLAGS@ @DBUS_CFLAGS@ @POLKIT_CFLAGS@
 
 if HALD_COMPILE_LINUX
 noinst_LTLIBRARIES = libhald_linux.la
diff --git a/hald/solaris/Makefile.am b/hald/solaris/Makefile.am
index 36f5a78..04059c6 100644
--- a/hald/solaris/Makefile.am
+++ b/hald/solaris/Makefile.am
@@ -8,7 +8,7 @@ INCLUDES = \
 	-DPACKAGE_LOCALE_DIR=\""$(localedir)"\" \
 	-DPACKAGE_LOCALSTATEDIR=\""$(localstatedir)"\" \
 	-I$(top_srcdir) -I.. \
-	@GLIB_CFLAGS@ @DBUS_CFLAGS@
+	@GLIB_CFLAGS@ @DBUS_CFLAGS@ @POLKIT_CFLAGS@
 
 if HALD_COMPILE_SOLARIS
 noinst_LTLIBRARIES = libhald_solaris.la
diff --git a/tools/hal-acl-tool.c b/tools/hal-acl-tool.c
index eb35cd2..5872497 100644
--- a/tools/hal-acl-tool.c
+++ b/tools/hal-acl-tool.c
@@ -33,7 +33,7 @@
 
 #include <glib.h>
 #include <libhal.h>
-#include <libpolkit/libpolkit.h>
+#include <polkit/polkit.h>
 
 /* How this works (or "An introduction to this code")
  *
@@ -635,39 +635,39 @@ acl_device_added_visitor (const char *se
 			continue;
 		}
 
-                pk_seat = libpolkit_seat_new ();
-                libpolkit_seat_set_ck_objref (pk_seat, seat_id);
+                pk_seat = polkit_seat_new ();
+                polkit_seat_set_ck_objref (pk_seat, seat_id);
 
-                pk_session = libpolkit_session_new ();
-                libpolkit_session_set_seat (pk_session, pk_seat);
-                libpolkit_seat_unref (pk_seat);
-                libpolkit_session_set_ck_objref (pk_session, session_id);
-                libpolkit_session_set_uid (pk_session, session_uid);
-                libpolkit_session_set_ck_is_active (pk_session, session_is_active);
-                libpolkit_session_set_ck_is_local (pk_session, session_is_local);
-                /* TODO: FIXME: libpolkit_session_set_ck_remote_host (pk_session, );*/ 
-
-                pk_resource = libpolkit_resource_new();
-                libpolkit_resource_set_resource_type (pk_resource, "hal");
-                libpolkit_resource_set_resource_id (pk_resource, afd->udi);
+                pk_session = polkit_session_new ();
+                polkit_session_set_seat (pk_session, pk_seat);
+                polkit_seat_unref (pk_seat);
+                polkit_session_set_ck_objref (pk_session, session_id);
+                polkit_session_set_uid (pk_session, session_uid);
+                polkit_session_set_ck_is_active (pk_session, session_is_active);
+                polkit_session_set_ck_is_local (pk_session, session_is_local);
+                /* TODO: FIXME: polkit_session_set_ck_remote_host (pk_session, );*/ 
+
+                pk_resource = polkit_resource_new();
+                polkit_resource_set_resource_type (pk_resource, "hal");
+                polkit_resource_set_resource_id (pk_resource, afd->udi);
 
-                pk_action = libpolkit_action_new();
+                pk_action = polkit_action_new();
                 priv_name = g_strdup_printf ("hal-device-file-%s", afd->type);
-                libpolkit_action_set_action_id (pk_action, priv_name);
+                polkit_action_set_action_id (pk_action, priv_name);
                 g_free (priv_name);
 
                 /* Now ask PolicyKit if the given session should have access */
-                pk_result = libpolkit_context_can_session_access_resource (pk_context, 
+                pk_result = polkit_context_can_session_access_resource (pk_context, 
                                                                            pk_action,
                                                                            pk_resource,
                                                                            pk_session);
-                if (pk_result == LIBPOLKIT_RESULT_YES) {
+                if (pk_result == POLKIT_RESULT_YES) {
 			afd_grant_to_uid (afd, session_uid);
                 }
 
-                libpolkit_action_unref (pk_action);
-                libpolkit_resource_unref (pk_resource);
-                libpolkit_session_unref (pk_session);
+                polkit_action_unref (pk_action);
+                polkit_resource_unref (pk_resource);
+                polkit_session_unref (pk_session);
 	}
 
 }
@@ -1073,8 +1073,8 @@ main (int argc, char *argv[])
 	}
 
         p_error = NULL;
-        pk_context = libpolkit_context_new ();
-        if (!libpolkit_context_init (pk_context, &p_error)) {
+        pk_context = polkit_context_new ();
+        if (!polkit_context_init (pk_context, &p_error)) {
                 printf ("Could not init PolicyKit context: %s\n", polkit_error_get_error_message (p_error));
                 goto out;
         }


More information about the hal-commit mailing list