gconf-3.2.6-mconvert-crasher.patch 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. From 98ff7acca7595f508b094506195aeffaf2e8b74c Mon Sep 17 00:00:00 2001
  2. From: Stefan Sauer <ensonic@users.sf.net>
  3. Date: Wed, 23 Jan 2013 08:11:18 +0100
  4. Subject: mconvert: enable recursive scheme lookup and fix a crasher
  5. The recursive scheme lookup is needed to scan the whole settings path. The crash
  6. would happen in the case of a misconfiguration (e.g. building gconf from source
  7. and running uninstalled while the configure settings don't match the one used to
  8. create the installed package).
  9. diff --git a/gsettings/gsettings-data-convert.c b/gsettings/gsettings-data-convert.c
  10. index a8af942..9b2d1d0 100644
  11. --- a/gsettings/gsettings-data-convert.c
  12. +++ b/gsettings/gsettings-data-convert.c
  13. @@ -22,6 +22,7 @@
  14. #include <string.h>
  15. #include <sys/types.h>
  16. #include <sys/stat.h>
  17. +#include <stdlib.h>
  18. #include <unistd.h>
  19. #include <errno.h>
  20. @@ -90,6 +91,10 @@ get_writable_client (void)
  21. GSList *addresses;
  22. addresses = get_writable_source_path ();
  23. + if (!addresses) {
  24. + g_printf("No writable gconf locations found\n");
  25. + exit (1);
  26. + }
  27. engine = gconf_engine_get_local_for_addresses (addresses, NULL);
  28. gconf_address_list_free (addresses);
  29. @@ -155,7 +160,7 @@ handle_file (const gchar *filename)
  30. schema_path = g_strsplit (groups[i], ":", 2);
  31. - schema = g_settings_schema_source_lookup (source, schema_path[0], FALSE);
  32. + schema = g_settings_schema_source_lookup (source, schema_path[0], TRUE);
  33. if (schema == NULL)
  34. {
  35. if (verbose)
  36. --
  37. cgit v0.10.1