History log of /netbsd-current/libexec/getty/main.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.68 12-Oct-2021 jmcneill

getty: Remove 2 second sleep before opening tty

This (apparently very old!) workaround to ensure that DTR stays down long
enough to be detected is now handled by serial drivers themselves. For
console devices (framebuffer, serial console, etc) this was an unnecessary
2 second penalty that we have all been paying since the beginning of time.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406
# 1.67 26-Feb-2020 riastradh

uugetty is no more


Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE netbsd-8-2-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 netbsd-8-1-RELEASE netbsd-8-1-RC1 pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 bouyer-socketcan-base
# 1.66 10-Jan-2017 christos

branches: 1.66.14;
need <sys/stat.h> for chmod


Revision tags: pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.65 17-Mar-2016 christos

branches: 1.65.2;
Add volatile for gcc 5


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 tls-maxphys-base
# 1.64 12-Aug-2013 joerg

Use __dead.


# 1.63 11-Aug-2013 martin

Fix another automatic variable that is life both pre- and post the siglongjmp
(which gcc calls "might be clobbered") by marking it volatile: on some
machines, this value might end up in a register loaded before the sigsetjmp,
but not preserved by the siglongjmp later.
Fixes the VAX build.


# 1.62 11-Aug-2013 dholland

Use siglongjmp to jump out of signal handlers.


# 1.61 11-Aug-2013 dholland

Pass WARNS=5.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.60 04-Nov-2012 christos

remove useless include (sys/stat.h) and add useful one (stdio.h)


Revision tags: yamt-pagecache-base6
# 1.59 28-Jun-2012 roy

branches: 1.59.2;
Don't attempt to parse a termcap/terminfo string ourselves;
always use tputs(3).


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4 netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231
# 1.58 03-Feb-2010 roy

branches: 1.58.6; 1.58.8;
Userland now builds and uses terminfo instead of termcap.

OK: core@, jdc@


Revision tags: matt-premerge-20091211
# 1.57 04-Jul-2009 mbalmer

Remove an old workaround from SCCS times (%M% would insert the filename).


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE jym-xensuspend-nbase netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 jym-xensuspend-base netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2
# 1.56 20-Jul-2008 lukem

branches: 1.56.10;
Remove the \n and tabs from the __COPYRIGHT() strings.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base
# 1.55 13-Apr-2008 dholland

branches: 1.55.4;
'_' is functionally alphanumeric in many contexts, including login names.
Since it doesn't have case, treat it like a digit. While here, avoid
setting the associated flag variable by incrementing it.
Fixes PR bin/33521; patch based on one from Dieter Roelants.


Revision tags: keiichi-mipv6-base matt-armv6-nbase
# 1.54 04-Mar-2008 dholland

Sort includes, removing duplicate <time.h>.


Revision tags: cube-autoconf-base matt-armv6-base hpcarm-cleanup-base
# 1.53 03-Dec-2007 isaki

branches: 1.53.4;
white space fix.


Revision tags: matt-armv6-prevmlocking matt-mips64-base
# 1.52 17-Jan-2007 hubertf

branches: 1.52.4;
Remove duplicated #includes and some trailing whitespace while here.
From Slava Semushin <slava.semushin@gmail.com>


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base netbsd-4-base
# 1.51 16-Nov-2006 christos

pass lint


Revision tags: abandoned-netbsd-4-base
# 1.50 28-Dec-2005 christos

PR/25605: Frank Kardel: getty leaves ttymodes at read login state when
exec-ing pppd. Fixed as suggested.


# 1.49 10-Sep-2005 elad

Don't chown/unlink uninitialized lockfile if not uugetty.
From Dr. Wolfgang Stukenbrock, PR/31040.


# 1.48 01-Jun-2005 lukem

Ensure rval is initialized before we try to check it; it won't be set
if AL or NN are in use.
Detected with gcc -Wuninitialized.


# 1.47 17-Mar-2005 christos

print ptyfs ptys properly.


Revision tags: netbsd-3-base
# 1.46 05-Nov-2004 dsl

branches: 1.46.2;
Add (unsigned char) cast to ctype functions


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.45 07-Aug-2003 agc

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22284, verified by myself.


# 1.44 20-May-2003 thorpej

Add a "nn" (no name) capability to getty. If set in gettytab, getty
will not prompt for a login name, and will not pass one along to the
login program. This can be used to accomodate login programs that have
an alternate way of selecting the user to log in.


# 1.43 17-May-2003 itojun

use strlcpy


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 fvdl_fs64_base netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.42 14-Dec-2001 christos

PR/14941: David Querbach: add support for non-standard MS-Windows PPP client.


# 1.41 10-Nov-2001 thorpej

ANSI'ify.


# 1.40 10-Nov-2001 thorpej

Const'ify partab[].


