epel9
Matthias Clasen 17 years ago
parent 322bef7e1c
commit 3f0535a4e2

@ -1 +1 @@
GConf-2.23.1.tar.bz2
GConf-2.23.2.tar.bz2

@ -6,7 +6,7 @@
Summary: A process-transparent configuration system
Name: GConf2
Version: 2.23.1
Version: 2.23.2
Release: 1%{?dist}
License: LGPLv2+
Group: System Environment/Base
@ -25,9 +25,7 @@ BuildRequires: pkgconfig >= 0.14
BuildRequires: gettext
BuildRequires: openldap-devel
BuildRequires: perl(XML::Parser)
BuildRequires: libtool, autoconf, automake
BuildRequires: intltool
# for patch3
BuildRequires: PolicyKit-devel >= 0.8
BuildRequires: dbus-glib-devel >= 0.8
Requires: dbus
@ -38,10 +36,6 @@ Patch0: GConf-2.18.0.1-reload.patch
# http://bugzilla.gnome.org/show_bug.cgi?id=356573
Patch1: GConf2-2.14.0-timeout.patch
# http://bugzilla.gnome.org/show_bug.cgi?id=531169
Patch6: defaults.patch
Patch7: fix-defaults.patch
%description
GConf is a process-transparent configuration database API used to
store user preferences. It has pluggable backends and features to
@ -77,14 +71,9 @@ which require GTK+.
%setup -q -n GConf-%{version}
%patch0 -p1 -b .reload
%patch1 -p1 -b .timers
%patch6 -p1 -b .defaults
%patch7 -p1 -b .fix-defaults
%build
rm -f libtool
libtoolize --force --copy
autoreconf
%configure --disable-static
%configure --disable-static --enable-defaults-service
make
%install
@ -151,6 +140,10 @@ fi
%{_libdir}/pkgconfig/*
%changelog
* Fri Aug 22 2008 Matthias Clasen <mclasen@redhat.com> - 2.23.2-1
- Update to 2.23.2
- Drop upstreamed patches
* Wed Jun 4 2008 Matthias Clasen <mclasen@redhat.com> - 2.23.1-1
- Upodate to 2.23.1

File diff suppressed because it is too large Load Diff

@ -1,21 +0,0 @@
diff -up GConf-2.22.0/defaults/gconf-defaults.c.fix-defaults GConf-2.22.0/defaults/gconf-defaults.c
--- GConf-2.22.0/defaults/gconf-defaults.c.fix-defaults 2008-06-03 02:04:06.000000000 -0400
+++ GConf-2.22.0/defaults/gconf-defaults.c 2008-06-03 02:04:29.000000000 -0400
@@ -549,7 +549,7 @@ do_copy (GConfDefaults *mechani
copy_entry (source, includes[i], changes, excludes);
}
- gconf_client_commit_change_set (dest, changes, TRUE, &error);
+ gconf_client_commit_change_set (dest, changes, FALSE, &error);
gconf_client_suggest_sync (dest, NULL);
if (changeset_out) {
@@ -612,7 +612,7 @@ gconf_defaults_set_system (GConfDefaults
gconf_change_set_foreach (changes, append_key, keys);
g_ptr_array_add (keys, NULL);
- g_signal_emit (mechanism, signals[SYSTEM_SET], 0, keys);
+ g_signal_emit (mechanism, signals[SYSTEM_SET], 0, keys->pdata);
g_ptr_array_free (keys, TRUE);
gconf_change_set_unref (changes);

@ -1,799 +0,0 @@
diff -up GConf-2.22.0/configure.in.use-dbus GConf-2.22.0/configure.in
--- GConf-2.22.0/configure.in.use-dbus 2008-05-08 17:24:48.000000000 -0400
+++ GConf-2.22.0/configure.in 2008-05-08 17:25:13.000000000 -0400
@@ -131,7 +131,7 @@ GTK_DOC_CHECK([1.0])
AC_ARG_ENABLE(gtk, [ --enable-gtk Enable GTK+ support (for gconf-sanity-check) [default=auto]], enable_gtk="$enableval", enable_gtk=auto)
-PKGCONFIG_MODULES='glib-2.0 > 2.9.0 gmodule-2.0 >= 2.7.0 gobject-2.0 >= 2.7.0 ORBit-2.0 >= 2.4.0'
+PKGCONFIG_MODULES='glib-2.0 > 2.9.0 gmodule-2.0 >= 2.7.0 gobject-2.0 >= 2.7.0 ORBit-2.0 >= 2.4.0 dbus-1 >= 1.0.0 dbus-glib-1 >= 0.74'
PKGCONFIG_MODULES_WITH_XML="$PKGCONFIG_MODULES libxml-2.0"
PKGCONFIG_MODULES_WITH_GTK=" $PKGCONFIG_MODULES gtk+-2.0 >= 2.0.0"
PKGCONFIG_MODULES_WITH_XML_AND_GTK=" $PKGCONFIG_MODULES gtk+-2.0 libxml-2.0"
diff -up GConf-2.22.0/gconf/gconfd.c.use-dbus GConf-2.22.0/gconf/gconfd.c
--- GConf-2.22.0/gconf/gconfd.c.use-dbus 2008-05-08 17:23:23.000000000 -0400
+++ GConf-2.22.0/gconf/gconfd.c 2008-05-08 17:23:23.000000000 -0400
@@ -55,6 +55,8 @@
#endif
#include <locale.h>
+#include <dbus/dbus-glib-lowlevel.h>
+
/* This makes hash table safer when debugging */
#ifndef GCONF_ENABLE_DEBUG
#define safe_g_hash_table_insert g_hash_table_insert
@@ -497,57 +499,122 @@ gconf_get_poa (void)
return the_poa;
}
-/* From ORBit2 */
-/* There is a DOS attack if another user creates
- * the given directory and keeps us from creating
- * it
- */
-static gboolean
-test_safe_tmp_dir (const char *dirname)
+static const char *
+get_introspection_xml (void)
{
-#ifndef G_OS_WIN32
- struct stat statbuf;
- int fd;
+ return "<!DOCTYPE node PUBLIC \"-//freedesktop//DTD D-BUS Object Introspection 1.0//EN\"\n"
+ "\"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd\">\n"
+ "<node>\n"
+ " <interface name=\"org.freedesktop.DBus.Introspectable\">\n"
+ " <method name=\"Introspect\">\n"
+ " <arg name=\"introspection_xml\" direction=\"out\" type=\"s\"/>\n"
+ " </method>\n"
+ " </interface>\n"
+ " <interface name=\"org.gnome.GConf\">\n"
+ " <method name=\"GetIOR\">\n"
+ " <arg name=\"ior\" direction=\"out\" type=\"s\"/>\n"
+ " </method>\n"
+ " </interface>\n"
+ "</node>\n";
+}
+
+static DBusHandlerResult
+bus_message_handler (DBusConnection *connection,
+ DBusMessage *message,
+ GMainLoop *loop)
+{
+ DBusMessage *reply;
+
+ reply = NULL;
+
+ if (dbus_message_is_signal (message,
+ DBUS_INTERFACE_LOCAL,
+ "Disconnected"))
+ {
+ gconf_main_quit ();
+ return DBUS_HANDLER_RESULT_HANDLED;
+ }
+ else if (dbus_message_is_method_call (message,
+ "org.freedesktop.DBus.Introspectable",
+ "Introspect"))
+ {
+ const char *introspection_xml;
- fd = open (dirname, O_RDONLY);
- if (fd < 0)
+ introspection_xml = get_introspection_xml ();
+
+ reply = dbus_message_new_method_return (message);
+ dbus_message_append_args (reply, DBUS_TYPE_STRING, &introspection_xml,
+ DBUS_TYPE_INVALID);
+
+ }
+ else if (dbus_message_is_method_call (message,
+ "org.gnome.GConf",
+ "GetIOR"))
{
- gconf_log (GCL_WARNING, _("Failed to open %s: %s"),
- dirname, g_strerror (errno));
- return FALSE;
+ const char *ior;
+
+ ior = gconf_get_daemon_ior ();
+
+ reply = dbus_message_new_method_return (message);
+ dbus_message_append_args (reply, DBUS_TYPE_STRING, &ior, DBUS_TYPE_INVALID);
}
-
- if (fstat (fd, &statbuf) != 0)
+
+ if (reply != NULL)
{
- gconf_log (GCL_WARNING, _("Failed to stat %s: %s"),
- dirname, g_strerror (errno));
- close (fd);
- return FALSE;
+ dbus_connection_send (connection, reply, NULL);
+ dbus_message_unref (reply);
+ return DBUS_HANDLER_RESULT_HANDLED;
}
- close (fd);
- if (statbuf.st_uid != getuid ())
+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+}
+
+static DBusConnection *
+get_on_d_bus (void)
+{
+ DBusConnection *connection;
+ DBusError bus_error;
+ int result;
+
+ dbus_error_init (&bus_error);
+ connection = dbus_bus_get (DBUS_BUS_SESSION, &bus_error);
+
+ if (dbus_error_is_set (&bus_error))
{
- gconf_log (GCL_WARNING, _("Owner of %s is not the current user"),
- dirname);
- return FALSE;
+ gconf_log (GCL_ERR, _("Could not connect to session bus: %s"), bus_error.message);
+ dbus_error_free (&bus_error);
+ return NULL;
}
- if ((statbuf.st_mode & (S_IRWXG|S_IRWXO)) ||
- !S_ISDIR (statbuf.st_mode))
+ dbus_connection_setup_with_g_main (connection, NULL);
+
+ if (!dbus_connection_add_filter (connection, (DBusHandleMessageFunction)
+ bus_message_handler, NULL, NULL))
{
- gconf_log (GCL_WARNING, _("Bad permissions %lo on directory %s"),
- (unsigned long) statbuf.st_mode & 07777, dirname);
- return FALSE;
+ dbus_connection_unref (connection);
+ return NULL;
}
-#else
- /* FIXME: We can't get any useful information about the actual
- * protection for the directory using stat(). We must use the Win32
- * API to check the owner and permissions (ACL). Later.
- */
-#endif
-
- return TRUE;
+
+ dbus_connection_set_exit_on_disconnect (connection, FALSE);
+
+ result = dbus_bus_request_name (connection, "org.gnome.GConf",
+ 0, &bus_error);
+
+ if (dbus_error_is_set (&bus_error))
+ {
+ gconf_log (GCL_WARNING,
+ _("Failed to get bus name for daemon, exiting: %s"),
+ bus_error.message);
+ dbus_error_free (&bus_error);
+ }
+
+ if (result != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER)
+ {
+ dbus_connection_unref (connection);
+ return NULL;
+ }
+
+ return connection;
}
int
@@ -562,10 +629,9 @@ main(int argc, char** argv)
gchar* ior;
int exit_code = 0;
GError *err;
- char *lock_dir;
- char *gconfd_dir;
int dev_null_fd;
int write_byte_fd;
+ DBusConnection *connection;
_gconf_init_i18n ();
setlocale (LC_ALL, "");
@@ -672,32 +738,9 @@ main(int argc, char** argv)
gconf_set_daemon_ior (ior);
CORBA_free (ior);
- gconfd_dir = gconf_get_daemon_dir ();
- lock_dir = gconf_get_lock_dir ();
-
- if (g_mkdir (gconfd_dir, 0700) < 0 && errno != EEXIST)
- gconf_log (GCL_WARNING, _("Failed to create %s: %s"),
- gconfd_dir, g_strerror (errno));
-
- if (!test_safe_tmp_dir (gconfd_dir))
- {
- err = g_error_new (GCONF_ERROR,
- GCONF_ERROR_LOCK_FAILED,
- _("Directory %s has a problem, gconfd can't use it"),
- gconfd_dir);
- daemon_lock = NULL;
- }
- else
- {
- err = NULL;
-
- daemon_lock = gconf_get_lock (lock_dir, &err);
- }
-
- g_free (gconfd_dir);
- g_free (lock_dir);
+ connection = get_on_d_bus ();
- if (daemon_lock != NULL)
+ if (connection != NULL)
{
/* This loads backends and so on. It needs to be done before
* we can handle any requests, so before we hit the
@@ -721,14 +764,8 @@ main(int argc, char** argv)
close (write_byte_fd);
}
- if (daemon_lock == NULL)
+ if (connection == NULL)
{
- g_assert (err);
-
- gconf_log (GCL_WARNING, _("Failed to get lock for daemon, exiting: %s"),
- err->message);
- g_error_free (err);
-
enter_shutdown ();
shutdown_databases ();
diff -up GConf-2.22.0/gconf/gconf-internals.c.use-dbus GConf-2.22.0/gconf/gconf-internals.c
--- GConf-2.22.0/gconf/gconf-internals.c.use-dbus 2008-05-08 17:23:23.000000000 -0400
+++ GConf-2.22.0/gconf/gconf-internals.c 2008-05-08 17:23:23.000000000 -0400
@@ -36,6 +36,8 @@
#include <time.h>
#include <math.h>
+#include <dbus/dbus.h>
+
#ifdef G_OS_WIN32
#include <windows.h>
#include <share.h>
@@ -2418,107 +2420,101 @@ open_empty_locked_file (const gchar *dir
return fd;
}
-static ConfigServer
-read_current_server_and_set_warning (const gchar *iorfile,
- GString *warning)
-{
- FILE *fp;
-
- fp = g_fopen (iorfile, "r");
-
- if (fp == NULL)
- {
- if (warning)
- g_string_append_printf (warning,
- _("IOR file '%s' not opened successfully, no gconfd located: %s"),
- iorfile, g_strerror (errno));
-
- return CORBA_OBJECT_NIL;
- }
- else /* successfully opened IOR file */
- {
- char buf[2048] = { '\0' };
- const char *str = NULL;
-
- fgets (buf, sizeof (buf) - 2, fp);
- fclose (fp);
-
- /* The lockfile format is <pid>:<ior> for gconfd
- * or <pid>:none for gconftool
- */
- str = buf;
- while (isdigit ((unsigned char) *str))
- ++str;
+static char *
+get_ior (gboolean start_if_not_found,
+ GString *failure_log)
+{
+ DBusMessage *message, *reply;
+ DBusConnection *connection;
+ DBusError bus_error;
+ char *ior;
+
+ dbus_error_init (&bus_error);
+ connection = dbus_bus_get (DBUS_BUS_SESSION, &bus_error);
+
+ if (dbus_error_is_set (&bus_error)) {
+ if (failure_log)
+ g_string_append_printf (failure_log,
+ _("Failed to get connection to session: %s"),
+ bus_error.message);
+ dbus_error_free (&bus_error);
+ return NULL;
+ }
+
+ message = dbus_message_new_method_call ("org.gnome.GConf",
+ "/org/gnome/GConf",
+ "org.gnome.GConf",
+ "GetIOR");
+ dbus_message_set_auto_start (message, start_if_not_found);
+
+ reply = dbus_connection_send_with_reply_and_block (connection, message, -1,
+ &bus_error);
+ dbus_message_unref (message);
+
+ if (dbus_error_is_set (&bus_error)) {
+ if (failure_log)
+ g_string_append_printf (failure_log,
+ _("Could not send message to gconf daemon: %s"),
+ bus_error.message);
+ dbus_error_free (&bus_error);
+ return NULL;
+ }
+
+ ior = NULL;
+ if (!dbus_message_get_args (reply, &bus_error, DBUS_TYPE_STRING,
+ &ior, DBUS_TYPE_INVALID)) {
+ if (failure_log)
+ g_string_append_printf (failure_log,
+ _("daemon gave errnoneous reply: %s"),
+ bus_error.message);
+ dbus_error_free (&bus_error);
+ return NULL;
+ }
- if (*str == ':')
- ++str;
-
- if (str[0] == 'n' &&
- str[1] == 'o' &&
- str[2] == 'n' &&
- str[3] == 'e')
- {
- if (warning)
- g_string_append_printf (warning,
- _("gconftool or other non-gconfd process has the lock file '%s'"),
- iorfile);
- }
- else /* file contains daemon IOR */
- {
- CORBA_ORB orb;
- CORBA_Environment ev;
- ConfigServer server;
-
- CORBA_exception_init (&ev);
-
- orb = gconf_orb_get ();
+ ior = g_strdup (ior);
- if (orb == NULL)
- {
- if (warning)
- g_string_append_printf (warning,
- _("couldn't contact ORB to resolve existing gconfd object reference"));
- return CORBA_OBJECT_NIL;
- }
-
- server = CORBA_ORB_string_to_object (orb, (char*) str, &ev);
- CORBA_exception_free (&ev);
-
- if (server == CORBA_OBJECT_NIL &&
- warning)
- g_string_append_printf (warning,
- _("Failed to convert IOR '%s' to an object reference"),
- str);
-
- return server;
- }
+ dbus_message_unref (reply);
+ dbus_connection_unref (connection);
- return CORBA_OBJECT_NIL;
- }
+ return ior;
}
static ConfigServer
-read_current_server (const gchar *iorfile,
- gboolean warn_if_fail)
+gconf_get_server (gboolean start_if_not_found,
+ GString *failure_log)
{
- GString *warning;
ConfigServer server;
-
- if (warn_if_fail)
- warning = g_string_new (NULL);
- else
- warning = NULL;
+ char *ior;
+ CORBA_ORB orb;
+ CORBA_Environment ev;
- server = read_current_server_and_set_warning (iorfile, warning);
+ ior = get_ior (start_if_not_found, failure_log);
- if (warning)
+ if (ior == NULL)
{
- if (warning->len > 0)
- gconf_log (GCL_WARNING, "%s", warning->str);
+ return CORBA_OBJECT_NIL;
+ }
+
+ CORBA_exception_init (&ev);
+ orb = gconf_orb_get ();
- g_string_free (warning, TRUE);
+ if (orb == NULL)
+ {
+ if (failure_log)
+ g_string_append_printf (failure_log,
+ _("couldn't contact ORB to resolve existing gconfd object reference"));
+ return CORBA_OBJECT_NIL;
}
+ server = CORBA_ORB_string_to_object (orb, (char*) ior, &ev);
+ CORBA_exception_free (&ev);
+
+ if (server == CORBA_OBJECT_NIL &&
+ failure_log)
+ g_string_append_printf (failure_log,
+ _("Failed to convert IOR '%s' to an object reference"),
+ ior);
+
return server;
}
@@ -2563,7 +2559,7 @@ gconf_get_lock_or_current_holder (const
* it to the caller. Error is already set.
*/
if (current_server)
- *current_server = read_current_server (lock->iorfile, TRUE);
+ *current_server = gconf_get_server (FALSE, NULL);
gconf_lock_destroy (lock);
@@ -2726,40 +2722,6 @@ gconf_release_lock (GConfLock *lock,
return retval;
}
-/* This function doesn't try to see if the lock is valid or anything
- * of the sort; it just reads it. It does do the object_to_string
- */
-ConfigServer
-gconf_get_current_lock_holder (const gchar *lock_directory,
- GString *failure_log)
-{
- char *iorfile;
- ConfigServer server;
-
- iorfile = g_strconcat (lock_directory, "/ior", NULL);
- server = read_current_server_and_set_warning (iorfile, failure_log);
- g_free (iorfile);
- return server;
-}
-
-void
-gconf_daemon_blow_away_locks (void)
-{
- char *lock_directory;
- char *iorfile;
-
- lock_directory = gconf_get_lock_dir ();
-
- iorfile = g_strconcat (lock_directory, "/ior", NULL);
-
- if (g_unlink (iorfile) < 0)
- g_printerr (_("Failed to unlink lock file %s: %s\n"),
- iorfile, g_strerror (errno));
-
- g_free (iorfile);
- g_free (lock_directory);
-}
-
static CORBA_ORB gconf_orb = CORBA_OBJECT_NIL;
CORBA_ORB
@@ -2851,173 +2813,45 @@ gconf_get_lock_dir (void)
return lock_dir;
}
-#if defined (F_SETFD) && defined (FD_CLOEXEC)
-
-#ifndef HAVE_FDWALK
-static void
-set_cloexec (gint fd)
-{
- fcntl (fd, F_SETFD, FD_CLOEXEC);
-#else
-static int
-set_cloexec (void *data, int fd)
-{
- int *pipes = (int *)data;
-
- if (fd != pipes[1] && fd > 2)
- fcntl (fd, F_SETFD, FD_CLOEXEC);
-
- return 0;
-#endif
-}
-
-
-static void
-close_fd_func (gpointer data)
-{
- int *pipes = data;
-
-#ifndef HAVE_FDWALK
- gint open_max;
- gint i;
-
- open_max = sysconf (_SC_OPEN_MAX);
- for (i = 3; i < open_max; i++)
- {
- /* don't close our write pipe */
- if (i != pipes[1])
- set_cloexec (i);
- }
-#else
- (void) fdwalk(set_cloexec, (void *)pipes);
-#endif
-}
-
-#else
-
-#define close_fd_func NULL
-
-#endif
-
ConfigServer
gconf_activate_server (gboolean start_if_not_found,
GError **error)
{
ConfigServer server = CORBA_OBJECT_NIL;
- int p[2] = { -1, -1 };
- char buf[1];
GError *tmp_err;
- char *argv[3];
- char *gconfd_dir;
- char *lock_dir;
GString *failure_log;
- struct stat statbuf;
CORBA_Environment ev;
- gboolean dir_accessible;
failure_log = g_string_new (NULL);
- gconfd_dir = gconf_get_daemon_dir ();
-
- dir_accessible = g_stat (gconfd_dir, &statbuf) >= 0;
+ g_string_append (failure_log, " 1: ");
+ server = gconf_get_server (start_if_not_found, failure_log);
- if (!dir_accessible && errno != ENOENT)
- {
- server = CORBA_OBJECT_NIL;
- gconf_log (GCL_WARNING, _("Failed to stat %s: %s"),
- gconfd_dir, g_strerror (errno));
- }
- else if (dir_accessible)
- {
- g_string_append (failure_log, " 1: ");
- lock_dir = gconf_get_lock_dir ();
- server = gconf_get_current_lock_holder (lock_dir, failure_log);
- g_free (lock_dir);
-
- /* Confirm server exists */
- CORBA_exception_init (&ev);
-
- if (!CORBA_Object_is_nil (server, &ev))
- {
- ConfigServer_ping (server, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION)
- {
- server = CORBA_OBJECT_NIL;
-
- g_string_append_printf (failure_log,
- _("Server ping error: %s"),
- CORBA_exception_id (&ev));
- }
- }
-
- CORBA_exception_free (&ev);
-
- if (server != CORBA_OBJECT_NIL)
- {
- g_string_free (failure_log, TRUE);
- g_free (gconfd_dir);
- return server;
- }
- }
-
- g_free (gconfd_dir);
+ /* Confirm server exists */
+ CORBA_exception_init (&ev);
- if (start_if_not_found)
+ if (!CORBA_Object_is_nil (server, &ev))
{
- /* Spawn server */
- if (pipe (p) < 0)
+ ConfigServer_ping (server, &ev);
+
+ if (ev._major != CORBA_NO_EXCEPTION)
{
- g_set_error (error,
- GCONF_ERROR,
- GCONF_ERROR_NO_SERVER,
- _("Failed to create pipe for communicating with spawned gconf daemon: %s\n"),
- g_strerror (errno));
- goto out;
- }
+ server = CORBA_OBJECT_NIL;
- argv[0] = g_build_filename (GCONF_SERVERDIR, GCONFD, NULL);
- argv[1] = g_strdup_printf ("%d", p[1]);
- argv[2] = NULL;
-
- tmp_err = NULL;
- if (!g_spawn_async (NULL,
- argv,
- NULL,
- G_SPAWN_LEAVE_DESCRIPTORS_OPEN,
- close_fd_func,
- p,
- NULL,
- &tmp_err))
- {
- g_free (argv[0]);
- g_free (argv[1]);
- g_set_error (error,
- GCONF_ERROR,
- GCONF_ERROR_NO_SERVER,
- _("Failed to launch configuration server: %s\n"),
- tmp_err->message);
- g_error_free (tmp_err);
- goto out;
+ g_string_append_printf (failure_log,
+ _("Server ping error: %s"),
+ CORBA_exception_id (&ev));
}
-
- g_free (argv[0]);
- g_free (argv[1]);
+ }
+
+ CORBA_exception_free (&ev);
- /* If the server dies, we don't want to block indefinitely in
- the read. */
- close (p[1]);
- p[1] = -1;
-
- /* Block until server starts up */
- read (p[0], buf, 1);
-
- g_string_append (failure_log, " 2: ");
- lock_dir = gconf_get_lock_dir ();
- server = gconf_get_current_lock_holder (lock_dir, failure_log);
- g_free (lock_dir);
+ if (server != CORBA_OBJECT_NIL)
+ {
+ g_string_free (failure_log, TRUE);
+ return server;
}
-
+
out:
if (server == CORBA_OBJECT_NIL &&
error &&
@@ -3030,11 +2864,6 @@ gconf_activate_server (gboolean start_i
g_string_free (failure_log, TRUE);
- if (p[0] != -1)
- close (p[0]);
- if (p[1] != -1)
- close (p[1]);
-
return server;
}
diff -up GConf-2.22.0/gconf/gconf-sanity-check.c.use-dbus GConf-2.22.0/gconf/gconf-sanity-check.c
--- GConf-2.22.0/gconf/gconf-sanity-check.c.use-dbus 2007-11-01 15:35:40.000000000 -0400
+++ GConf-2.22.0/gconf/gconf-sanity-check.c 2008-05-08 17:23:23.000000000 -0400
@@ -381,8 +381,6 @@ offer_delete_locks (void)
g_slist_free (addresses);
- gconf_daemon_blow_away_locks ();
-
return TRUE;
}
diff -up GConf-2.22.0/gconf/Makefile.am.use-dbus GConf-2.22.0/gconf/Makefile.am
--- GConf-2.22.0/gconf/Makefile.am.use-dbus 2007-11-01 15:35:40.000000000 -0400
+++ GConf-2.22.0/gconf/Makefile.am 2008-05-08 17:23:23.000000000 -0400
@@ -121,11 +121,17 @@ libgconf_2_la_LDFLAGS = -version-info $(
libgconf_2_la_LIBADD = $(INTLLIBS) $(DEPENDENT_LIBS)
-EXTRA_DIST=GConfX.idl default.path.in gconfmarshal.list regenerate-enum-header.sh regenerate-enum-footer.sh
+EXTRA_DIST=GConfX.idl default.path.in org.gnome.GConf.service gconfmarshal.list regenerate-enum-header.sh regenerate-enum-footer.sh
default.path: $(srcdir)/default.path.in
sed -e 's,[@]sysgconfdir[@],$(sysgconfdir),g' \
<$(srcdir)/default.path.in >default.path
+org.gnome.GConf.service: $(srcdir)/org.gnome.GConf.service.in
+ sed -e 's,[@]libexecdir[@],$(libexecdir),g' \
+ <$(srcdir)/org.gnome.GConf.service.in >org.gnome.GConf.service
+
+servicedir = $(datadir)/dbus-1/services
+service_DATA = org.gnome.GConf.service
install-data-local: default.path
$(mkinstalldirs) $(DESTDIR)$(sysgconfdir)/$(MAJOR_VERSION)
diff -up /dev/null GConf-2.22.0/gconf/org.gnome.GConf.service.in
--- /dev/null 2008-05-08 09:12:32.052279633 -0400
+++ GConf-2.22.0/gconf/org.gnome.GConf.service.in 2008-05-08 17:23:23.000000000 -0400
@@ -0,0 +1,3 @@
+[D-BUS Service]
+Name=org.gnome.GConf
+Exec=@libexecdir@/gconfd-2
--- GConf-2.22.0/gconf/gconf-internals.c (revision 2592)
+++ GConf-2.22.0/gconf/gconf-internals.c (working copy)
@@ -2429,6 +2429,16 @@ get_ior (gboolean start_if_not_found,
DBusError bus_error;
char *ior;
+ /* if the bus isn't running and we don't want to start gconfd then
+ * we don't want to autolaunch the bus either, so bail early.
+ */
+ if (g_getenv ("DBUS_SESSION_BUS_ADDRESS") == NULL
+ && (!start_if_not_found || g_getenv ("DISPLAY") == NULL)) {
+ if (failure_log)
+ g_string_append_printf (failure_log,
+ _("Not running within active session"));
+ return NULL;
+ }
dbus_error_init (&bus_error);
connection = dbus_bus_get (DBUS_BUS_SESSION, &bus_error);
Index: gconf/gconf/gconftool.c
===================================================================
--- gconf/gconf/gconftool.c (revision 2600)
+++ gconf/gconf/gconftool.c (working copy)
@@ -890,7 +890,27 @@ main (int argc, char** argv)
}
if (config_source == NULL)
- conf = gconf_engine_get_default();
+ {
+ /* If we aren't running from within a session,
+ * assume we'll be touching the database locally
+ */
+ conf = NULL;
+ if (g_getenv ("DBUS_SESSION_BUS_ADDRESS") == NULL)
+ {
+ char *conffile;
+ GSList *addresses;
+
+ conffile = g_strconcat (GCONF_CONFDIR, "/path", NULL);
+ addresses = gconf_load_source_path (conffile, NULL);
+ g_free(conffile);
+
+ conf = gconf_engine_get_local_for_addresses (addresses, &err);
+ gconf_address_list_free (addresses);
+ }
+
+ if (conf == NULL)
+ conf = gconf_engine_get_default();
+ }
else
{
GSList *addresses;

File diff suppressed because it is too large Load Diff

@ -1,274 +0,0 @@
diff -Nur -x '*.orig' -x '*~' gconf-2.21.1/gconf/gconfd.c gconf-2.21.1.new/gconf/gconfd.c
--- gconf-2.21.1/gconf/gconfd.c 2008-01-08 15:27:41.000000000 +0100
+++ gconf-2.21.1.new/gconf/gconfd.c 2008-01-14 12:06:23.000000000 +0100
@@ -49,9 +49,6 @@
#include <fcntl.h>
#include <errno.h>
#include <ctype.h>
-#ifdef HAVE_SYSLOG_H
-#include <syslog.h>
-#endif
#include <time.h>
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
@@ -500,41 +497,6 @@
return the_poa;
}
-static void
-log_handler (const gchar *log_domain,
- GLogLevelFlags log_level,
- const gchar *message,
- gpointer user_data)
-{
- GConfLogPriority pri = GCL_WARNING;
-
- switch (log_level & G_LOG_LEVEL_MASK)
- {
- case G_LOG_LEVEL_ERROR:
- case G_LOG_LEVEL_CRITICAL:
- pri = GCL_ERR;
- break;
-
- case G_LOG_LEVEL_WARNING:
- pri = GCL_WARNING;
- break;
-
- case G_LOG_LEVEL_MESSAGE:
- case G_LOG_LEVEL_INFO:
- pri = GCL_INFO;
- break;
-
- case G_LOG_LEVEL_DEBUG:
- pri = GCL_DEBUG;
- break;
-
- default:
- break;
- }
-
- gconf_log (pri, "%s", message);
-}
-
/* From ORBit2 */
/* There is a DOS attack if another user creates
* the given directory and keeps us from creating
@@ -597,8 +559,6 @@
#endif
CORBA_Environment ev;
CORBA_ORB orb;
- gchar* logname;
- const gchar* username;
gchar* ior;
int exit_code = 0;
GError *err;
@@ -646,27 +606,7 @@
gconf_set_daemon_mode(TRUE);
- /* Logs */
- username = g_get_user_name();
- logname = g_strdup_printf("gconfd (%s-%u)", username, (guint)getpid());
-
-#ifdef HAVE_SYSLOG_H
- openlog (logname, LOG_NDELAY, LOG_USER);
-#endif
-
- g_log_set_handler (NULL, G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION,
- log_handler, NULL);
-
- g_log_set_handler ("GLib", G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION,
- log_handler, NULL);
-
- g_log_set_handler ("GLib-GObject", G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION,
- log_handler, NULL);
-
- /* openlog() does not copy logname - what total brokenness.
- So we free it at the end of main() */
-
- gconf_log (GCL_INFO, _("starting (version %s), pid %u user '%s'"),
+ gconf_log (GCL_DEBUG, _("starting (version %s), pid %u user '%s'"),
VERSION, (guint)getpid(), g_get_user_name());
#ifdef GCONF_ENABLE_DEBUG
@@ -831,14 +771,7 @@
daemon_lock = NULL;
- gconf_log (GCL_INFO, _("Exiting"));
-
-#ifdef HAVE_SYSLOG_H
- closelog ();
-#endif
-
- /* Can't do this due to stupid atexit() handler that calls g_log stuff */
- /* g_free (logname); */
+ gconf_log (GCL_DEBUG, _("Exiting"));
return exit_code;
}
diff -Nur -x '*.orig' -x '*~' gconf-2.21.1/gconf/gconf-internals.c gconf-2.21.1.new/gconf/gconf-internals.c
--- gconf-2.21.1/gconf/gconf-internals.c 2008-01-08 15:28:59.000000000 +0100
+++ gconf-2.21.1.new/gconf/gconf-internals.c 2008-01-14 12:06:23.000000000 +0100
@@ -1096,105 +1096,46 @@
* Log
*/
-#ifdef HAVE_SYSLOG_H
-#include <syslog.h>
-#endif
-
void
gconf_log(GConfLogPriority pri, const gchar* fmt, ...)
{
- gchar* msg;
va_list args;
-#ifdef HAVE_SYSLOG_H
- gchar* convmsg;
- int syslog_pri = LOG_DEBUG;
-#endif
+ GLogLevelFlags loglevel;
if (!gconf_log_debug_messages &&
pri == GCL_DEBUG)
return;
-
- va_start (args, fmt);
- msg = g_strdup_vprintf(fmt, args);
- va_end (args);
-#ifdef HAVE_SYSLOG_H
- if (gconf_daemon_mode)
+ switch (pri)
{
- switch (pri)
- {
- case GCL_EMERG:
- syslog_pri = LOG_EMERG;
- break;
-
- case GCL_ALERT:
- syslog_pri = LOG_ALERT;
- break;
-
- case GCL_CRIT:
- syslog_pri = LOG_CRIT;
- break;
-
- case GCL_ERR:
- syslog_pri = LOG_ERR;
- break;
-
- case GCL_WARNING:
- syslog_pri = LOG_WARNING;
- break;
-
- case GCL_NOTICE:
- syslog_pri = LOG_NOTICE;
- break;
-
- case GCL_INFO:
- syslog_pri = LOG_INFO;
- break;
-
- case GCL_DEBUG:
- syslog_pri = LOG_DEBUG;
- break;
-
- default:
- g_assert_not_reached();
- break;
- }
-
- convmsg = g_locale_from_utf8 (msg, -1, NULL, NULL, NULL);
- if (!convmsg)
- syslog (syslog_pri, "%s", msg);
- else
- {
- syslog (syslog_pri, "%s", convmsg);
- g_free (convmsg);
- }
+ case GCL_EMERG:
+ case GCL_ALERT:
+ case GCL_CRIT:
+ loglevel = G_LOG_LEVEL_ERROR;
+ break;
+ case GCL_ERR:
+ loglevel = G_LOG_LEVEL_CRITICAL;
+ break;
+ case GCL_WARNING:
+ loglevel = G_LOG_LEVEL_WARNING;
+ break;
+ case GCL_NOTICE:
+ loglevel = G_LOG_LEVEL_MESSAGE;
+ break;
+ case GCL_INFO:
+ loglevel = G_LOG_LEVEL_INFO;
+ break;
+ case GCL_DEBUG:
+ loglevel = G_LOG_LEVEL_DEBUG;
+ break;
+ default:
+ g_assert_not_reached();
+ break;
}
- else
-#endif
- {
- switch (pri)
- {
- case GCL_EMERG:
- case GCL_ALERT:
- case GCL_CRIT:
- case GCL_ERR:
- case GCL_WARNING:
- g_printerr ("%s\n", msg);
- break;
-
- case GCL_NOTICE:
- case GCL_INFO:
- case GCL_DEBUG:
- g_print ("%s\n", msg);
- break;
- default:
- g_assert_not_reached();
- break;
- }
- }
-
- g_free(msg);
+ va_start (args, fmt);
+ g_logv (G_LOG_DOMAIN, loglevel, fmt, args);
+ va_end (args);
}
/*
diff -Nur -x '*.orig' -x '*~' gconf-2.21.1/gconf/gconf-sources.c gconf-2.21.1.new/gconf/gconf-sources.c
--- gconf-2.21.1/gconf/gconf-sources.c 2008-01-08 15:29:55.000000000 +0100
+++ gconf-2.21.1.new/gconf/gconf-sources.c 2008-01-14 12:06:52.000000000 +0100
@@ -407,20 +407,20 @@
if (source->flags & GCONF_SOURCE_ALL_WRITEABLE)
{
some_writable = TRUE;
- gconf_log (GCL_INFO,
+ gconf_log (GCL_DEBUG,
_("Resolved address \"%s\" to a writable configuration source at position %d"),
source->address, i);
}
else if (source->flags & GCONF_SOURCE_NEVER_WRITEABLE)
{
- gconf_log (GCL_INFO,
+ gconf_log (GCL_DEBUG,
_("Resolved address \"%s\" to a read-only configuration source at position %d"),
source->address, i);
}
else
{
some_writable = TRUE;
- gconf_log (GCL_INFO,
+ gconf_log (GCL_DEBUG,
_("Resolved address \"%s\" to a partially writable configuration source at position %d"),
source->address, i);
}

@ -1,107 +0,0 @@
diff -up GConf-2.22.0/backends/markup-backend.c.timeouts GConf-2.22.0/backends/markup-backend.c
--- GConf-2.22.0/backends/markup-backend.c.timeouts 2007-06-25 07:11:19.000000000 -0400
+++ GConf-2.22.0/backends/markup-backend.c 2008-05-14 09:33:04.000000000 -0400
@@ -59,7 +59,6 @@ typedef struct
{
GConfSource source; /* inherit from GConfSource */
char *root_dir;
- guint timeout_id;
GConfLock* lock;
MarkupTree *tree;
guint dir_mode;
@@ -875,21 +874,6 @@ gconf_backend_get_vtable (void)
* MarkupSource
*/
-/* This timeout periodically unloads
- * data that hasn't been used in a while.
- */
-static gboolean
-cleanup_timeout (gpointer data)
-{
-#if 0
- MarkupSource* ms = (MarkupSource*)data;
-
- cache_clean(ms->cache, 60*5 /* 5 minutes */);
-#endif
-
- return TRUE;
-}
-
static MarkupSource*
ms_new (const char* root_dir,
guint dir_mode,
@@ -903,10 +887,6 @@ ms_new (const char* root_dir,
ms = g_new0(MarkupSource, 1);
- ms->timeout_id = g_timeout_add (1000*60*5, /* 1 sec * 60 s/min * 5 min */
- cleanup_timeout,
- ms);
-
ms->root_dir = g_strdup (root_dir);
ms->lock = lock;
@@ -941,11 +921,6 @@ ms_destroy (MarkupSource* ms)
error = NULL;
}
- if (!g_source_remove (ms->timeout_id))
- {
- /* should not happen, don't translate */
- gconf_log (GCL_ERR, "timeout not found to remove?");
- }
markup_tree_unref (ms->tree);
diff -up GConf-2.22.0/gconf/gconf-database.c.timeouts GConf-2.22.0/gconf/gconf-database.c
--- GConf-2.22.0/gconf/gconf-database.c.timeouts 2008-01-08 09:28:38.000000000 -0500
+++ GConf-2.22.0/gconf/gconf-database.c 2008-05-14 09:29:17.000000000 -0400
@@ -1008,7 +1008,7 @@ gconf_database_schedule_sync(GConfDataba
else
{
/* 1 minute timeout */
- db->sync_timeout = g_timeout_add(60000, (GSourceFunc)gconf_database_sync_timeout, db);
+ db->sync_timeout = g_timeout_add_seconds(60, (GSourceFunc)gconf_database_sync_timeout, db);
}
}
diff -up GConf-2.22.0/gconf/gconfd.c.timeouts GConf-2.22.0/gconf/gconfd.c
--- GConf-2.22.0/gconf/gconfd.c.timeouts 2008-05-14 09:29:17.000000000 -0400
+++ GConf-2.22.0/gconf/gconfd.c 2008-05-14 09:29:17.000000000 -0400
@@ -910,12 +910,12 @@ gconf_main(void)
if (main_loops == NULL)
{
- gulong timeout_len = 1000*60*0.5; /* 1 sec * 60 s/min * .5 min */
+ gulong timeout_len = 60*0.5; /* 60 s/min * .5 min */
g_assert(timeout_id == 0);
- timeout_id = g_timeout_add (timeout_len,
- periodic_cleanup_timeout,
- NULL);
+ timeout_id = g_timeout_add_seconds (timeout_len,
+ periodic_cleanup_timeout,
+ NULL);
}
@@ -1449,14 +1449,14 @@ open_append_handle (GError **err)
{
- const gulong timeout_len = 1000*60*0.5; /* 1 sec * 60 s/min * 0.5 min */
+ const gulong timeout_len = 60*0.5; /* 60 s/min * 0.5 min */
if (append_handle_timeout != 0)
g_source_remove (append_handle_timeout);
- append_handle_timeout = g_timeout_add (timeout_len,
- close_append_handle_timeout,
- NULL);
+ append_handle_timeout = g_timeout_add_seconds (timeout_len,
+ close_append_handle_timeout,
+ NULL);
}
}

@ -1,19 +0,0 @@
Index: gconf/gconf-database.c
===================================================================
--- gconf/gconf-database.c (revision 2583)
+++ gconf/gconf-database.c (working copy)
@@ -1261,11 +1261,10 @@ gconf_database_notify_listeners (GConfDa
g_slist_free (closure.dead);
- if (notify_others)
+ if (modified_sources)
{
- g_return_if_fail (modified_sources != NULL);
-
- gconfd_notify_other_listeners (db, modified_sources, key);
+ if (notify_others)
+ gconfd_notify_other_listeners (db, modified_sources, key);
g_list_free (modified_sources->sources);
g_free (modified_sources);

@ -1 +1 @@
f0dc9a77c005c9beedd58d70e08cc194 GConf-2.23.1.tar.bz2
e43e125e4ee84205d5e9215d91c3229d GConf-2.23.2.tar.bz2

Loading…
Cancel
Save