History log of /freebsd-11-stable/libexec/getty/main.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 331722 29-Mar-2018 eadler

Revert r330897:

This was intended to be a non-functional change. It wasn't. The commit
message was thus wrong. In addition it broke arm, and merged crypto
related code.

Revert with prejudice.

This revert skips files touched in r316370 since that commit was since
MFCed. This revert also skips files that require $FreeBSD$ property
changes.

Thank you to those who helped me get out of this mess including but not
limited to gonzo, kevans, rgrimes.

Requested by: gjb (re)


# 330897 14-Mar-2018 eadler

Partial merge of the SPDX changes

These changes are incomplete but are making it difficult
to determine what other changes can/should be merged.

No objections from: pfg


# 323992 25-Sep-2017 dab

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


# 302408 07-Jul-2016 gjb

Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle.
Prune svn:mergeinfo from the new branch, as nothing has been merged
here.

Additional commits post-branch will follow.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


/freebsd-11-stable/MAINTAINERS
/freebsd-11-stable/cddl
/freebsd-11-stable/cddl/contrib/opensolaris
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/zfs
/freebsd-11-stable/cddl/contrib/opensolaris/lib/libzfs
/freebsd-11-stable/contrib/amd
/freebsd-11-stable/contrib/apr
/freebsd-11-stable/contrib/apr-util
/freebsd-11-stable/contrib/atf
/freebsd-11-stable/contrib/binutils
/freebsd-11-stable/contrib/bmake
/freebsd-11-stable/contrib/byacc
/freebsd-11-stable/contrib/bzip2
/freebsd-11-stable/contrib/com_err
/freebsd-11-stable/contrib/compiler-rt
/freebsd-11-stable/contrib/dialog
/freebsd-11-stable/contrib/dma
/freebsd-11-stable/contrib/dtc
/freebsd-11-stable/contrib/ee
/freebsd-11-stable/contrib/elftoolchain
/freebsd-11-stable/contrib/elftoolchain/ar
/freebsd-11-stable/contrib/elftoolchain/brandelf
/freebsd-11-stable/contrib/elftoolchain/elfdump
/freebsd-11-stable/contrib/expat
/freebsd-11-stable/contrib/file
/freebsd-11-stable/contrib/gcc
/freebsd-11-stable/contrib/gcclibs/libgomp
/freebsd-11-stable/contrib/gdb
/freebsd-11-stable/contrib/gdtoa
/freebsd-11-stable/contrib/groff
/freebsd-11-stable/contrib/ipfilter
/freebsd-11-stable/contrib/ldns
/freebsd-11-stable/contrib/ldns-host
/freebsd-11-stable/contrib/less
/freebsd-11-stable/contrib/libarchive
/freebsd-11-stable/contrib/libarchive/cpio
/freebsd-11-stable/contrib/libarchive/libarchive
/freebsd-11-stable/contrib/libarchive/libarchive_fe
/freebsd-11-stable/contrib/libarchive/tar
/freebsd-11-stable/contrib/libc++
/freebsd-11-stable/contrib/libc-vis
/freebsd-11-stable/contrib/libcxxrt
/freebsd-11-stable/contrib/libexecinfo
/freebsd-11-stable/contrib/libpcap
/freebsd-11-stable/contrib/libstdc++
/freebsd-11-stable/contrib/libucl
/freebsd-11-stable/contrib/libxo
/freebsd-11-stable/contrib/llvm
/freebsd-11-stable/contrib/llvm/projects/libunwind
/freebsd-11-stable/contrib/llvm/tools/clang
/freebsd-11-stable/contrib/llvm/tools/lldb
/freebsd-11-stable/contrib/llvm/tools/llvm-dwarfdump
/freebsd-11-stable/contrib/llvm/tools/llvm-lto
/freebsd-11-stable/contrib/mdocml
/freebsd-11-stable/contrib/mtree
/freebsd-11-stable/contrib/ncurses
/freebsd-11-stable/contrib/netcat
/freebsd-11-stable/contrib/ntp
/freebsd-11-stable/contrib/nvi
/freebsd-11-stable/contrib/one-true-awk
/freebsd-11-stable/contrib/openbsm
/freebsd-11-stable/contrib/openpam
/freebsd-11-stable/contrib/openresolv
/freebsd-11-stable/contrib/pf
/freebsd-11-stable/contrib/sendmail
/freebsd-11-stable/contrib/serf
/freebsd-11-stable/contrib/sqlite3
/freebsd-11-stable/contrib/subversion
/freebsd-11-stable/contrib/tcpdump
/freebsd-11-stable/contrib/tcsh
/freebsd-11-stable/contrib/tnftp
/freebsd-11-stable/contrib/top
/freebsd-11-stable/contrib/top/install-sh
/freebsd-11-stable/contrib/tzcode/stdtime
/freebsd-11-stable/contrib/tzcode/zic
/freebsd-11-stable/contrib/tzdata
/freebsd-11-stable/contrib/unbound
/freebsd-11-stable/contrib/vis
/freebsd-11-stable/contrib/wpa
/freebsd-11-stable/contrib/xz
/freebsd-11-stable/crypto/heimdal
/freebsd-11-stable/crypto/openssh
/freebsd-11-stable/crypto/openssl
/freebsd-11-stable/gnu/lib
/freebsd-11-stable/gnu/usr.bin/binutils
/freebsd-11-stable/gnu/usr.bin/cc/cc_tools
/freebsd-11-stable/gnu/usr.bin/gdb
/freebsd-11-stable/lib/libc/locale/ascii.c
/freebsd-11-stable/sys/cddl/contrib/opensolaris
/freebsd-11-stable/sys/contrib/dev/acpica
/freebsd-11-stable/sys/contrib/ipfilter
/freebsd-11-stable/sys/contrib/libfdt
/freebsd-11-stable/sys/contrib/octeon-sdk
/freebsd-11-stable/sys/contrib/x86emu
/freebsd-11-stable/sys/contrib/xz-embedded
/freebsd-11-stable/usr.sbin/bhyve/atkbdc.h
/freebsd-11-stable/usr.sbin/bhyve/bhyvegc.c
/freebsd-11-stable/usr.sbin/bhyve/bhyvegc.h
/freebsd-11-stable/usr.sbin/bhyve/console.c
/freebsd-11-stable/usr.sbin/bhyve/console.h
/freebsd-11-stable/usr.sbin/bhyve/pci_fbuf.c
/freebsd-11-stable/usr.sbin/bhyve/pci_xhci.c
/freebsd-11-stable/usr.sbin/bhyve/pci_xhci.h
/freebsd-11-stable/usr.sbin/bhyve/ps2kbd.c
/freebsd-11-stable/usr.sbin/bhyve/ps2kbd.h
/freebsd-11-stable/usr.sbin/bhyve/ps2mouse.c
/freebsd-11-stable/usr.sbin/bhyve/ps2mouse.h
/freebsd-11-stable/usr.sbin/bhyve/rfb.c
/freebsd-11-stable/usr.sbin/bhyve/rfb.h
/freebsd-11-stable/usr.sbin/bhyve/sockstream.c
/freebsd-11-stable/usr.sbin/bhyve/sockstream.h
/freebsd-11-stable/usr.sbin/bhyve/usb_emul.c
/freebsd-11-stable/usr.sbin/bhyve/usb_emul.h
/freebsd-11-stable/usr.sbin/bhyve/usb_mouse.c
/freebsd-11-stable/usr.sbin/bhyve/vga.c
/freebsd-11-stable/usr.sbin/bhyve/vga.h
# 270111 17-Aug-2014 neel