# 1.39 02-Nov-2001 christos

Update to the new t_agetstr() API.


# 1.38 19-Feb-2001 cgd

convert to use getprogname()


# 1.37 04-Feb-2001 christos

remove redundant decls
fix nested extern


# 1.36 10-Jan-2001 lukem

- don't use LOG_ODELAY; it's the default
- use LOG_WARNING (instead of LOG_ERR) for non-fatal errors


# 1.35 28-Dec-2000 sommerfeld

Add new :cs: modifier to gettytab which clears the screen using the
appropriate control sequence from termcap (based on the terminal type
listed in /etc/ttys for the line).


# 1.34 08-Oct-2000 bjh21

Clean-up of grotty SCCS workaround. It's now almost not grotty at all.
This is the last part of PR bin/10049.


# 1.33 08-Oct-2000 bjh21

Don't run over the end of the banner buffer if it ends with '%'.
From PR bin/10049


# 1.32 19-Sep-2000 mjl

Use strlcpy/strlcat instead of strn* plus manual termination.
Use sizeof() instead of hardcoded length. Clean up NULL vs 0
confusion. sizeof(char) is 1, really.


Revision tags: netbsd-1-5-ALPHA2 netbsd-1-5-base minoura-xpg4dl-base
# 1.31 14-Jan-2000 ad

branches: 1.31.4;
- Either QVT/Term or the NT 'clipboard' converts tabs to spaces. I pasted in
some code via QVT/Term. Sigh. Fix it.
- Teeny KNF nit.


# 1.30 04-Jan-2000 ad

Add two new capabilities to gettytab - idea from FreeBSD:
al - user to auto-login as
if - banner file to display, like /etc/issue


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.29 15-Dec-1999 drochner

add one byte to the username character array and make sure the string
passed to "login" is '\0'-terminated


Revision tags: comdex-fall-1999-base netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.28 15-Jan-1999 kml

branches: 1.28.2; 1.28.6;
Ensure that all of the initial message (im=) gets flushed to the
screen; previously, the last buffer worth of text would fail
to be printed.


# 1.27 12-Oct-1998 tsarna

Add PPP autodetect, based on code from FreeBSD via OpenBSD.


# 1.26 06-Jul-1998 mrg

- use an array MAXHOSTNAMELEN+1 size to hold hostnames
- ensure hostname from gethostname() is nul-terminated in all cases
- minor KNF
- use MAXHOSTNAMELEN over various other values/defines
- be safe will buffers that hold hostnames


# 1.25 30-Mar-1998 mrg

remove register.


# 1.24 18-Nov-1997 thorpej

Const'ify some things, rename local puts() to xputs(), since it has
a different prototype than the one in <stdio.h>


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base
# 1.23 19-Oct-1997 cjs

Add uugetty capability.


# 1.22 06-Aug-1997 mikel

use <sys/cdefs.h> __COPYRIGHT() and __RCSID() macros
prototype internal functions and eliminate old function declarations
misc cleanup (gcc -Wall) and KNF


# 1.21 06-Aug-1997 mikel

don't include <signal.h> twice


# 1.20 29-Apr-1997 tls

fix a couple of unlikely buffer overflows.


# 1.19 14-Nov-1996 gwr

After the chown(ttyn, 0, 0), call ttyaction(ttyn, "getty", "root")


# 1.18 31-Jul-1996 thorpej

RCS id police.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.17 15-May-1996 jtc

Updated to use <util.h>.
From Greg Hudson <ghudson@MIT.EDU>.


# 1.16 08-Feb-1996 mycroft

Make sure that the user name cannot ever be interpreted as an option to
login(8). Note: This does *not* fix any security holes.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.15 13-Aug-1995 cgd

log open failure every 10th try (that was the old behaviour) UNLESS
the error is ENXIO and it's already been logged. (this allows people
to leave getty's running on nonexistent devices without filling their
syslog. while it's arguable that that might not be a good idea, i've
found it to be _very_ useful, because it allows me to rdist /etc/ttys.)


# 1.14 19-Jun-1995 jtc

sys/termios.h -> termios.h


# 1.13 18-Sep-1994 mycroft

Fix typo in date format.


# 1.12 05-Sep-1994 pk

Use tcflush().


# 1.11 05-Sep-1994 pk

Set control flags properly while in read mode.
Supply process ID when syslogging.


# 1.10 24-Aug-1994 mycroft

Fix pad insertion for termios.


# 1.9 24-Aug-1994 mycroft

branches: 1.9.2;
Use cfset[io]speed() to set termios speeds, per POSIX.


# 1.8 17-Aug-1994 pk

Cleanup import, merge local changes.


Revision tags: netbsd-1-0-base
# 1.7 28-Apr-1994 pk

Towards termios.


# 1.6 17-Mar-1994 pk

TIOCFLUSH requires argument


