From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Fri, 23 Jan 2015 20:49:13 +0300 From: "Dmitry V. Levin" To: Linux console tools development discussion Message-ID: <20150123174913.GC9914@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 2/2] vlock: handle disappearing ttys gracefully 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:49:14 -0000 Archived-At: List-Archive: vlock used to check for disappearing ttys after PAM_INCOMPLETE error returned by pam_authenticate. This change extends the check to cover other non-fatal error codes that could be returned by pam_authenticate. Reported-by: Kyle Manna --- src/vlock/auth.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/vlock/auth.c b/src/vlock/auth.c index dc47ee8..eddce51 100644 --- a/src/vlock/auth.c +++ b/src/vlock/auth.c @@ -143,7 +143,9 @@ get_password (pam_handle_t * pamh, const char *username, const char *tty) sleep (LONG_DELAY); break; - case PAM_INCOMPLETE: + default: + printf ("%s.\n\n\n", pam_strerror (pamh, rc)); + fflush (stdout); /* * EOF encountered on read? * If not on VT, check stdin. @@ -161,11 +163,6 @@ get_password (pam_handle_t * pamh, const char *username, const char *tty) "Cancelled lock of %s on %s for %s by (uid=%u)", locked_name (), tty, username, uid); return EXIT_FAILURE; - - default: - printf ("%s.\n\n\n", pam_strerror (pamh, rc)); - fflush (stdout); - sleep (SHORT_DELAY); } } } -- ldv