From owner-svn-src-stable-11@freebsd.org Mon Sep 25 20:04:15 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E6A2E23095; Mon, 25 Sep 2017 20:04:15 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 57A6666E5F; Mon, 25 Sep 2017 20:04:15 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8PK4EaW030316; Mon, 25 Sep 2017 20:04:14 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8PK4E5r030312; Mon, 25 Sep 2017 20:04:14 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201709252004.v8PK4E5r030312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Mon, 25 Sep 2017 20:04:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r323992 - stable/11/libexec/getty X-SVN-Group: stable-11 X-SVN-Commit-Author: dab X-SVN-Commit-Paths: stable/11/libexec/getty X-SVN-Commit-Revision: 323992 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Sep 2017 20:04:15 -0000 Author: dab Date: Mon Sep 25 20:04:14 2017 New Revision: 323992 URL: https://svnweb.freebsd.org/changeset/base/323992 Log: MFC r323252: Add a new getty/gettytab capability to generate an initial message dynamically. This modification adds a new gettytab(5) option (iM) to specify a program to run that will generate the initial (banner) message that is displayed before the login prompt. Such a capability is useful when dynamic information is needed in the banner message that cannot be supplied by the set of % substitution sequences available in the "im" option. Sponsored by: Dell EMC Modified: stable/11/libexec/getty/gettytab.5 stable/11/libexec/getty/gettytab.h stable/11/libexec/getty/init.c stable/11/libexec/getty/main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/getty/gettytab.5 ============================================================================== --- stable/11/libexec/getty/gettytab.5 Mon Sep 25 19:49:56 2017 (r323991) +++ stable/11/libexec/getty/gettytab.5 Mon Sep 25 20:04:14 2017 (r323992) @@ -28,7 +28,7 @@ .\" from: @(#)gettytab.5 8.4 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" " -.Dd February 2, 2017 +.Dd August 23, 2017 .Dt GETTYTAB 5 .Os .Sh NAME @@ -130,6 +130,8 @@ hangup line on last close .It "ig bool false ignore garbage characters in login name" .It "im str" Ta Dv NULL .Ta No "initial (banner) message" +.It "iM str" Ta Dv NULL +.Ta No "execute named file to generate initial (banner) message" .It "in str" Ta So Li ^C .Sc Ta No "interrupt character" .It "is num unused input speed" @@ -146,7 +148,7 @@ hangup line on last close .It "mb bool false do flow control based on carrier" .It "nc bool false terminal does not supply carrier (set clocal)" .It "nl bool false terminal has (or might have) a newline character" -.It "np bool false terminal uses no parity (i.e. 8-bit characters)" +.It "np bool false terminal uses no parity (i.e., 8-bit characters)" .It "nx str default next table (for auto speed selection)" .It "o0 num unused tty output flags to write messages" .It "o1 num unused tty output flags to read login name" Modified: stable/11/libexec/getty/gettytab.h ============================================================================== --- stable/11/libexec/getty/gettytab.h Mon Sep 25 19:49:56 2017 (r323991) +++ stable/11/libexec/getty/gettytab.h Mon Sep 25 20:04:14 2017 (r323992) @@ -88,6 +88,7 @@ struct gettyflags { #define AC gettystrs[28].value #define AL gettystrs[29].value #define DF gettystrs[30].value +#define IMP gettystrs[31].value /* * Numeric definitions. Modified: stable/11/libexec/getty/init.c ============================================================================== --- stable/11/libexec/getty/init.c Mon Sep 25 19:49:56 2017 (r323991) +++ stable/11/libexec/getty/init.c Mon Sep 25 20:04:14 2017 (r323992) @@ -82,6 +82,7 @@ struct gettystrs gettystrs[] = { { "ac" }, /* modem answer-chat */ { "al" }, /* user to auto-login */ { "df", datefmt}, /* format for strftime() */ + { "iM" }, /* initial message program */ { 0 } }; Modified: stable/11/libexec/getty/main.c ============================================================================== --- stable/11/libexec/getty/main.c Mon Sep 25 19:49:56 2017 (r323991) +++ stable/11/libexec/getty/main.c Mon Sep 25 20:04:14 2017 (r323992) @@ -324,6 +324,8 @@ main(int argc, char *argv[]) } first_time = 0; + if (IMP && *IMP && !(PL && PP)) + system(IMP); if (IM && *IM && !(PL && PP)) putf(IM); if (setjmp(timeout)) {