# 1.5 09-Mar-1994 cgd

fix bin/140: use getcap(3) routines


# 1.4 08-Mar-1994 mycroft

We don't need or want set_ttydefaults().


# 1.3 29-Aug-1993 mycroft

Add some more magic cookies for the `im' string to display info from
uname(2):

%s sysname
%r release
%v version
%m machine


# 1.2 01-Aug-1993 mycroft

Add RCS identifiers.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


# 1.67 26-Feb-2020 riastradh

uugetty is no more


Revision tags: netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 netbsd-8-1-RELEASE netbsd-8-1-RC1 pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 bouyer-socketcan-base
# 1.66 10-Jan-2017 christos

need <sys/stat.h> for chmod


Revision tags: pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.65 17-Mar-2016 christos

branches: 1.65.2;
Add volatile for gcc 5


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 tls-maxphys-base
# 1.64 12-Aug-2013 joerg

Use __dead.


# 1.63 11-Aug-2013 martin

Fix another automatic variable that is life both pre- and post the siglongjmp
(which gcc calls "might be clobbered") by marking it volatile: on some
machines, this value might end up in a register loaded before the sigsetjmp,
but not preserved by the siglongjmp later.
Fixes the VAX build.


# 1.62 11-Aug-2013 dholland

Use siglongjmp to jump out of signal handlers.


# 1.61 11-Aug-2013 dholland

Pass WARNS=5.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.60 04-Nov-2012 christos

remove useless include (sys/stat.h) and add useful one (stdio.h)


Revision tags: yamt-pagecache-base6
# 1.59 28-Jun-2012 roy

branches: 1.59.2;
Don't attempt to parse a termcap/terminfo string ourselves;
always use tputs(3).


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4 netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231
# 1.58 03-Feb-2010 roy

branches: 1.58.6; 1.58.8;
Userland now builds and uses terminfo instead of termcap.

OK: core@, jdc@


Revision tags: matt-premerge-20091211
# 1.57 04-Jul-2009 mbalmer

Remove an old workaround from SCCS times (%M% would insert the filename).


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE jym-xensuspend-nbase netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 jym-xensuspend-base netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2
# 1.56 20-Jul-2008 lukem

branches: 1.56.10;
Remove the \n and tabs from the __COPYRIGHT() strings.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base
# 1.55 13-Apr-2008 dholland

branches: 1.55.4;
'_' is functionally alphanumeric in many contexts, including login names.
Since it doesn't have case, treat it like a digit. While here, avoid
setting the associated flag variable by incrementing it.
Fixes PR bin/33521; patch based on one from Dieter Roelants.


Revision tags: keiichi-mipv6-base matt-armv6-nbase
# 1.54 04-Mar-2008 dholland

Sort includes, removing duplicate <time.h>.


Revision tags: cube-autoconf-base matt-armv6-base hpcarm-cleanup-base
# 1.53 03-Dec-2007 isaki

branches: 1.53.4;
white space fix.


Revision tags: matt-armv6-prevmlocking matt-mips64-base
# 1.52 17-Jan-2007 hubertf

branches: 1.52.4;
Remove duplicated #includes and some trailing whitespace while here.
From Slava Semushin <slava.semushin@gmail.com>


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base netbsd-4-base
# 1.51 16-Nov-2006 christos

pass lint


Revision tags: abandoned-netbsd-4-base
# 1.50 28-Dec-2005 christos

PR/25605: Frank Kardel: getty leaves ttymodes at read login state when
exec-ing pppd. Fixed as suggested.


# 1.49 10-Sep-2005 elad

Don't chown/unlink uninitialized lockfile if not uugetty.
From Dr. Wolfgang Stukenbrock, PR/31040.


# 1.48 01-Jun-2005 lukem

Ensure rval is initialized before we try to check it; it won't be set
if AL or NN are in use.
Detected with gcc -Wuninitialized.


# 1.47 17-Mar-2005 christos

print ptyfs ptys properly.


Revision tags: netbsd-3-base
# 1.46 05-Nov-2004 dsl

branches: 1.46.2;
Add (unsigned char) cast to ctype functions


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.45 07-Aug-2003 agc

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22284, verified by myself.


# 1.44 20-May-2003 thorpej

Add a "nn" (no name) capability to getty. If set in gettytab, getty
will not prompt for a login name, and will not pass one along to the
login program. This can be used to accomodate login programs that have
an alternate way of selecting the user to log in.


# 1.43 17-May-2003 itojun

use strlcpy


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 fvdl_fs64_base netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.42 14-Dec-2001 christos

PR/14941: David Querbach: add support for non-standard MS-Windows PPP client.


# 1.41 10-Nov-2001 thorpej

ANSI'ify.


# 1.40 10-Nov-2001 thorpej

Const'ify partab[].


# 1.39 02-Nov-2001 christos

Update to the new t_agetstr() API.


# 1.38 19-Feb-2001 cgd

convert to use getprogname()


# 1.37 04-Feb-2001 christos

remove redundant decls
fix nested extern


# 1.36 10-Jan-2001 lukem

- don't use LOG_ODELAY; it's the default
- use LOG_WARNING (instead of LOG_ERR) for non-fatal errors


# 1.35 28-Dec-2000 sommerfeld

Add new :cs: modifier to gettytab which clears the screen using the
appropriate control sequence from termcap (based on the terminal type
listed in /etc/ttys for the line).


# 1.34 08-Oct-2000 bjh21

Clean-up of grotty SCCS workaround. It's now almost not grotty at all.
This is the last part of PR bin/10049.


# 1.33 08-Oct-2000 bjh21

Don't run over the end of the banner buffer if it ends with '%'.
From PR bin/10049


# 1.32 19-Sep-2000 mjl

Use strlcpy/strlcat instead of strn* plus manual termination.
Use sizeof() instead of hardcoded length. Clean up NULL vs 0
confusion. sizeof(char) is 1, really.


Revision tags: netbsd-1-5-ALPHA2 netbsd-1-5-base minoura-xpg4dl-base
# 1.31 14-Jan-2000 ad

branches: 1.31.4;
- Either QVT/Term or the NT 'clipboard' converts tabs to spaces. I pasted in
some code via QVT/Term. Sigh. Fix it.
- Teeny KNF nit.


# 1.30 04-Jan-2000 ad

Add two new capabilities to gettytab - idea from FreeBSD:
al - user to auto-login as
if - banner file to display, like /etc/issue


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.29 15-Dec-1999 drochner

add one byte to the username character array and make sure the string
passed to "login" is '\0'-terminated


Revision tags: comdex-fall-1999-base netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.28 15-Jan-1999 kml

branches: 1.28.2; 1.28.6;
Ensure that all of the initial message (im=) gets flushed to the
screen; previously, the last buffer worth of text would fail
to be printed.


# 1.27 12-Oct-1998 tsarna

Add PPP autodetect, based on code from FreeBSD via OpenBSD.


# 1.26 06-Jul-1998 mrg

- use an array MAXHOSTNAMELEN+1 size to hold hostnames
- ensure hostname from gethostname() is nul-terminated in all cases
- minor KNF
- use MAXHOSTNAMELEN over various other values/defines
- be safe will buffers that hold hostnames


# 1.25 30-Mar-1998 mrg

remove register.


# 1.24 18-Nov-1997 thorpej

Const'ify some things, rename local puts() to xputs(), since it has
a different prototype than the one in <stdio.h>


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base
# 1.23 19-Oct-1997 cjs

Add uugetty capability.


# 1.22 06-Aug-1997 mikel

use <sys/cdefs.h> __COPYRIGHT() and __RCSID() macros
prototype internal functions and eliminate old function declarations
misc cleanup (gcc -Wall) and KNF


# 1.21 06-Aug-1997 mikel

don't include <signal.h> twice


# 1.20 29-Apr-1997 tls

fix a couple of unlikely buffer overflows.


# 1.19 14-Nov-1996 gwr

After the chown(ttyn, 0, 0), call ttyaction(ttyn, "getty", "root")


# 1.18 31-Jul-1996 thorpej

RCS id police.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.17 15-May-1996 jtc

Updated to use <util.h>.
From Greg Hudson <ghudson@MIT.EDU>.


# 1.16 08-Feb-1996 mycroft

Make sure that the user name cannot ever be interpreted as an option to
login(8). Note: This does *not* fix any security holes.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.15 13-Aug-1995 cgd

log open failure every 10th try (that was the old behaviour) UNLESS
the error is ENXIO and it's already been logged. (this allows people
to leave getty's running on nonexistent devices without filling their
syslog. while it's arguable that that might not be a good idea, i've
found it to be _very_ useful, because it allows me to rdist /etc/ttys.)


# 1.14 19-Jun-1995 jtc

sys/termios.h -> termios.h


# 1.13 18-Sep-1994 mycroft

Fix typo in date format.


# 1.12 05-Sep-1994 pk

Use tcflush().


# 1.11 05-Sep-1994 pk

Set control flags properly while in read mode.
Supply process ID when syslogging.


# 1.10 24-Aug-1994 mycroft

Fix pad insertion for termios.


# 1.9 24-Aug-1994 mycroft

branches: 1.9.2;
Use cfset[io]speed() to set termios speeds, per POSIX.


# 1.8 17-Aug-1994 pk

Cleanup import, merge local changes.


Revision tags: netbsd-1-0-base
# 1.7 28-Apr-1994 pk

Towards termios.


# 1.6 17-Mar-1994 pk

TIOCFLUSH requires argument


# 1.5 09-Mar-1994 cgd

fix bin/140: use getcap(3) routines


# 1.4 08-Mar-1994 mycroft

We don't need or want set_ttydefaults().


# 1.3 29-Aug-1993 mycroft

Add some more magic cookies for the `im' string to display info from
uname(2):

