[gdm/multi-stack: 42/45] add lame check to see if fingerprint is enabled
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdm/multi-stack: 42/45] add lame check to see if fingerprint is enabled
- Date: Tue, 27 Apr 2010 19:44:43 +0000 (UTC)
commit baa7dae65b1de218bc3f95f19e1727458cf3619d
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]