[gdm/multi-stack: 47/49] add lame check to see if fingerprint is enabled



commit 8bcb4b752b8d8efb62f9d4560de8076fbf2ed4bb
Author: Ray Strode <rstrode redhat com>
Date:   Thu Oct 29 00:39:20 2009 -0400

    add lame check to see if fingerprint is enabled

 .../fingerprint/gdm-fingerprint-extension.c        |   35 +++++++++++++++++++-
 1 files changed, 34 insertions(+), 1 deletions(-)
---
diff --git a/gui/simple-greeter/plugins/fingerprint/gdm-fingerprint-extension.c b/gui/simple-greeter/plugins/fingerprint/gdm-fingerprint-extension.c
index e1fc0ed..b749ac1 100644
--- a/gui/simple-greeter/plugins/fingerprint/gdm-fingerprint-extension.c
+++ b/gui/simple-greeter/plugins/fingerprint/gdm-fingerprint-extension.c
@@ -197,7 +197,40 @@ gdm_fingerprint_extension_is_choosable (GdmTask *task)
 gboolean
 gdm_fingerprint_extension_is_visible (GdmTask *task)
 {
-        return TRUE;
+        char *contents, **lines;
+        gboolean ret;
+        guint i;
+
+        /* Stolen from gnome-about-me.
+         *
+         * FIXME: We should fix pam_fprintd to return authinfo_unavail instead of
+         * doing this distro specific hack.
+         */
+
+        if (g_file_get_contents ("/etc/sysconfig/authconfig",
+                                 &contents, NULL, NULL) == FALSE)
+                return FALSE;
+
+        lines = g_strsplit (contents, "\n", -1);
+        g_free (contents);
+
+        ret = FALSE;
+
+        for (i = 0; lines[i] ; i++) {
+                if (g_str_has_prefix (lines[i], "USEFPRINTD=") != FALSE) {
+                        char *value;
+
+                        value = lines[i] + strlen ("USEFPRINTD=");
+                        if (g_strcmp0 (value, "yes") == 0) {
+                                ret = TRUE;
+                                break;
+                        }
+                }
+        }
+
+        g_strfreev (lines);
+
+        return ret;
 }
 
 static void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]