%s sysname
%r release
%v version
%m machine


# 1.2 01-Aug-1993 mycroft

Add RCS identifiers.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


# 1.66 10-Jan-2017 christos

need <sys/stat.h> for chmod


Revision tags: pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.65 17-Mar-2016 christos

Add volatile for gcc 5


Revision tags: netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 tls-maxphys-base
# 1.64 12-Aug-2013 joerg

Use __dead.


# 1.63 11-Aug-2013 martin

Fix another automatic variable that is life both pre- and post the siglongjmp
(which gcc calls "might be clobbered") by marking it volatile: on some
machines, this value might end up in a register loaded before the sigsetjmp,
but not preserved by the siglongjmp later.
Fixes the VAX build.


# 1.62 11-Aug-2013 dholland

Use siglongjmp to jump out of signal handlers.


# 1.61 11-Aug-2013 dholland

Pass WARNS=5.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.60 04-Nov-2012 christos

remove useless include (sys/stat.h) and add useful one (stdio.h)


Revision tags: yamt-pagecache-base6
# 1.59 28-Jun-2012 roy

branches: 1.59.2;
Don't attempt to parse a termcap/terminfo string ourselves;
always use tputs(3).


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4 netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231
# 1.58 03-Feb-2010 roy

branches: 1.58.6; 1.58.8;
Userland now builds and uses terminfo instead of termcap.