Remove LOG_ODELAY because it does nothing.

Reviewed by: jilles
CR: https://reviews.freebsd.org/D611


# 262136 17-Feb-2014 brueffer

Remove the 3rd clause ("advertising clause") of the BSD license as
permitted by the University of Berkeley on July 22, 1999.

Reviewed by: imp
MFC after: 1 week


# 216582 20-Dec-2010 charnier

Add __unused. Ansi prototypes.


# 214680 02-Nov-2010 ed

Add a new libc function: cfmakesane(3).

I've noticed various terminal emulators that need to obtain a sane
default termios structure use very complex `hacks'. Even though POSIX
doesn't provide any functionality for this, extend our termios API with
cfmakesane(3), which is similar to the commonly supported cfmakeraw(3),
except that it fills the termios structure with sane defaults.

Change all code in our base system to use this function, instead of
depending on <sys/ttydefaults.h> to provide TTYDEF_*.


# 144716 06-Apr-2005 stefanf

Include gettytab.h before extern.h so that the declarations of struct
gettyflags, gettynums and gettystrs are available.


# 135941 29-Sep-2004 imp

Report once that the device isn't there, but keep trying. Don't
filter the errno values. They don't make as much sense as they used
to given how we do devices in /dev.


# 117738 18-Jul-2003 yar

Prototype defttymode() instead of just declaring it.


# 116533 18-Jun-2003 yar

- Use the initial terminal mode instead of the current mode
as the source of defaults for terminal device parameters.

- Do duplucate code reduction and simplification enabled by
the above.

Reviewed by: green
MFC after: 1 month


# 116329 14-Jun-2003 green

In the last clean-up of this code, the fact that the default tty mode
information could only be gleaned from the the tty descriptor itself
was neglected, so never did the tty's default settings get copied from
the kernel. Specifically, this caused all manner of ctrl-keys to not
work. Fix this by calling dogettytab() in all the proper places, and
retrieving the terminfo temporarily in dogettytab().


# 116164 10-Jun-2003 yar

Read gettytab(5) soon enough to fill in all necessary values.
Re-read gettytab(5) only if needed.

This fixes bugs introduced as long ago as in getty/main.c rev.1.15.

PR: bin/18181
MFC after: 1 month


# 116155 10-Jun-2003 yar

Spot one more place where boolean variables were incremented
instead of just being assigned a truth value.


# 116154 10-Jun-2003 yar

Coding style fix: Use "foo = 1" instead of "foo++" to assign
the truth value to a boolean variable, especially when inside
a loop. The variable can overflow otherwise, at least in theory.


# 115900 06-Jun-2003 yar

Fix some minor bugs, namely:

- Initialize "rval", which would be used uninitialized
if al or pl options were set.

- Don't pass an empty string to login(1) as a user name
(this could be triggered by entering a name and then killing it
with backspace or ^U.)

- Don't loop endlessly if the al option specifies a bogus (i.e.,
not alphanumeric) auto-login name.

- Don't pass a bogus user name to login(1) if a good name were
entered and then killed with ^U.

- Exit with status 0, not 1, on receiving an EOF character,
since it's not a error condition.

MFC after: 1 week


# 109555 20-Jan-2003 sobomax

Fix a typo (missed &&).

Submitted by: marcus


# 109540 19-Jan-2003 sobomax

Add a new gettytab(5) option - `pl', which if set tells getty that the line
in question is PPP-only line, i.e. no PPP-sequence detection is necessary and
PPP login program referenced by `pp' should be started automatically instead of
login(1)

Feature suggested and sponsored by: United Networks of Ukraine
No reply from: re
MFC after: 2 weeks


# 91216 25-Feb-2002 bde

#include <sys/time.h> instead of depending on namespace pollution in
<sys/stat.h> for its prerequisite <sys/time.h>.

Removed a duplicated include. Sorted includes.


# 90302 06-Feb-2002 imp

Remove some unused variables, mark unused parameters as unused and change
names of variables that shadow globally declared variables. This should
help people doing later WARNS= fixes.


# 90301 06-Feb-2002 imp

o __P removal
o remove register
o use strict prototypes


# 77874 07-Jun-2001 yar

Add 'df' string to gettytab - the strftime(3) format for %d
in the banner messages (of course, defaults to "%+").

Submitted by: Gleb Smirnoff <glebius@tak.estra.ru>


# 68888 19-Nov-2000 jwd

Check return code from login_tty. Allow getty to try and become
a daemon and session leader (thus allowing getty to be run from
a shell command line or script).

Partially Reviewed by: bde


# 66908 09-Oct-2000 wollman

Correction to previous log entry: add newline between <sys/*.h> and <*.h>.


# 66907 09-Oct-2000 wollman

Don't depend on <sys/stat.h> bogusly including <sys/time.h> (and thereby
<time.h>).


# 64076 31-Jul-2000 nsayer

Add 'nc' flag to gettytab -- no carrier. Forces non-blocking open and
setting of CLOCAL. Necessary for 3 wire RS-232 setups with dumb
terminals.

PR: 5959


# 56725 28-Jan-2000 bde

Changed setflags() to set_flags(). This fixes world breakage due to
recently incremented namespace pollution in <unistd.h>.


# 50476 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 45422 07-Apr-1999 brian

Ensure that things returned by gethostname() and
friends are terminated and allow for a maximum
host name length of MAXHOSTNAMELEN - 1.
Put parenthesis around sizeof args.
Make some variables static.
Fix telnetd -u (broken by my last commit)

Prompted by: bde


# 45291 04-Apr-1999 peter

Add an 'al' (autologin username) capability to getty/gettytab. This is a
damn useful thing for using with serial consoles in clusters etc or secure
console locations. Using a custom gettytab entry for console with
an entry like 'al=root' means that there is *always* a root login ready on
the console. This should replace hacks like those which go with conserver
etc. (This is a loaded gun, watch out for those feet!)

Submitted by: "Andrew J. Korty" <ajk@purdue.edu>


# 44615 09-Mar-1999 brian

Set the CPU resource limit back to infinity before exec()ing PP.
PR: 10399


# 40083 08-Oct-1998 jkh

This thing has its own puts function, so use it.
Submitted by: Matthew Jacob <mjacob@nas.nasa.gov>


# 31331 21-Nov-1997 charnier

Correct incompletes .Xrs. Remove duplicate #includes and unused variables.


# 26999 27-Jun-1997 alex

Removed unused variables.


# 26415 03-Jun-1997 davidn

Reset alarm before invoking ppplogin.
PR: 3733
Reviewed by:
Submitted by: kfurge@worldnet.att.net
Obtained from:


# 22989 22-Feb-1997 peter

Revert $FreeBSD$ to $Id$


# 22491 09-Feb-1997 davidn

Tidy-up modem-chat handling: ensure tty modes are restored to
'sane' standard (not raw) settings before abort/exiting; move
responsibility of setting raw mode for chat-handling out of
chat.c to avoid doing redundant tc{s,g}etattr()s; move DE
pause prior setting standard mode before issue/login prompt to
avoid echoing modem connect strings. Fixed up comment styles
in a couple of places.


# 22400 07-Feb-1997 davidn

Increased username size to allow passing username:auth_method to
login.


# 22211 02-Feb-1997 davidn

Make username size dependant on MAXLOGNAME in sys/param.h. Was
previously hard-coded at 16 characters (and possibly overflowing
the field when NUL terminating a username of exactly 16 characters
in length).


# 22208 02-Feb-1997 davidn

Added:
ic=expect/send script modem init script
ac=expect/send script modem answer script
ct#val chat script timeout (seconds)
rt#val recycle timeout (seconds) if 'ac' set
dc#val debug bitmask for debugging chat scripts
hw (boolean) enable crtscts handshaking
if=path 'issue' file sent prior login prompt

chat.c is a simplistic expect/send chat module.


# 22199 02-Feb-1997 davidn

Fix bug in %s, %m, %r and %v macros not displaying data.


# 21673 14-Jan-1997 jkh

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


# 21120 30-Dec-1996 msmith

Add a new 'de' capability, specifying a number of seconds to sleep before
emitting the initial prompt.

This is useful in a number of circumstances :
- you have (a) stupid modem(s) that assert(s) DCD too soon.
- you have dialin users with stupid diallers and poorly
written chatscripts. (esp. some Winsock diallers)

BSD/OS also has this capability.

Submitted by: damian@cablenet.net (Damian Hamill)


# 19697 12-Nov-1996 pst

Add the >optional< ability to sense PPP link bringups and call an authentication program


# 15659 07-May-1996 ache

Replace non-POSIX speed setting by POSIX one


# 15645 05-May-1996 joerg

Finally commit the changes that make getty(8) no longer depend on the
COMPAT_43 cruft. This is supposedly the last core utility that has
been using it! (So now, one should be able to remove this option from
the config files. Be aware that the last officially released xterm
however still requires it.)

The getty has been running now for several weeks on my modem line, so
i feel safe about it.

Obtained from: mostly from the NetBSD vendor-branch


# 9875 03-Aug-1995 jkh

Back this change out. It's just not worth arguing over and any further emails
I get on this topic will go straight to /dev/null. This is absolutely the
last word on this topic you'll see from me. Too much time has already been
wasted.


# 9839 01-Aug-1995 jkh

A useful aid.. Add support for:

%r: current release
%m: machine architecture type (i386 for now)
%s: OS name (FreeBSD)

from uname() in banner string.


# 8870 30-May-1995 rgrimes

Remove trailing whitespace.


# 2845 18-Sep-1994 dg

Fix from John Kohl:

/usr/libexec/getty doesn't properly interpret the '%d' escape. It tries
to use %P to get AM or PM, but instead all it gets is "P".

Submitted by: John Kohl


# 2391 29-Aug-1994 ache

Ignore SIGQUITs, cause getty dumps core on garbadge from modem line


# 2286 26-Aug-1994 jkh

Replace this with the 1.1.5.1 getty. David says that the 4.4 version is too
broken to live.
Submitted by: jkh


# 2223 22-Aug-1994 guido

Implement fbtab ala SunSO.
Could not compile it (on thud) because ttychar.h was still broken.
Reviewed by:
Submitted by: guido


# 1593 27-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1592,
which included commits to RCS files with non-trunk default branches.


# 1592 27-May-1994 rgrimes

BSD 4.4 Lite Libexec Sources