History log of /freebsd-current/libexec/getty/subr.c
Revision Date Author Comments
# a6fe717c 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

libexec: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by: Netflix


# 43581d7b 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

libexec: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by: Netflix


# eba230af 25-Sep-2023 John Baldwin <jhb@FreeBSD.org>

Purge more stray embedded $FreeBSD$ strings

These do not use __FBSDID but instead use bare char arrays.

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D41957


# f285f414 04-Nov-2022 Dag-Erling Smørgrav <des@FreeBSD.org>

getty: code cleanup, part 2

* Clean up whitespace
* Reindent

Sponsored by: Klara, Inc.


# 8ad7a14a 04-Nov-2022 Dag-Erling Smørgrav <des@FreeBSD.org>

getty: code cleanup, part 1

* Avoid unnecessary use of `unsigned char *`
* Use explicit casts when assigning `unsigned char *` to `char *` or vice versa
* Drop unused global variables (and fix memory leak in `gettable()`)
* Use `snprintf()` instead of `strcpy()` + `strcat()`
* Drop spurious braces in switch

Sponsored by: Klara, Inc.
Obtained from: Apple OSS Distributions (in part)
Differential Revision: https://reviews.freebsd.org/D37263


# 8725f0b9 09-May-2021 Xin LI <delphij@FreeBSD.org>

Revert "getty: push assignment to inner block."

This reverts commit c7b8bc367f18210d233b0e2185b5ce0d55c9ccaa.

Pointed out by: trasz


# c7b8bc36 08-May-2021 Xin LI <delphij@FreeBSD.org>

getty: push assignment to inner block.

No functional change.

MFC after: 2 weeks


# 76b71718 01-Dec-2019 Xin LI <delphij@FreeBSD.org>

Simplify code with strlcpy/strlcat.

MFC after: 2 weeks


# 18587b84 21-Feb-2018 Edward Tomasz Napierala <trasz@FreeBSD.org>

Build getty(8) with WARNS=6.

Reviewed by: imp@
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D14197


# 9c33cc93 04-Feb-2018 Edward Tomasz Napierala <trasz@FreeBSD.org>

Sprinkle static; avoid nested externs.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation


# 1776dc9f 04-Feb-2018 Edward Tomasz Napierala <trasz@FreeBSD.org>

Add missing initializer.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation


# 076ec402 04-Feb-2018 Edward Tomasz Napierala <trasz@FreeBSD.org>

Don't cast away the const, it's not been needed since r92925.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation


# 8a16b7a1 20-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

General further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.


# f73ff060 02-Feb-2017 Alexey Dokuchaev <danfe@FreeBSD.org>

Try to fix the old "he capability is stupid" bug in gettytab(5)/getty(8)

There is one capability explicitly documented in gettytab(5) as stupid: he.
And it is indeed. It was meant to facilitate system hostname modification,
but is hardly usable in practice because it allows very limited editing
(e.g., it depends on a particular hostname length, making it non-generic).

Replace it with simple implementation that treats ``he'' as POSIX extended
regular expression which is matched against the hostname. If there are no
parenthesized subexpressions in the pattern, entire matched string is used
as the final hostname. Otherwise, use the first matched subexpression.
If the pattern does not match, the original hostname is not modified.

Using regex(3) gives more freedom, does not complicate the code very much,
and makes a lot more sense, in turn making ``he'' less stupid and actually
useful (e.g., it is now possible to obtain node or domain names from the
original hostname string, without knowing it in advance).

Reviewed by: jilles, manpages (wblock)
Approved by: jilles (implied)
Differential Revision: https://reviews.freebsd.org/D9244


# 7ae7c193 26-Feb-2016 Pedro F. Giffuni <pfg@FreeBSD.org>

Missing tab.

Pointed out by: bapt


# bc13b10e 26-Feb-2016 Pedro F. Giffuni <pfg@FreeBSD.org>

getty(8): Undo incomplete support VEOL2 and VSTATUS.

Forgot to add some definitions for charnames[].


# 73906f57 26-Feb-2016 Pedro F. Giffuni <pfg@FreeBSD.org>

getty(8): Support VEOL2 and VSTATUS

Bring some type cleanups while here.

Obtained from: NetBSD


# a3e4b982 26-Feb-2016 Pedro F. Giffuni <pfg@FreeBSD.org>

getty(8): Use poll(2) and nanosleep(2) instead of select(2).

