From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa.local.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1496328889; bh=6v+aCRM8yEQ97JOKgm6kt2kUcp8St41y076AuLeN/U0=; h=Date:From:To:Subject:Message-ID; b=VJVc+CuJIKwwh3Hp62JcYf/Ve0NXBI5KOVfbbAi+wy3wHbvo9jl7f/9loCGkoeomd L+943FUXu+N1x4H/Iuc+3qYmBoTb72tevLXDRhQ0LQoYdvuZc2wKaKVdWnGggRaqDX 8v9aSjera08r6MZ3dRJANc79YbFmx0FgdhaYnkMs= Authentication-Results: smtp1o.mail.yandex.net; dkim=pass header.i=@yandex.ru X-Yandex-Suid-Status: 1 0 Date: Thu, 1 Jun 2017 22:54:47 +0800 From: Vladimir Lomov To: kbd@lists.altlinux.org Message-ID: <20170601145447.GA703@smoon.vl-lomov.ru> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="WIyZ46R2i8wDzkSu" Content-Disposition: inline User-Agent: Mutt/1.8.3 (2017-05-23) X-Mailman-Approved-At: Sat, 03 Jun 2017 02:32:34 +0300 Subject: [kbd] [Enhancement] Add hostname to message on locked screen 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: Thu, 01 Jun 2017 14:54:55 -0000 Archived-At: List-Archive: --WIyZ46R2i8wDzkSu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello, 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 x86_64). --- 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" --WIyZ46R2i8wDzkSu Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="kbd-vlock.patch" 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"), username); } 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.")); } --WIyZ46R2i8wDzkSu--