Linux console tools development discussion
 help / color / mirror / Atom feed
From: "Dmitry V. Levin" <ldv@altlinux.org>
To: kbd@lists.altlinux.org
Subject: [kbd] [PATCH 2/3] vlock: rename ERROR_TIMEOUT macro to LONG_DELAY
Date: Mon, 25 Nov 2013 01:48:24 +0400
Message-ID: <20131124214823.GB20405@altlinux.org> (raw)

The name ERROR_TIMEOUT is somewhat misleading: PAM errors may vary,
and some may require longer delays than others.  Since ERROR_TIMEOUT
means longer delay, rename it to LONG_DELAY.
---
 src/vlock/auth.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/vlock/auth.c b/src/vlock/auth.c
index cac877c..76945c0 100644
--- a/src/vlock/auth.c
+++ b/src/vlock/auth.c
@@ -33,8 +33,8 @@
 #include "vlock.h"
 #include "nls.h"
 
-/* Unrecognized PAM error timeout. */
-#define	ERROR_TIMEOUT	10
+/* Delay after fatal PAM errors, in seconds. */
+#define	LONG_DELAY	10
 
 static int
 do_account_password_management (pam_handle_t *pamh)
@@ -76,7 +76,7 @@ get_password (pam_handle_t * pamh, const char *username, const char *tty)
 					tty, username, uid);
 				puts (_("Please try again later.\n\n\n"));
 				fflush (stdout);
-				sleep (ERROR_TIMEOUT);
+				sleep (LONG_DELAY);
 				continue;
 			}
 		}
@@ -156,7 +156,7 @@ get_password (pam_handle_t * pamh, const char *username, const char *tty)
 				msg = 0;
 				pam_end (pamh, rc);
 				pamh = 0;
-				sleep (ERROR_TIMEOUT);
+				sleep (LONG_DELAY);
 				break;
 
 			default:


-- 
ldv


                 reply	other threads:[~2013-11-24 21:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131124214823.GB20405@altlinux.org \
    --to=ldv@altlinux.org \
    --cc=kbd@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux console tools development discussion

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/kbd/0 kbd/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kbd kbd/ http://lore.altlinux.org/kbd \
		kbd@lists.altlinux.org kbd@lists.altlinux.ru kbd@lists.altlinux.com
	public-inbox-index kbd

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.kbd


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git