OK: core@, jdc@


Revision tags: matt-premerge-20091211
# 1.57 04-Jul-2009 mbalmer

Remove an old workaround from SCCS times (%M% would insert the filename).


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE jym-xensuspend-nbase netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 jym-xensuspend-base netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2
# 1.56 20-Jul-2008 lukem

branches: 1.56.10;
Remove the \n and tabs from the __COPYRIGHT() strings.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base
# 1.55 13-Apr-2008 dholland

branches: 1.55.4;
'_' is functionally alphanumeric in many contexts, including login names.
Since it doesn't have case, treat it like a digit. While here, avoid
setting the associated flag variable by incrementing it.
Fixes PR bin/33521; patch based on one from Dieter Roelants.


Revision tags: keiichi-mipv6-base matt-armv6-nbase
# 1.54 04-Mar-2008 dholland

Sort includes, removing duplicate <time.h>.


Revision tags: cube-autoconf-base matt-armv6-base hpcarm-cleanup-base
# 1.53 03-Dec-2007 isaki

branches: 1.53.4;
white space fix.


Revision tags: matt-armv6-prevmlocking matt-mips64-base
# 1.52 17-Jan-2007 hubertf

branches: 1.52.4;
Remove duplicated #includes and some trailing whitespace while here.
From Slava Semushin <slava.semushin@gmail.com>


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base netbsd-4-base
# 1.51 16-Nov-2006 christos

pass lint


Revision tags: abandoned-netbsd-4-base
# 1.50 28-Dec-2005 christos

PR/25605: Frank Kardel: getty leaves ttymodes at read login state when
exec-ing pppd. Fixed as suggested.


# 1.49 10-Sep-2005 elad

Don't chown/unlink uninitialized lockfile if not uugetty.
From Dr. Wolfgang Stukenbrock, PR/31040.


# 1.48 01-Jun-2005 lukem

Ensure rval is initialized before we try to check it; it won't be set
if AL or NN are in use.
Detected with gcc -Wuninitialized.


# 1.47 17-Mar-2005 christos

print ptyfs ptys properly.


Revision tags: netbsd-3-base
# 1.46 05-Nov-2004 dsl

branches: 1.46.2;
Add (unsigned char) cast to ctype functions


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.45 07-Aug-2003 agc

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22284, verified by myself.


# 1.44 20-May-2003 thorpej

Add a "nn" (no name) capability to getty. If set in gettytab, getty
will not prompt for a login name, and will not pass one along to the
login program. This can be used to accomodate login programs that have
an alternate way of selecting the user to log in.


# 1.43 17-May-2003 itojun

use strlcpy


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 fvdl_fs64_base netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.42 14-Dec-2001 christos

PR/14941: David Querbach: add support for non-standard MS-Windows PPP client.


# 1.41 10-Nov-2001 thorpej

ANSI'ify.


# 1.40 10-Nov-2001 thorpej

Const'ify partab[].


# 1.39 02-Nov-2001 christos

Update to the new t_agetstr() API.


# 1.38 19-Feb-2001 cgd

convert to use getprogname()


# 1.37 04-Feb-2001 christos

remove redundant decls
fix nested extern


