Hello community,

here is the log from the commit of package lightdm for openSUSE:Factory checked 
in at 2017-07-05 23:56:33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/lightdm (Old)
 and      /work/SRC/openSUSE:Factory/.lightdm.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "lightdm"

Wed Jul  5 23:56:33 2017 rev:92 rq:508262 version:1.22.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/lightdm/lightdm.changes  2017-05-22 
10:46:42.739435503 +0200
+++ /work/SRC/openSUSE:Factory/.lightdm.new/lightdm.changes     2017-07-05 
23:56:34.180027119 +0200
@@ -1,0 +2,7 @@
+Tue Jul  4 13:24:10 UTC 2017 - [email protected]
+
+- Augment patch to also resolve the target of symlink sessions
+  for detemining the preselected option:
+  * ignore-known-symlink-sessions.patch
+
+-------------------------------------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ignore-known-symlink-sessions.patch ++++++
--- /var/tmp/diff_new_pack.gDzIOy/_old  2017-07-05 23:56:34.779942611 +0200
+++ /var/tmp/diff_new_pack.gDzIOy/_new  2017-07-05 23:56:34.779942611 +0200
@@ -5,6 +5,11 @@
 If a session file is a symlink that points into the currently
 searched directory, ignore it.
 
+Special take needs to be taken care to map the default-session
+hint passed to the greeter correctly. As symlinked sessions
+are not available anymore, the target of those needs to be
+passed as session name instead.
+
 Index: lightdm-1.22.0/liblightdm-gobject/session.c
 ===================================================================
 --- lightdm-1.22.0.orig/liblightdm-gobject/session.c
@@ -44,3 +49,107 @@
          key_file = g_key_file_new ();
          result = g_key_file_load_from_file (key_file, path, G_KEY_FILE_NONE, 
&error);
          if (error)
+Index: lightdm-1.22.0/src/seat.c
+===================================================================
+--- lightdm-1.22.0.orig/src/seat.c
++++ lightdm-1.22.0/src/seat.c
+@@ -9,6 +9,8 @@
+  * license.
+  */
+ 
++#define _GNU_SOURCE
++#include <libgen.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <sys/wait.h>
+@@ -544,11 +546,89 @@ find_resettable_greeter (Seat *seat)
+     return NULL;
+ }
+ 
++/* Returns basename of the .desktop file at the specified path.
++ * Returned string needs to be g_free'd. */
++static gchar *
++desktop_basename (const gchar *path)
++{
++    if (!path)
++        return NULL;
++
++    gchar *filename = g_path_get_basename (path);
++    if (!filename)
++        return NULL;
++
++    unsigned int len = strlen(filename);
++    if (len >= 8) /* strlen(".desktop") */
++        filename[len - 8] = '\0';
++
++    return filename;
++}
++
++static gchar *
++find_session_file (Seat *seat, const gchar *sessions_dir, const gchar 
*session_name)
++{
++    gchar **dirs;
++    gchar *ret_path = NULL;
++    int i;
++
++    g_return_val_if_fail (sessions_dir != NULL, NULL);
++    g_return_val_if_fail (session_name != NULL, NULL);
++
++    dirs = g_strsplit (sessions_dir, ":", -1);
++    for (i = 0; dirs[i]; i++)
++    {
++        gchar *filename, *path;
++
++        filename = g_strdup_printf ("%s.desktop", session_name);
++        path = g_build_filename (dirs[i], filename, NULL);
++        g_free (filename);
++        if (g_file_test (path, G_FILE_TEST_EXISTS))
++        {
++            ret_path = path;
++            break;
++        }
++        else
++            g_free (path);
++    }
++    g_strfreev (dirs);
++
++    return ret_path;
++}
++
+ static void
+ set_greeter_hints (Seat *seat, Greeter *greeter)
+ {
+     greeter_clear_hints (greeter);
+-    greeter_set_hint (greeter, "default-session", seat_get_string_property 
(seat, "user-session"));
++
++    /* The user-session might be a symlink to the actual default-session. */
++    const gchar *user_session = seat_get_string_property (seat, 
"user-session");
++    gchar *default_session = NULL;
++
++    const gchar *sessions_dir = config_get_string (config_get_instance (), 
"LightDM", "sessions-directory");
++    gchar *user_session_path = find_session_file (seat, sessions_dir, 
user_session);
++    if (g_file_test (user_session_path, G_FILE_TEST_IS_SYMLINK))
++    {
++        char *ltarget = canonicalize_file_name ((char*) user_session_path);
++
++        /* TODO: Check that the link target points into a valid session_dir. 
*/
++
++        if (g_str_has_suffix (ltarget, ".desktop"))
++            default_session = desktop_basename (ltarget);
++
++        free(ltarget);
++    }
++
++    g_free(user_session_path);
++
++    if (default_session)
++    {
++        greeter_set_hint (greeter, "default-session", default_session);
++        g_free (default_session);
++    }
++    else
++        greeter_set_hint (greeter, "default-session", user_session);
++
+     greeter_set_hint (greeter, "hide-users", seat_get_boolean_property (seat, 
"greeter-hide-users") ? "true" : "false");
+     greeter_set_hint (greeter, "show-manual-login", seat_get_boolean_property 
(seat, "greeter-show-manual-login") ? "true" : "false");
+     greeter_set_hint (greeter, "show-remote-login", seat_get_boolean_property 
(seat, "greeter-show-remote-login") ? "true" : "false");



Reply via email to