[Fingerforce-commits] [fprintd] 07/08: Replace our 'max_tries and timeout' patch with the cleaned version accepted by upstream
Didier Raboud
odyx at alioth.debian.org
Sun Sep 29 12:39:05 UTC 2013
This is an automated email from the git hooks/post-receive script.
odyx pushed a commit to branch debian
in repository fprintd.
commit 858621553fb4bdc319d7d6325bf8eac801bbe3cc
Author: Didier Raboud <odyx at debian.org>
Date: Sat May 18 17:39:58 2013 +0200
Replace our 'max_tries and timeout' patch with the cleaned version accepted by upstream
---
debian/patches/series | 5 +-
...pam_Make_max_tries_and_timeout_arguments.patch} | 51 ++++++++++++--------
2 files changed, 35 insertions(+), 21 deletions(-)
diff --git a/debian/patches/series b/debian/patches/series
index 7696adf..b795511 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,5 @@
+# Upstream patches
+u9c99e5c_pam_Make_max_tries_and_timeout_arguments.patch
+
+# Debian patches
0_put_fprint_daemon_in_sbin.patch
-1_pam_Make_max_tries_and_timeout_arguments.patch
diff --git a/debian/patches/1_pam_Make_max_tries_and_timeout_arguments.patch b/debian/patches/u9c99e5c_pam_Make_max_tries_and_timeout_arguments.patch
similarity index 53%
rename from debian/patches/1_pam_Make_max_tries_and_timeout_arguments.patch
rename to debian/patches/u9c99e5c_pam_Make_max_tries_and_timeout_arguments.patch
index fea6c89..f6afd1c 100644
--- a/debian/patches/1_pam_Make_max_tries_and_timeout_arguments.patch
+++ b/debian/patches/u9c99e5c_pam_Make_max_tries_and_timeout_arguments.patch
@@ -1,18 +1,26 @@
-From 00a14d873ba92dfaf90fe82cd6d0c8f7e6cc0744 Mon Sep 17 00:00:00 2001
+From 9c99e5cd59fc942ea0d5f5d1263424eaf78c27b4 Mon Sep 17 00:00:00 2001
From: Didier Raboud <odyx at debian.org>
Date: Mon, 14 May 2012 17:29:56 +0200
Subject: [PATCH] pam: Make max_tries and timeout arguments.
-Forwarded: https://bugs.freedesktop.org/show_bug.cgi?id=49918
+https://bugs.freedesktop.org/show_bug.cgi?id=49918
---
- pam/pam_fprintd.c | 30 +++++++++++++++++++++++-------
- 1 files changed, 23 insertions(+), 7 deletions(-)
+ pam/pam_fprintd.c | 34 +++++++++++++++++++++++++++-------
+ 1 files changed, 27 insertions(+), 7 deletions(-)
diff --git a/pam/pam_fprintd.c b/pam/pam_fprintd.c
-index 52fce32..1b38c2c 100644
+index 52fce32..7e1f954 100644
--- a/pam/pam_fprintd.c
+++ b/pam/pam_fprintd.c
-@@ -39,8 +39,8 @@
+@@ -21,6 +21,7 @@
+ #include <config.h>
+
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <unistd.h>
+ #include <sys/types.h>
+ #include <string.h>
+@@ -39,8 +40,11 @@
#include "fingerprint-strings.h"
@@ -20,10 +28,13 @@ index 52fce32..1b38c2c 100644
-#define TIMEOUT 30
+#define DEFAULT_MAX_TRIES 3
+#define DEFAULT_TIMEOUT 30
++
++#define MAX_TRIES_MATCH "max-tries="
++#define TIMEOUT_MATCH "timeout="
#define D(pamh, ...) { \
if (debug) { \
-@@ -53,6 +53,8 @@
+@@ -53,6 +57,8 @@
static gboolean debug = FALSE;
@@ -32,7 +43,7 @@ index 52fce32..1b38c2c 100644
static gboolean send_info_msg(pam_handle_t *pamh, const char *msg)
{
-@@ -271,7 +273,7 @@ static int do_verify(GMainLoop *loop, pam_handle_t *pamh, DBusGProxy *dev, gbool
+@@ -271,7 +277,7 @@ static int do_verify(GMainLoop *loop, pam_handle_t *pamh, DBusGProxy *dev, gbool
int ret;
data = g_new0 (verify_data, 1);
@@ -41,7 +52,7 @@ index 52fce32..1b38c2c 100644
data->pamh = pamh;
data->loop = loop;
-@@ -304,7 +306,7 @@ static int do_verify(GMainLoop *loop, pam_handle_t *pamh, DBusGProxy *dev, gbool
+@@ -304,7 +310,7 @@ static int do_verify(GMainLoop *loop, pam_handle_t *pamh, DBusGProxy *dev, gbool
GSource *source;
/* Set up the timeout on our non-default context */
@@ -50,7 +61,7 @@ index 52fce32..1b38c2c 100644
g_source_attach (source, g_main_loop_get_context (loop));
g_source_set_callback (source, verify_timeout_cb, data, NULL);
-@@ -429,9 +431,23 @@ PAM_EXTERN int pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc,
+@@ -429,9 +435,23 @@ PAM_EXTERN int pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc,
return PAM_AUTHINFO_UNAVAIL;
for (i = 0; i < argc; i++) {
@@ -62,17 +73,17 @@ index 52fce32..1b38c2c 100644
+ g_message ("debug on");
+ debug = TRUE;
+ }
-+ else if (strncmp(argv[i], "max_tries=", 10) == 0 && strlen(argv[i]) == 11){
-+ char max_tries_l[1];
-+ strncpy(max_tries_l,argv[i] + 10,1);
-+ sscanf(max_tries_l,"%d", &max_tries);
-+ D(pamh, "max_tries specified as: %d",max_tries);
++ else if (strncmp(argv[i], MAX_TRIES_MATCH, strlen (MAX_TRIES_MATCH)) == 0 && strlen(argv[i]) == strlen (MAX_TRIES_MATCH) + 1) {
++ max_tries = atoi (argv[i] + strlen (MAX_TRIES_MATCH));
++ if (max_tries < 1)
++ max_tries = DEFAULT_MAX_TRIES;
++ D(pamh, "max_tries specified as: %d", max_tries);
+ }
-+ else if (strncmp(argv[i], "timeout=", 8) == 0 && strlen(argv[i]) <= 10){
-+ char timeout_l[2];
-+ strncpy(timeout_l,argv[i] + 8,strlen(argv[i]) - 8);
-+ sscanf(timeout_l,"%d", &timeout);
-+ D(pamh, "timeout specified as: %d",timeout);
++ else if (strncmp(argv[i], TIMEOUT_MATCH, strlen (TIMEOUT_MATCH)) == 0 && strlen(argv[i]) <= strlen (TIMEOUT_MATCH) + 2) {
++ timeout = atoi (argv[i] + strlen (TIMEOUT_MATCH));
++ if (timeout < 10)
++ timeout = DEFAULT_TIMEOUT;
++ D(pamh, "timeout specified as: %d", timeout);
+ }
}
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/fingerforce/fprintd.git
More information about the Fingerforce-commits
mailing list