Adding 17-follow-symlink.patch to follow symlink on config save (Closes: #810632).
authorAndriy Grytsenko <andrej@rep.kiev.ua>
Fri, 11 Nov 2016 21:35:10 +0000 (23:35 +0200)
committerAndriy Grytsenko <andrej@rep.kiev.ua>
Fri, 11 Nov 2016 21:35:10 +0000 (23:35 +0200)
debian/patches/17-follow-symlink.patch [new file with mode: 0644]
debian/patches/series

diff --git a/debian/patches/17-follow-symlink.patch b/debian/patches/17-follow-symlink.patch
new file mode 100644 (file)
index 0000000..52dac5a
--- /dev/null
@@ -0,0 +1,22 @@
+Description: follow symlink on configuration update, see bug #810632
+Author: Julien Lavergne <gilir@ubuntu.com>
+Bug: https://sourceforge.net/p/lxde/bugs/223/
+
+--- a/src/lxdm.c
++++ b/src/lxdm.c
+@@ -1262,7 +1262,14 @@
+         char* data = g_key_file_to_data(var, &len, NULL);
+               mkdir("/var/lib/lxdm",0755);
+               chmod("/var/lib/lxdm",0755);
+-        g_file_set_contents(VCONFIG_FILE, data, len, NULL);
++              if( g_file_test(VCONFIG_FILE, G_FILE_TEST_IS_SYMLINK) )
++              {
++                      gchar* config_file = g_file_read_link(VCONFIG_FILE, NULL);
++                      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(var);
index 6ccb289..49a94bd 100644 (file)
@@ -1,4 +1,5 @@
 15-path-replace.patch
+17-follow-symlink.patch
 22_ubuntu_i18n_oneiric.patch
 23_debian-config.patch
 41-force-reset.patch