Sort headers while here.

Obtained from: NetBSD (CVS Rev. 1.25 - 1.26)


# 8f96f18a 29-Apr-2015 Konstantin Belousov <kib@FreeBSD.org>

Remove the #ifdef DEBUG code, which is not compilable on 64bit
architectures. It seems to be an overlooked chunk in the r15645.

PR: 199767
Sponsored by: The FreeBSD Foundation
MFC after: 1 week


# 5efaea4c 17-Feb-2014 Christian Brueffer <brueffer@FreeBSD.org>

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


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# be825f30 25-Jun-2004 Poul-Henning Kamp <phk@FreeBSD.org>

Nuke COMPAT_43


# 95289b27 06-Feb-2002 Warner Losh <imp@FreeBSD.org>

o __P removal
o remove register
o use strict prototypes


# 6e76e16f 24-Apr-2001 Kris Kennaway <kris@FreeBSD.org>

Replace a strcat() with a strlcat(). Partial sync with OpenBSD; more
work is needed.

Submitted by: "Andrew R. Reiter" <arr@watson.org>
Obtained from: OpenBSD


# 21bac31e 28-Jan-2000 Bruce Evans <bde@FreeBSD.org>

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


# 7f3dea24 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$


# ee98a93f 21-Jul-1998 Poul-Henning Kamp <phk@FreeBSD.org>

Getty is missing the speed table entry for 230400 baud.
PR: 7280
Reviewed by: phk
Submitted by: Craig Leres <leres@ee.lbl.gov>


# d748864d 21-Nov-1997 Philippe Charnier <charnier@FreeBSD.org>

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


# 1cc15828 02-Sep-1997 David Nugent <davidn@FreeBSD.org>

Fix botch with escaped characters, go back to using cgetstr().
For escaped characters used in modem strings, use double-backslashes
in gettytab.
PR: 4370


# b92f6bd2 01-Sep-1997 David Nugent <davidn@FreeBSD.org>

Use cgetustr() since we handled special escapes ourselves.
Fix typo in escape parsing function.
PR: 4370
Submitted by: sumii@is.s.u-tokyo.ac.jp


# 33a0249f 02-Aug-1997 Bruce Evans <bde@FreeBSD.org>

Import Lite2's src/libexec, except for makekey (which was spammed
by a repository copy from 1.1.5 and patched back to Lite1) and
rbootd/bootdir/SYSHPBSD (which is binary). All changed files have
already left the vendor branch.


# 04a59e67 11-May-1997 David Nugent <davidn@FreeBSD.org>

Fix memory leak caused by not freeing memory returned by cgetstr()
calls. The cost is a little more up-front memory allocation, but the
effect seems minimal.

Problem noticed-by: bde

Added syslog at LOG_ERR when referencing an unknown gettytab entry
and for other cgetent() failues (circular reference et al).

To be merged into 2.2 after a few days testing.


# 9e522f7a 22-Feb-1997 Peter Wemm <peter@FreeBSD.org>

Revert $FreeBSD$ to $Id$


# fe552114 02-Feb-1997 David Nugent <davidn@FreeBSD.org>

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.


# 1130b656 14-Jan-1997 Jordan K. Hubbard <jkh@FreeBSD.org>

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.


# cae66988 05-May-1996 Joerg Wunsch <joerg@FreeBSD.org>

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


# 712c581c 13-Apr-1996 Joerg Wunsch <joerg@FreeBSD.org>

Import NetBSD's termios'ed getty into a vendor branch.

Obtained from: NetBSD 1.1R


# 9aa70e27 22-Jul-1995 Andrey A. Chernov <ache@FreeBSD.org>

Change hardcoded 15 (which means 38400) to B115200 which is 17


# 6c06b4e2 29-May-1995 Rodney W. Grimes <rgrimes@FreeBSD.org>

Remove trailing whitespace.


# c568fce9 23-Mar-1995 Andrey A. Chernov <ache@FreeBSD.org>

Fix truncating hostname using MAXHOSTNAMELEN
Submitted by: Jan Conard <charly@fachschaften.tu-muenchen.de>


# fef0aded 25-Aug-1994 Jordan K. Hubbard <jkh@FreeBSD.org>

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


# ea022d16 26-May-1994 Rodney W. Grimes <rgrimes@FreeBSD.org>

BSD 4.4 Lite Libexec Sources