All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dmitry V. Levin" <ldv@altlinux.org>
To: Linux console tools development discussion <kbd@lists.altlinux.org>
Subject: [kbd] [PATCH 1/2] vlock: move some code around
Date: Fri, 23 Jan 2015 20:47:55 +0300	[thread overview]
Message-ID: <20150123174755.GB9914@altlinux.org> (raw)
In-Reply-To: <20150123174626.GA9914@altlinux.org>

Move the code that handles PAM_MAXTRIES and PAM_ABORT cases before the
code that handles PAM_INCOMPLETE case.  This no-op change is only needed
to make the next change easier to read.
---
 src/vlock/auth.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/src/vlock/auth.c b/src/vlock/auth.c
index da135ce..dc47ee8 100644
--- a/src/vlock/auth.c
+++ b/src/vlock/auth.c
@@ -130,6 +130,19 @@ get_password (pam_handle_t * pamh, const char *username, const char *tty)
 					locked_name (), tty, username, uid);
 				return EXIT_SUCCESS;
 
+			case PAM_MAXTRIES:
+			case PAM_ABORT:
+				msg = pam_strerror (pamh, rc);
+				/* Log the fact of failure. */
+				syslog (LOG_WARNING, "%s", msg);
+				printf ("%s.\n\n\n", msg);
+				fflush (stdout);
+				msg = 0;
+				pam_end (pamh, rc);
+				pamh = 0;
+				sleep (LONG_DELAY);
+				break;
+
 			case PAM_INCOMPLETE:
 				/*
 				 * EOF encountered on read?
@@ -149,19 +162,6 @@ get_password (pam_handle_t * pamh, const char *username, const char *tty)
 					locked_name (), tty, username, uid);
 				return EXIT_FAILURE;
 
-			case PAM_MAXTRIES:
-			case PAM_ABORT:
-				msg = pam_strerror (pamh, rc);
-				/* Log the fact of failure. */
-				syslog (LOG_WARNING, "%s", msg);
-				printf ("%s.\n\n\n", msg);
-				fflush (stdout);
-				msg = 0;
-				pam_end (pamh, rc);
-				pamh = 0;
-				sleep (LONG_DELAY);
-				break;
-
 			default:
 				printf ("%s.\n\n\n", pam_strerror (pamh, rc));
 				fflush (stdout);
-- 
ldv


  reply	other threads:[~2015-01-23 17:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-26  5:42 [kbd] [PATCH] vlock: Handle tty dying Kyle Manna
2015-01-23 17:46 ` Dmitry V. Levin
2015-01-23 17:47   ` Dmitry V. Levin [this message]
2015-01-23 17:49   ` [kbd] [PATCH 2/2] vlock: handle disappearing ttys gracefully Dmitry V. Levin
2015-01-25 11:18   ` [kbd] [PATCH] vlock: Handle tty dying Alexey Gladkov

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=20150123174755.GB9914@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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.