Linux console tools development discussion
 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 2/2] vlock: handle disappearing ttys gracefully
Date: Fri, 23 Jan 2015 20:49:13 +0300
Message-ID: <20150123174913.GC9914@altlinux.org> (raw)
In-Reply-To: <20150123174626.GA9914@altlinux.org>

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 <kyle@kylemanna.com>
---
 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


  parent reply	other threads:[~2015-01-23 17:49 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   ` [kbd] [PATCH 1/2] vlock: move some code around Dmitry V. Levin
2015-01-23 17:49   ` Dmitry V. Levin [this message]
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=20150123174913.GC9914@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