# 1.36 10-Jan-2001 lukem

- don't use LOG_ODELAY; it's the default
- use LOG_WARNING (instead of LOG_ERR) for non-fatal errors


# 1.35 28-Dec-2000 sommerfeld

Add new :cs: modifier to gettytab which clears the screen using the
appropriate control sequence from termcap (based on the terminal type
listed in /etc/ttys for the line).


# 1.34 08-Oct-2000 bjh21

Clean-up of grotty SCCS workaround. It's now almost not grotty at all.
This is the last part of PR bin/10049.


# 1.33 08-Oct-2000 bjh21

Don't run over the end of the banner buffer if it ends with '%'.
From PR bin/10049


# 1.32 19-Sep-2000 mjl

Use strlcpy/strlcat instead of strn* plus manual termination.
Use sizeof() instead of hardcoded length. Clean up NULL vs 0
confusion. sizeof(char) is 1, really.


Revision tags: netbsd-1-5-ALPHA2 netbsd-1-5-base minoura-xpg4dl-base
# 1.31 14-Jan-2000 ad

branches: 1.31.4;
- Either QVT/Term or the NT 'clipboard' converts tabs to spaces. I pasted in
some code via QVT/Term. Sigh. Fix it.
- Teeny KNF nit.


# 1.30 04-Jan-2000 ad

Add two new capabilities to gettytab - idea from FreeBSD:
al - user to auto-login as
if - banner file to display, like /etc/issue


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.29 15-Dec-1999 drochner

add one byte to the username character array and make sure the string
passed to "login" is '\0'-terminated


Revision tags: comdex-fall-1999-base netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.28 15-Jan-1999 kml

branches: 1.28.2; 1.28.6;
Ensure that all of the initial message (im=) gets flushed to the
screen; previously, the last buffer worth of text would fail
to be printed.


# 1.27 12-Oct-1998 tsarna

Add PPP autodetect, based on code from FreeBSD via OpenBSD.


# 1.26 06-Jul-1998 mrg

- use an array MAXHOSTNAMELEN+1 size to hold hostnames
- ensure hostname from gethostname() is nul-terminated in all cases
- minor KNF
- use MAXHOSTNAMELEN over various other values/defines
- be safe will buffers that hold hostnames


# 1.25 30-Mar-1998 mrg

remove register.


# 1.24 18-Nov-1997 thorpej

Const'ify some things, rename local puts() to xputs(), since it has
a different prototype than the one in <stdio.h>


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base
# 1.23 19-Oct-1997 cjs

Add uugetty capability.


# 1.22 06-Aug-1997 mikel

use <sys/cdefs.h> __COPYRIGHT() and __RCSID() macros
prototype internal functions and eliminate old function declarations
misc cleanup (gcc -Wall) and KNF


# 1.21 06-Aug-1997 mikel

don't include <signal.h> twice


# 1.20 29-Apr-1997 tls

fix a couple of unlikely buffer overflows.


# 1.19 14-Nov-1996 gwr

After the chown(ttyn, 0, 0), call ttyaction(ttyn, "getty", "root")


# 1.18 31-Jul-1996 thorpej

RCS id police.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.17 15-May-1996 jtc

Updated to use <util.h>.
From Greg Hudson <ghudson@MIT.EDU>.


# 1.16 08-Feb-1996 mycroft

Make sure that the user name cannot ever be interpreted as an option to
login(8). Note: This does *not* fix any security holes.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.15 13-Aug-1995 cgd

log open failure every 10th try (that was the old behaviour) UNLESS
the error is ENXIO and it's already been logged. (this allows people
to leave getty's running on nonexistent devices without filling their
syslog. while it's arguable that that might not be a good idea, i've
found it to be _very_ useful, because it allows me to rdist /etc/ttys.)


# 1.14 19-Jun-1995 jtc

sys/termios.h -> termios.h


# 1.13 18-Sep-1994 mycroft

Fix typo in date format.


# 1.12 05-Sep-1994 pk

Use tcflush().


# 1.11 05-Sep-1994 pk

Set control flags properly while in read mode.
Supply process ID when syslogging.


# 1.10 24-Aug-1994 mycroft

Fix pad insertion for termios.


# 1.9 24-Aug-1994 mycroft

branches: 1.9.2;
Use cfset[io]speed() to set termios speeds, per POSIX.


# 1.8 17-Aug-1994 pk

Cleanup import, merge local changes.


Revision tags: netbsd-1-0-base
# 1.7 28-Apr-1994 pk

Towards termios.


# 1.6 17-Mar-1994 pk

TIOCFLUSH requires argument


# 1.5 09-Mar-1994 cgd

fix bin/140: use getcap(3) routines


# 1.4 08-Mar-1994 mycroft

We don't need or want set_ttydefaults().


