LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File gdm-passwordless-login.patch of Package gdm (Project GNOME:Factory)

Index: gdm-3.6.1/common/gdm-settings-system-backend.c
===================================================================
--- gdm-3.6.1.orig/common/gdm-settings-system-backend.c
+++ gdm-3.6.1/common/gdm-settings-system-backend.c
@@ -43,11 +43,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)
  */
@@ -65,12 +65,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);
@@ -140,6 +142,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;
@@ -200,6 +212,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);
 
@@ -208,6 +226,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
@@ -275,6 +294,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-3.6.1/common/gdm-settings-keys.h
===================================================================
--- gdm-3.6.1.orig/common/gdm-settings-keys.h
+++ gdm-3.6.1/common/gdm-settings-keys.h
@@ -33,6 +33,7 @@ G_BEGIN_DECLS
 #define GDM_KEY_TIMED_LOGIN_USER "daemon/TimedLogin"
 #define GDM_KEY_TIMED_LOGIN_DELAY "daemon/TimedLoginDelay"
 #define GDM_KEY_INITIAL_SETUP_ENABLE "daemon/InitialSetupEnable"
+#define GDM_KEY_SUSE_PASSWORDLESS_LOGIN_ENABLE "daemon/SUSEPasswordlessEnable"
 
 #define GDM_KEY_DEBUG "debug/Enable"
 
Index: gdm-3.6.1/data/gdm.schemas.in.in
===================================================================
--- gdm-3.6.1.orig/data/gdm.schemas.in.in
+++ gdm-3.6.1/data/gdm.schemas.in.in
@@ -58,6 +58,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>
Index: gdm-3.6.1/daemon/gdm-session.c
===================================================================
--- gdm-3.6.1.orig/daemon/gdm-session.c
+++ gdm-3.6.1/daemon/gdm-session.c
@@ -55,6 +55,9 @@
 #include "gdm-session-worker-glue.h"
 #include "gdm-common.h"
 
+#include "gdm-settings-client.h"
+#include "gdm-settings-keys.h"
+
 #define GDM_SESSION_DBUS_ERROR_CANCEL "org.gnome.DisplayManager.Session.Error.Cancel"
 #define GDM_SESSION_DBUS_OBJECT_PATH "/org/gnome/DisplayManager/Session"
 
@@ -1228,6 +1231,15 @@ gdm_session_handle_client_begin_verifica
                                               GdmSession             *self)
 {
         GdmSessionConversation *conversation;
+        gboolean passwordless;
+
+        if (!gdm_settings_client_get_boolean (GDM_KEY_SUSE_PASSWORDLESS_LOGIN_ENABLE,
+                                              &passwordless)) {
+                passwordless = FALSE;
+        }
+
+        if (passwordless)
+                service_name = "gdm-autologin";
 
         conversation = begin_verification_conversation (self, invocation, service_name);