From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Fri, 23 Jan 2015 20:47:55 +0300 From: "Dmitry V. Levin" To: Linux console tools development discussion Message-ID: <20150123174755.GB9914@altlinux.org> References: <20140926054204.GH3701@kylemanna.com> <20150123174626.GA9914@altlinux.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150123174626.GA9914@altlinux.org> Subject: [kbd] [PATCH 1/2] vlock: move some code around X-BeenThere: kbd@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: Linux console tools development discussion List-Id: Linux console tools development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2015 17:47:55 -0000 Archived-At: List-Archive: 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