Commit 7c3dc242 authored by Zeeshan Ali's avatar Zeeshan Ali

Move system D-Bus

Sorry all existing apps (if any, other than Maps).
parent 5ca60e46
......@@ -70,6 +70,15 @@ if test "x$enable_debug" = "xyes"; then
CFLAGS="$CFLAGS -O0 -ggdb3"
fi
# DBus system directory
AC_ARG_WITH(dbus-sys-dir, AS_HELP_STRING([--with-dbus-sys-dir=DIR], [where D-BUS system.d directory is]))
if test -n "$with_dbus_sys_dir" ; then
DBUS_SYS_DIR="$with_dbus_sys_dir"
else
DBUS_SYS_DIR="${sysconfdir}/dbus-1/system.d"
fi
AC_SUBST(DBUS_SYS_DIR)
GOBJECT_INTROSPECTION_CHECK([0.6.2])
AC_CONFIG_FILES([
......
servicedir = $(datadir)/dbus-1/services
servicedir = $(datadir)/dbus-1/system-services
service_in_files = org.freedesktop.GeoClue2.service.in
service_DATA = $(service_in_files:.service.in=.service)
$(service_DATA): $(service_in_files) Makefile
@sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
# DBus Service policy file
dbusservicedir = $(DBUS_SYS_DIR)
dbusservice_DATA = org.freedesktop.GeoClue2.conf
EXTRA_DIST = $(service_in_files)
DISTCLEANFILES = $(service_DATA)
<!DOCTYPE busconfig PUBLIC
"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
<policy context="default">
<!-- Allow everyone to talk to main service. We'll later add an agent to
only share the location if user allows it. -->
<allow send_destination="org.freedesktop.GeoClue2"/>
</policy>
<policy user="root">
<!-- Only allow root to own the name on the bus -->
<allow own="org.freedesktop.GeoClue2"/>
</policy>
</busconfig>
......@@ -66,7 +66,7 @@ on_location_updated (GClueClient *client,
const char *new_path,
gpointer user_data)
{
gclue_location_proxy_new_for_bus (G_BUS_TYPE_SESSION,
gclue_location_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
G_DBUS_PROXY_FLAGS_NONE,
"org.freedesktop.GeoClue2",
new_path,
......@@ -129,7 +129,7 @@ on_get_client_ready (GObject *source_object,
g_print ("Client object: %s\n", client_path);
gclue_client_proxy_new_for_bus (G_BUS_TYPE_SESSION,
gclue_client_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
G_DBUS_PROXY_FLAGS_NONE,
"org.freedesktop.GeoClue2",
client_path,
......@@ -168,7 +168,7 @@ main (gint argc, gchar *argv[])
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
g_set_application_name (_("Where Am I"));
gclue_manager_proxy_new_for_bus (G_BUS_TYPE_SESSION,
gclue_manager_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
G_DBUS_PROXY_FLAGS_NONE,
"org.freedesktop.GeoClue2",
"/org/freedesktop/GeoClue2/Manager",
......
......@@ -50,7 +50,7 @@ on_name_lost (GDBusConnection *connection,
const gchar *name,
gpointer user_data)
{
g_critical ("Failed to acquire name '%s' on session bus or lost it.", name);
g_critical ("Failed to acquire name '%s' on system bus or lost it.", name);
exit (-3);
}
......@@ -68,7 +68,7 @@ main (int argc, char **argv)
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
g_set_application_name (_("GeoClue"));
owner_id = g_bus_own_name (G_BUS_TYPE_SESSION,
owner_id = g_bus_own_name (G_BUS_TYPE_SYSTEM,
BUS_NAME,
G_BUS_NAME_OWNER_FLAGS_NONE,
on_bus_acquired,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment