File gdm-passwordless-login.patch of Package gdm.import4636

Index: gdm-2.32.0/common/gdm-settings-system-backend.c
===================================================================
--- gdm-2.32.0.orig/common/gdm-settings-system-backend.c
+++ gdm-2.32.0/common/gdm-settings-system-backend.c
@@ -44,11 +44,11 @@
 #define SYSCONFIG_AUTOLOGIN_KEY		"DISPLAYMANAGER_AUTOLOGIN"
 #define SYSCONFIG_TCP_OPEN_KEY		"DISPLAYMANAGER_XSERVER_TCP_PORT_6000_OPEN"
 #define SYSCONFIG_XDMCP_KEY		"DISPLAYMANAGER_REMOTE_ACCESS"
+#define SYSCONFIG_PASSWORDLESS_KEY	"DISPLAYMANAGER_PASSWORD_LESS_LOGIN"
 /* Keys from sysconfig that have no equivalent in GDM:
  *   - DISPLAYMANAGER_ROOT_LOGIN_REMOTE
  *   - DISPLAYMANAGER_STARTS_XSERVER (we always have a local display manager,
  *     see gdm_manager_constructor())
- *   - DISPLAYMANAGER_PASSWORD_LESS_LOGIN
  *   - DISPLAYMANAGER_AD_INTEGRATION
  *   - DISPLAYMANAGER_SHUTDOWN (handled by ConsoleKit)
  */
@@ -66,12 +66,14 @@ struct GdmSettingsSystemBackendPrivate
         gboolean    dirty_autologin_user;
         gboolean    dirty_tcp_open;
         gboolean    dirty_xdmcp;
+        gboolean    dirty_passwordless;
 
         gchar      *set_autologin_user;
         gboolean    set_autologin_enabled;
 
         gboolean    set_tcp_open;
         gboolean    set_xdmcp;
+        gboolean    set_passwordless;
 };
 
 static void     gdm_settings_system_backend_class_init (GdmSettingsSystemBackendClass *klass);
@@ -141,6 +143,16 @@ gdm_settings_system_backend_get_value (G
                                 val = g_strdup (xdmcp ? "true" : "false");
                         }
                 }
+        } else if (!strcasecmp (key, GDM_KEY_SUSE_PASSWORDLESS_LOGIN_ENABLE)) {
+                if (priv->dirty_passwordless) {
+                        val = g_strdup (priv->set_passwordless ? "true" : "false");
+                } else {
+                        gboolean passwordless;
+
+                        if (gdm_sysconfig_get_value_boolean ((const gchar **) priv->lines, SYSCONFIG_PASSWORDLESS_KEY, &passwordless)) {
+                                val = g_strdup (passwordless ? "true" : "false");
+                        }
+                }
         } else {
                 g_set_error (error, GDM_SETTINGS_BACKEND_ERROR, GDM_SETTINGS_BACKEND_ERROR_KEY_NOT_FOUND, "Key not found");
                 goto out;
@@ -201,6 +213,12 @@ save_settings (GdmSettingsSystemBackend
                                    backend->priv->set_xdmcp ? "yes" : "no");
         }
 
+        if (backend->priv->dirty_passwordless) {
+                if (!gdm_sysconfig_set_value_boolean (backend->priv->lines, SYSCONFIG_PASSWORDLESS_KEY, backend->priv->set_passwordless))
+                        g_warning ("Unable to set key %s to '%s'.", SYSCONFIG_PASSWORDLESS_KEY,
+                                   backend->priv->set_passwordless ? "yes" : "no");
+        }
+
         if (!gdm_sysconfig_save_file (backend->priv->filename, backend->priv->lines))
                 g_warning ("Unable to save settings to %s.", backend->priv->filename);
 
@@ -209,6 +227,7 @@ save_settings (GdmSettingsSystemBackend
         backend->priv->dirty_autologin_user = FALSE;
         backend->priv->dirty_tcp_open       = FALSE;
         backend->priv->dirty_xdmcp          = FALSE;
+        backend->priv->dirty_passwordless   = FALSE;
 }
 
 static gboolean
@@ -276,6 +295,9 @@ gdm_settings_system_backend_set_value (G
         } else if (!strcasecmp (key, GDM_KEY_XDMCP_ENABLE)) {
                 priv->set_xdmcp = value_to_boolean (value);
                 GDM_SETTINGS_SYSTEM_BACKEND (backend)->priv->dirty_xdmcp = TRUE;
+        } else if (!strcasecmp (key, GDM_KEY_SUSE_PASSWORDLESS_LOGIN_ENABLE)) {
+                priv->set_passwordless = value_to_boolean (value);
+                GDM_SETTINGS_SYSTEM_BACKEND (backend)->priv->dirty_passwordless = TRUE;
         } else {
                 g_set_error (error, GDM_SETTINGS_BACKEND_ERROR, GDM_SETTINGS_BACKEND_ERROR_KEY_NOT_FOUND, "Key not found");
                 return FALSE;
Index: gdm-2.32.0/common/gdm-settings-keys.h
===================================================================
--- gdm-2.32.0.orig/common/gdm-settings-keys.h
+++ gdm-2.32.0/common/gdm-settings-keys.h
@@ -32,6 +32,7 @@ G_BEGIN_DECLS
 #define GDM_KEY_TIMED_LOGIN_ENABLE "daemon/TimedLoginEnable"
 #define GDM_KEY_TIMED_LOGIN_USER "daemon/TimedLogin"
 #define GDM_KEY_TIMED_LOGIN_DELAY "daemon/TimedLoginDelay"
+#define GDM_KEY_SUSE_PASSWORDLESS_LOGIN_ENABLE "daemon/SUSEPasswordlessEnable"
 
 #define GDM_KEY_DEBUG "debug/Enable"
 
Index: gdm-2.32.0/data/gdm.schemas.in.in
===================================================================
--- gdm-2.32.0.orig/data/gdm.schemas.in.in
+++ gdm-2.32.0/data/gdm.schemas.in.in
@@ -47,6 +47,12 @@
       <signature>i</signature>
       <default>30</default>
     </schema>
+    <schema>
+      <!-- SUSE-specific -->
+      <key>daemon/SUSEPasswordlessEnable</key>
+      <signature>b</signature>
+      <default>false</default>
+    </schema>
 
     <schema>
       <key>debug/Enable</key>
Index: gdm-2.32.0/daemon/gdm-factory-slave.c
===================================================================
--- gdm-2.32.0.orig/daemon/gdm-factory-slave.c
+++ gdm-2.32.0/daemon/gdm-factory-slave.c
@@ -44,6 +44,9 @@
 
 #include "gdm-common.h"
 
+#include "gdm-settings-client.h"
+#include "gdm-settings-keys.h"
+
 #include "gdm-factory-slave.h"
 #include "gdm-factory-slave-glue.h"
 
@@ -406,9 +409,16 @@ on_greeter_begin_verification_for_user (
                                         const char       *username,
                                         GdmFactorySlave  *slave)
 {
+        gboolean passwordless;
+
+        if (!gdm_settings_client_get_boolean (GDM_KEY_SUSE_PASSWORDLESS_LOGIN_ENABLE,
+                                              &passwordless)) {
+                passwordless = FALSE;
+        }
+
         g_debug ("GdmFactorySlave: begin verification for user");
         gdm_session_setup_for_user (GDM_SESSION (slave->priv->session),
-                                    "gdm",
+                                    passwordless ? "gdm-autologin" : "gdm",
                                     username);
 }
 
Index: gdm-2.32.0/daemon/gdm-simple-slave.c
===================================================================
--- gdm-2.32.0.orig/daemon/gdm-simple-slave.c
+++ gdm-2.32.0/daemon/gdm-simple-slave.c
@@ -837,9 +837,16 @@ on_greeter_begin_verification_for_user (
                                         const char       *username,
                                         GdmSimpleSlave   *slave)
 {
+        gboolean passwordless;
+
+        if (!gdm_settings_client_get_boolean (GDM_KEY_SUSE_PASSWORDLESS_LOGIN_ENABLE,
+                                              &passwordless)) {
+                passwordless = FALSE;
+        }
+
         g_debug ("GdmSimpleSlave: begin verification");
         gdm_session_setup_for_user (GDM_SESSION (slave->priv->session),
-                                    "gdm",
+                                    passwordless ? "gdm-autologin" : "gdm",
                                     username);
 }
openSUSE Build Service is sponsored by