17-follow-symlink.patch: Follow symlink instead of saving the configuration file...
authorJulien Lavergne <julien.lavergne@gmail.com>
Sat, 22 May 2010 19:02:18 +0000 (21:02 +0200)
committerJulien Lavergne <julien.lavergne@gmail.com>
Sat, 22 May 2010 19:02:18 +0000 (21:02 +0200)
debian/changelog
debian/patches/17-follow-symlink.patch [new file with mode: 0644]
debian/patches/series

index 3052493..72f4f14 100644 (file)
@@ -17,6 +17,8 @@ lxdm (0.2.0-3) UNRELEASED; urgency=low
    - Add LDFLAGS = -Wl,-z,defs -Wl,-O2 -Wl,--as-needed
   * debian/patches/
    - 15-path-replace.patch : don't let lxdm replace PATH. (LP: #524761)
+   - 17-follow-symlink.patch: Follow symlink instead of saving the
+     configuration file on a symlink.
   
 
  -- Julien Lavergne <gilir@ubuntu.com>  Sat, 22 May 2010 18:40:10 +0200
diff --git a/debian/patches/17-follow-symlink.patch b/debian/patches/17-follow-symlink.patch
new file mode 100644 (file)
index 0000000..2c9dc4c
--- /dev/null
@@ -0,0 +1,27 @@
+Index: lxdm/src/greeter.c
+===================================================================
+--- lxdm.orig/src/greeter.c    2010-04-13 00:37:34.000000000 +0200
++++ lxdm/src/greeter.c 2010-04-13 00:48:35.000000000 +0200
+@@ -781,8 +781,21 @@
+     if( config_changed )
+     {
+         gsize len;
++      gchar* config_file;
++      GError **error;
++
+         char* data = g_key_file_to_data(var_config, &len, NULL);
+-        g_file_set_contents(VCONFIG_FILE, data, len, NULL);
++      if( g_file_test(VCONFIG_FILE, G_FILE_TEST_IS_SYMLINK) )
++      {
++              config_file = g_file_read_link(VCONFIG_FILE, error);
++              g_file_set_contents(config_file, data, len, NULL);
++              g_free(config_file);
++
++      }
++      else
++      {
++              g_file_set_contents(VCONFIG_FILE, data, len, NULL);
++      }
+         g_free(data);
+     }
+     g_key_file_free(config);
index e8632c8..bbcedeb 100644 (file)
@@ -1,3 +1,4 @@
 #stderr_stdout_to_log.patch 
 lxdm.conf_greeter_path_fix.patch
 15-path-replace.patch
+17-follow-symlink.patch