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

Index: gdm-3.15.90.5/common/gdm-settings-system-backend.c
===================================================================
--- gdm-3.15.90.5.orig/common/gdm-settings-system-backend.c
+++ gdm-3.15.90.5/common/gdm-settings-system-backend.c
@@ -44,9 +44,9 @@
 #define SYSCONFIG_TCP_OPEN_KEY          "DISPLAYMANAGER_XSERVER_TCP_PORT_6000_OPEN"
 #define SYSCONFIG_XDMCP_KEY             "DISPLAYMANAGER_REMOTE_ACCESS"
 #define SYSCONFIG_STARTS_XSERVER_KEY    "DISPLAYMANAGER_STARTS_XSERVER"
+#define SYSCONFIG_PASSWORDLESS_KEY      "DISPLAYMANAGER_PASSWORD_LESS_LOGIN"
 /* Keys from sysconfig that have no equivalent in GDM:
  *   - DISPLAYMANAGER_ROOT_LOGIN_REMOTE
- *   - DISPLAYMANAGER_PASSWORD_LESS_LOGIN
  *   - DISPLAYMANAGER_AD_INTEGRATION
  *   - DISPLAYMANAGER_SHUTDOWN (handled by ConsoleKit)
  */
@@ -65,6 +65,7 @@ struct GdmSettingsSystemBackendPrivate
         gboolean    dirty_tcp_open;
         gboolean    dirty_xdmcp;
         gboolean    dirty_show_local_greeter;
+        gboolean    dirty_passwordless;
 
         gchar      *set_autologin_user;
         gboolean    set_autologin_enabled;
@@ -72,6 +73,7 @@ struct GdmSettingsSystemBackendPrivate
         gboolean    set_tcp_open;
         gboolean    set_xdmcp;
         gboolean    set_show_local_greeter;
+        gboolean    set_passwordless;
 };
 
 static void     gdm_settings_system_backend_class_init (GdmSettingsSystemBackendClass *klass);
@@ -151,6 +153,16 @@ gdm_settings_system_backend_get_value (G
                                 val = g_strdup (local_greeter ? "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;
@@ -217,6 +229,12 @@ save_settings (GdmSettingsSystemBackend
                                    backend->priv->set_show_local_greeter? "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);
 
@@ -226,6 +244,7 @@ save_settings (GdmSettingsSystemBackend
         backend->priv->dirty_tcp_open           = FALSE;
         backend->priv->dirty_xdmcp              = FALSE;
         backend->priv->dirty_show_local_greeter = FALSE;
+        backend->priv->dirty_passwordless       = FALSE;
 }
 
 static gboolean
@@ -296,6 +315,9 @@ gdm_settings_system_backend_set_value (G
         } else if (!strcasecmp (key, GDM_KEY_SHOW_LOCAL_GREETER)) {
                 priv->set_show_local_greeter = value_to_boolean (value);
                 GDM_SETTINGS_SYSTEM_BACKEND (backend)->priv->dirty_show_local_greeter = 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-3.15.90.5/common/gdm-settings-keys.h
===================================================================
--- gdm-3.15.90.5.orig/common/gdm-settings-keys.h
+++ gdm-3.15.90.5/common/gdm-settings-keys.h
@@ -34,6 +34,7 @@ G_BEGIN_DECLS
 #define GDM_KEY_TIMED_LOGIN_DELAY "daemon/TimedLoginDelay"
 #define GDM_KEY_INITIAL_SETUP_ENABLE "daemon/InitialSetupEnable"
 #define GDM_KEY_WAYLAND_ENABLE "daemon/WaylandEnable"
+#define GDM_KEY_SUSE_PASSWORDLESS_LOGIN_ENABLE "daemon/SUSEPasswordlessEnable"
 
 #define GDM_KEY_DEBUG "debug/Enable"
 
Index: gdm-3.15.90.5/data/gdm.schemas.in.in
===================================================================
--- gdm-3.15.90.5.orig/data/gdm.schemas.in.in
+++ gdm-3.15.90.5/data/gdm.schemas.in.in
@@ -68,6 +68,12 @@
       <signature>b</signature>
       <default>false</default>
     </schema>
+    <schema>
+      <!-- SUSE-specific -->
+      <key>daemon/SUSEPasswordlessEnable</key>
+      <signature>b</signature>
+      <default>false</default>
+    </schema>
 
     <schema>
       <key>security/DisallowTCP</key>
openSUSE Build Service is sponsored by