Linux console tools development discussion
 help / color / mirror / Atom feed
From: Vladimir Lomov <>
Subject: [kbd] [Enhancement] Add hostname to message on locked screen
Date: Thu, 1 Jun 2017 22:54:47 +0800
Message-ID: <> (raw)

[-- Attachment #1: Type: text/plain, Size: 417 bytes --]


I'd like to propose small enhancement: to add to the message on locked
screen information about current host. May be it is worth to store the
same information in syslog, I don't have any opinion.

I attached small patch that works (basically) on my system (Archlinux

WBR, Vladimir Lomov

I can give you my word, but I know what it's worth and you don't.
		-- Nero Wolfe, "Over My Dead Body"

[-- Attachment #2: kbd-vlock.patch --]
[-- Type: text/x-diff, Size: 829 bytes --]

diff --git a/src/vlock/auth.c b/src/vlock/auth.c
index 25efb5e..f0200eb 100644
--- a/src/vlock/auth.c
+++ b/src/vlock/auth.c
@@ -60,6 +60,7 @@ do_account_password_management(pam_handle_t *pamh)
 int get_password(pam_handle_t *pamh, const char *username, const char *tty)
 	uid_t uid = getuid();
+	char *hostname = getenv("HOSTNAME");
 	for (;;) {
 		int rc;
@@ -83,8 +84,8 @@ int get_password(pam_handle_t *pamh, const char *username, const char *tty)
 			printf(_("The entire console display is now completely locked by %s.\n"),
 		} else {
-			printf(_("The %s is now locked by %s.\n"), tty,
-			       username);
+			printf(_("The %s is now locked by %s on %s.\n"), tty,
+			       username, hostname);
 			if (is_vt)
 				puts(_("Use Alt-function keys to switch to other virtual consoles."));

             reply	other threads:[~2017-06-01 14:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-01 14:54 Vladimir Lomov [this message]
2017-06-02  5:23 ` Vladimir Lomov

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:

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

  git send-email \ \ \ \

* 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 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/ \
	public-inbox-index kbd

Example config snippet for mirrors.
Newsgroup available over NNTP:

AGPL code for this site: git clone