# 1.3 29-Aug-1993 mycroft

Add some more magic cookies for the `im' string to display info from
uname(2):

%s sysname
%r release
%v version
%m machine


# 1.2 01-Aug-1993 mycroft

Add RCS identifiers.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


Revision tags: pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.65 17-Mar-2016 christos

Add volatile for gcc 5


Revision tags: netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 tls-maxphys-base
# 1.64 12-Aug-2013 joerg

Use __dead.


# 1.63 11-Aug-2013 martin

Fix another automatic variable that is life both pre- and post the siglongjmp
(which gcc calls "might be clobbered") by marking it volatile: on some
machines, this value might end up in a register loaded before the sigsetjmp,
but not preserved by the siglongjmp later.
Fixes the VAX build.


# 1.62 11-Aug-2013 dholland

Use siglongjmp to jump out of signal handlers.


# 1.61 11-Aug-2013 dholland

Pass WARNS=5.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.60 04-Nov-2012 christos

remove useless include (sys/stat.h) and add useful one (stdio.h)


Revision tags: yamt-pagecache-base6
# 1.59 28-Jun-2012 roy

branches: 1.59.2;
Don't attempt to parse a termcap/terminfo string ourselves;
always use tputs(3).


Revision tags: yamt-pagecache-base5 yamt-pagecache-base4 netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231
# 1.58 03-Feb-2010 roy

branches: 1.58.6; 1.58.8;
Userland now builds and uses terminfo instead of termcap.

OK: core@, jdc@


Revision tags: matt-premerge-20091211
# 1.57 04-Jul-2009 mbalmer

Remove an old workaround from SCCS times (%M% would insert the filename).


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE jym-xensuspend-nbase netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 jym-xensuspend-base netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2
# 1.56 20-Jul-2008 lukem

branches: 1.56.10;
Remove the \n and tabs from the __COPYRIGHT() strings.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base
# 1.55 13-Apr-2008 dholland

branches: 1.55.4;
'_' is functionally alphanumeric in many contexts, including login names.
Since it doesn't have case, treat it like a digit. While here, avoid
setting the associated flag variable by incrementing it.
Fixes PR bin/33521; patch based on one from Dieter Roelants.


Revision tags: keiichi-mipv6-base matt-armv6-nbase
# 1.54 04-Mar-2008 dholland

Sort includes, removing duplicate <time.h>.


Revision tags: cube-autoconf-base matt-armv6-base hpcarm-cleanup-base
# 1.53 03-Dec-2007 isaki

branches: 1.53.4;
white space fix.


Revision tags: matt-armv6-prevmlocking matt-mips64-base
# 1.52 17-Jan-2007 hubertf

branches: 1.52.4;
Remove duplicated #includes and some trailing whitespace while here.
From Slava Semushin <slava.semushin@gmail.com>


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base netbsd-4-base
# 1.51 16-Nov-2006 christos

pass lint


Revision tags: abandoned-netbsd-4-base
# 1.50 28-Dec-2005 christos

PR/25605: Frank Kardel: getty leaves ttymodes at read login state when
exec-ing pppd. Fixed as suggested.


# 1.49 10-Sep-2005 elad

Don't chown/unlink uninitialized lockfile if not uugetty.
From Dr. Wolfgang Stukenbrock, PR/31040.


# 1.48 01-Jun-2005 lukem

Ensure rval is initialized before we try to check it; it won't be set
if AL or NN are in use.
Detected with gcc -Wuninitialized.


# 1.47 17-Mar-2005 christos

print ptyfs ptys properly.


Revision tags: netbsd-3-base
# 1.46 05-Nov-2004 dsl

branches: 1.46.2;
Add (unsigned char) cast to ctype functions


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.45 07-Aug-2003 agc

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22284, verified by myself.


# 1.44 20-May-2003 thorpej

Add a "nn" (no name) capability to getty. If set in gettytab, getty
will not prompt for a login name, and will not pass one along to the
login program. This can be used to accomodate login programs that have
an alternate way of selecting the user to log in.


# 1.43 17-May-2003 itojun

use strlcpy


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 fvdl_fs64_base netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.42 14-Dec-2001 christos

PR/14941: David Querbach: add support for non-standard MS-Windows PPP client.


# 1.41 10-Nov-2001 thorpej

ANSI'ify.


# 1.40 10-Nov-2001 thorpej

Const'ify partab[].


# 1.39 02-Nov-2001 christos

Update to the new t_agetstr() API.


# 1.38 19-Feb-2001 cgd

convert to use getprogname()


# 1.37 04-Feb-2001 christos

remove redundant decls
fix nested extern


# 1.36 10-Jan-2001 lukem

- don't use LOG_ODELAY; it's the default
- use LOG_WARNING (instead of LOG_ERR) for non-fatal errors


# 1.35 28-Dec-2000 sommerfeld

Add new :cs: modifier to gettytab which clears the screen using the
appropriate control sequence from termcap (based on the terminal type
listed in /etc/ttys for the line).


# 1.34 08-Oct-2000 bjh21

Clean-up of grotty SCCS workaround. It's now almost not grotty at all.
This is the last part of PR bin/10049.


# 1.33 08-Oct-2000 bjh21

Don't run over the end of the banner buffer if it ends with '%'.
From PR bin/10049


# 1.32 19-Sep-2000 mjl

Use strlcpy/strlcat instead of strn* plus manual termination.
Use sizeof() instead of hardcoded length. Clean up NULL vs 0
confusion. sizeof(char) is 1, really.


Revision tags: netbsd-1-5-ALPHA2 netbsd-1-5-base minoura-xpg4dl-base
# 1.31 14-Jan-2000 ad

branches: 1.31.4;
- Either QVT/Term or the NT 'clipboard' converts tabs to spaces. I pasted in
some code via QVT/Term. Sigh. Fix it.
- Teeny KNF nit.


# 1.30 04-Jan-2000 ad

Add two new capabilities to gettytab - idea from FreeBSD:
al - user to auto-login as
if - banner file to display, like /etc/issue


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.29 15-Dec-1999 drochner

add one byte to the username character array and make sure the string
passed to "login" is '\0'-terminated


Revision tags: comdex-fall-1999-base netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.28 15-Jan-1999 kml

branches: 1.28.2; 1.28.6;
Ensure that all of the initial message (im=) gets flushed to the
screen; previously, the last buffer worth of text would fail
to be printed.


# 1.27 12-Oct-1998 tsarna

Add PPP autodetect, based on code from FreeBSD via OpenBSD.


# 1.26 06-Jul-1998 mrg

- use an array MAXHOSTNAMELEN+1 size to hold hostnames
- ensure hostname from gethostname() is nul-terminated in all cases
- minor KNF
- use MAXHOSTNAMELEN over various other values/defines
- be safe will buffers that hold hostnames


# 1.25 30-Mar-1998 mrg

remove register.


# 1.24 18-Nov-1997 thorpej

Const'ify some things, rename local puts() to xputs(), since it has
a different prototype than the one in <stdio.h>


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base
# 1.23 19-Oct-1997 cjs

Add uugetty capability.


# 1.22 06-Aug-1997 mikel

use <sys/cdefs.h> __COPYRIGHT() and __RCSID() macros
prototype internal functions and eliminate old function declarations
misc cleanup (gcc -Wall) and KNF


# 1.21 06-Aug-1997 mikel

don't include <signal.h> twice


# 1.20 29-Apr-1997 tls

fix a couple of unlikely buffer overflows.


# 1.19 14-Nov-1996 gwr

After the chown(ttyn, 0, 0), call ttyaction(ttyn, "getty", "root")


# 1.18 31-Jul-1996 thorpej

RCS id police.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.17 15-May-1996 jtc

Updated to use <util.h>.
From Greg Hudson <ghudson@MIT.EDU>.


# 1.16 08-Feb-1996 mycroft

Make sure that the user name cannot ever be interpreted as an option to
login(8). Note: This does *not* fix any security holes.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.15 13-Aug-1995 cgd

log open failure every 10th try (that was the old behaviour) UNLESS
the error is ENXIO and it's already been logged. (this allows people
to leave getty's running on nonexistent devices without filling their
syslog. while it's arguable that that might not be a good idea, i've
found it to be _very_ useful, because it allows me to rdist /etc/ttys.)


# 1.14 19-Jun-1995 jtc

sys/termios.h -> termios.h


# 1.13 18-Sep-1994 mycroft

Fix typo in date format.


# 1.12 05-Sep-1994 pk

Use tcflush().


# 1.11 05-Sep-1994 pk

Set control flags properly while in read mode.
Supply process ID when syslogging.


# 1.10 24-Aug-1994 mycroft

Fix pad insertion for termios.


# 1.9 24-Aug-1994 mycroft

branches: 1.9.2;
Use cfset[io]speed() to set termios speeds, per POSIX.


# 1.8 17-Aug-1994 pk

Cleanup import, merge local changes.


Revision tags: netbsd-1-0-base
# 1.7 28-Apr-1994 pk

Towards termios.


# 1.6 17-Mar-1994 pk

TIOCFLUSH requires argument


# 1.5 09-Mar-1994 cgd

fix bin/140: use getcap(3) routines


# 1.4 08-Mar-1994 mycroft

We don't need or want set_ttydefaults().


# 1.3 29-Aug-1993 mycroft

Add some more magic cookies for the `im' string to display info from
uname(2):

%s sysname
%r release
%v version
%m machine


# 1.2 01-Aug-1993 mycroft

Add RCS identifiers.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision