Hello everybody,

some time ago support was added to handles multiple lines for a single user.
This works only if the (two factor) password is identical.

The attached patch makes liboath try other configurations for the same user
if status is OATH_BAD_PASSWORD. Hope this is correct.
-- 
Schoene Gruesse
Chris
                         O< ascii ribbon campaign
                   stop html mail - www.asciiribbon.org
--- liboath/usersfile.c~	2013-01-07 10:50:37.962189953 +0100
+++ liboath/usersfile.c	2013-01-07 11:54:11.937649857 +0100
@@ -95,7 +95,7 @@ parse_usersfile (const char *username,
       char secret[32];
       size_t secret_length = sizeof (secret);
       uint64_t start_moving_factor = 0;
-      int rc;
+      int rc = 0;
       char *prev_otp = NULL;
 
       if (p == NULL)
@@ -116,13 +116,18 @@ parse_usersfile (const char *username,
 	{
 	  if (p == NULL)
 	    continue;
 	  if (strcmp (p, "-") == 0)
 	    {
 	      if (*passwd != '\0')
-		return OATH_BAD_PASSWORD;
+		rc = OATH_BAD_PASSWORD;
 	    }
 	  else if (strcmp (p, passwd) != 0)
-	    return OATH_BAD_PASSWORD;
+	    rc = OATH_BAD_PASSWORD;
+	  if (rc == OATH_BAD_PASSWORD)
+	    {
+	      (*skipped_users)++;
+	      continue;
+	    }
 	}
 
       /* Read key. */

Reply via email to