summaryrefslogtreecommitdiffstats
path: root/libexec/getty
diff options
context:
space:
mode:
authornaddy <naddy@openbsd.org>2013-12-10 20:56:59 +0000
committernaddy <naddy@openbsd.org>2013-12-10 20:56:59 +0000
commit357622f1f3696eb4b89137fc2718cc19e41b7840 (patch)
tree8f008147164d39869691f43e75ed171ad8075fa4 /libexec/getty
parentDisable the USE_OLD_TTY hack that re-encoded termios Bnnn speeds (diff)
downloadwireguard-openbsd-357622f1f3696eb4b89137fc2718cc19e41b7840.tar.xz
wireguard-openbsd-357622f1f3696eb4b89137fc2718cc19e41b7840.zip
Drop the f0, f1, f2 gettytab capabilities that were used to poke
magic numbers into sgttyb. The "modern" replacement for f# is the set of i#, o#, c#, l# to poke magic numbers into termios. ok miod@
Diffstat (limited to 'libexec/getty')
-rw-r--r--libexec/getty/gettytab.520
-rw-r--r--libexec/getty/gettytab.h58
-rw-r--r--libexec/getty/init.c5
-rw-r--r--libexec/getty/subr.c163
4 files changed, 33 insertions, 213 deletions
diff --git a/libexec/getty/gettytab.5 b/libexec/getty/gettytab.5
index 5fca3ec3989..c20245edd94 100644
--- a/libexec/getty/gettytab.5
+++ b/libexec/getty/gettytab.5
@@ -1,4 +1,4 @@
-.\" $OpenBSD: gettytab.5,v 1.21 2011/09/03 23:40:16 jmc Exp $
+.\" $OpenBSD: gettytab.5,v 1.22 2013/12/10 20:56:59 naddy Exp $
.\" Copyright (c) 1983, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
@@ -28,7 +28,7 @@
.\"
.\" from: @(#)gettytab.5 8.4 (Berkeley) 4/19/94
.\"
-.Dd $Mdocdate: September 3 2011 $
+.Dd $Mdocdate: December 10 2013 $
.Dt GETTYTAB 5
.Os
.Sh NAME
@@ -93,9 +93,6 @@ after login prompt.
.Pq Dv EOF
character.
.It ev Ta str Ta Dv NULL Ta "Initial environment."
-.It f0 Ta num Ta unused Ta "TTY mode flags to write messages."
-.It f1 Ta num Ta unused Ta "TTY mode flags to read login name."
-.It f2 Ta num Ta unused Ta "TTY mode flags to leave terminal as."
.It fl Ta str Ta So Li ^O Sc Ta "Output flush character."
.It hc Ta bool Ta false Ta "\&Do"
.Em not
@@ -161,6 +158,9 @@ The following capabilities are no longer supported by
.It bd Ta num Ta 0 Ta "Backspace delay."
.It cb Ta bool Ta false Ta "Use CRT backspace mode."
.It cd Ta num Ta 0 Ta "Carriage-return delay."
+.It f0 Ta num Ta unused Ta "TTY mode flags to write messages."
+.It f1 Ta num Ta unused Ta "TTY mode flags to read login name."
+.It f2 Ta num Ta unused Ta "TTY mode flags to leave terminal as."
.It fd Ta num Ta 0 Ta "Form-feed (vertical motion) delay."
.It nd Ta num Ta 0 Ta "Newline (line-feed) delay."
.It uc Ta bool Ta false Ta "Terminal is known upper case only."
@@ -205,16 +205,6 @@ and
.Em c_oflag
fields, respectively.
Each of these sets must be completely specified to be effective.
-The
-.Em \&f0 ,
-.Em \&f1 ,
-and
-.Em \&f2
-are excepted for backwards compatibility with a previous incarnation of
-the TTY subsystem.
-In these flags the bottom 16 bits of the (32 bits) value contain the sgttyb
-.Em sg_flags
-field, while the top 16 bits represent the local mode word.
.Pp
Should
.Xr getty 8
diff --git a/libexec/getty/gettytab.h b/libexec/getty/gettytab.h
index fa77a9b99c5..1decf65c557 100644
--- a/libexec/getty/gettytab.h
+++ b/libexec/getty/gettytab.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: gettytab.h,v 1.6 2003/06/02 19:38:24 millert Exp $*/
+/* $OpenBSD: gettytab.h,v 1.7 2013/12/10 20:56:59 naddy Exp $*/
/*
* Copyright (c) 1983, 1993, 1994
@@ -96,37 +96,31 @@ struct gettyflags {
#define FD gettynums[6].value
#define BD gettynums[7].value
#define TO gettynums[8].value
-#define F0 gettynums[9].value
-#define F0set gettynums[9].set
-#define F1 gettynums[10].value
-#define F1set gettynums[10].set
-#define F2 gettynums[11].value
-#define F2set gettynums[11].set
-#define PF gettynums[12].value
-#define C0 gettynums[13].value
-#define C0set gettynums[13].set
-#define C1 gettynums[14].value
-#define C1set gettynums[14].set
-#define C2 gettynums[15].value
-#define C2set gettynums[15].set
-#define I0 gettynums[16].value
-#define I0set gettynums[16].set
-#define I1 gettynums[17].value
-#define I1set gettynums[17].set
-#define I2 gettynums[18].value
-#define I2set gettynums[18].set
-#define L0 gettynums[19].value
-#define L0set gettynums[19].set
-#define L1 gettynums[20].value
-#define L1set gettynums[20].set
-#define L2 gettynums[21].value
-#define L2set gettynums[21].set
-#define O0 gettynums[22].value
-#define O0set gettynums[22].set
-#define O1 gettynums[23].value
-#define O1set gettynums[23].set
-#define O2 gettynums[24].value
-#define O2set gettynums[24].set
+#define PF gettynums[9].value
+#define C0 gettynums[10].value
+#define C0set gettynums[10].set
+#define C1 gettynums[11].value
+#define C1set gettynums[11].set
+#define C2 gettynums[12].value
+#define C2set gettynums[12].set
+#define I0 gettynums[13].value
+#define I0set gettynums[13].set
+#define I1 gettynums[14].value
+#define I1set gettynums[14].set
+#define I2 gettynums[15].value
+#define I2set gettynums[15].set
+#define L0 gettynums[16].value
+#define L0set gettynums[16].set
+#define L1 gettynums[17].value
+#define L1set gettynums[17].set
+#define L2 gettynums[18].value
+#define L2set gettynums[18].set
+#define O0 gettynums[19].value
+#define O0set gettynums[19].set
+#define O1 gettynums[20].value
+#define O1set gettynums[20].set
+#define O2 gettynums[21].value
+#define O2set gettynums[21].set
/*
* Boolean values.
diff --git a/libexec/getty/init.c b/libexec/getty/init.c
index 822218f9538..2e36cb2a330 100644
--- a/libexec/getty/init.c
+++ b/libexec/getty/init.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: init.c,v 1.8 2010/06/07 02:01:45 guenther Exp $ */
+/* $OpenBSD: init.c,v 1.9 2013/12/10 20:56:59 naddy Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -80,9 +80,6 @@ struct gettynums gettynums[] = {
{ "fd" }, /* form-feed delay */
{ "bd" }, /* backspace delay */
{ "to" }, /* timeout */
- { "f0" }, /* output flags */
- { "f1" }, /* input flags */
- { "f2" }, /* user mode flags */
{ "pf" }, /* delay before flush at 1st prompt */
{ "c0" }, /* output c_flags */
{ "c1" }, /* input c_flags */
diff --git a/libexec/getty/subr.c b/libexec/getty/subr.c
index 83b57191f22..14d0faf563f 100644
--- a/libexec/getty/subr.c
+++ b/libexec/getty/subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr.c,v 1.20 2013/04/21 04:25:49 deraadt Exp $ */
+/* $OpenBSD: subr.c,v 1.21 2013/12/10 20:56:59 naddy Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -32,7 +32,6 @@
/*
* Melbourne getty.
*/
-#define COMPAT_43
#include <sys/ioctl.h>
#include <stdlib.h>
#include <unistd.h>
@@ -174,29 +173,6 @@ setflags(int n)
{
tcflag_t iflag, oflag, cflag, lflag;
-#ifdef COMPAT_43
- switch (n) {
- case 0:
- if (F0set) {
- compatflags(F0);
- return;
- }
- break;
- case 1:
- if (F1set) {
- compatflags(F1);
- return;
- }
- break;
- default:
- if (F2set) {
- compatflags(F2);
- return;
- }
- break;
- }
-#endif
-
switch (n) {
case 0:
if (C0set && I0set && L0set && O0set) {
@@ -347,143 +323,6 @@ out:
tmode.c_lflag = lflag;
}
-#ifdef COMPAT_43
-/*
- * Old TTY => termios, snatched from <sys/kern/tty_compat.c>
- */
-void
-compatflags(long flags)
-{
- tcflag_t iflag, oflag, cflag, lflag;
-
- iflag = BRKINT|ICRNL|IMAXBEL|IXON|IXANY;
- oflag = OPOST|ONLCR|OXTABS;
- cflag = CREAD;
- lflag = ICANON|ISIG|IEXTEN;
-
- if (ISSET(flags, TANDEM))
- SET(iflag, IXOFF);
- else
- CLR(iflag, IXOFF);
- if (ISSET(flags, ECHO))
- SET(lflag, ECHO);
- else
- CLR(lflag, ECHO);
- if (ISSET(flags, CRMOD)) {
- SET(iflag, ICRNL);
- SET(oflag, ONLCR);
- } else {
- CLR(iflag, ICRNL);
- CLR(oflag, ONLCR);
- }
- if (ISSET(flags, XTABS))
- SET(oflag, OXTABS);
- else
- CLR(oflag, OXTABS);
- if (ISSET(flags, LCASE)) {
- SET(iflag, IUCLC);
- SET(oflag, OLCUC);
- SET(lflag, XCASE);
- }
- else {
- CLR(iflag, IUCLC);
- CLR(oflag, OLCUC);
- CLR(lflag, XCASE);
- }
-
-
- if (ISSET(flags, RAW)) {
- iflag &= IXOFF;
- CLR(lflag, ISIG|ICANON|IEXTEN|XCASE);
- CLR(cflag, PARENB);
- } else {
- SET(iflag, BRKINT|IXON|IMAXBEL);
- SET(lflag, ISIG|IEXTEN);
- if (ISSET(iflag, IUCLC) && ISSET(oflag, OLCUC))
- SET(lflag, XCASE);
- if (ISSET(flags, CBREAK))
- CLR(lflag, ICANON);
- else
- SET(lflag, ICANON);
- switch (ISSET(flags, ANYP)) {
- case 0:
- CLR(cflag, PARENB);
- break;
- case ANYP:
- SET(cflag, PARENB);
- CLR(iflag, INPCK);
- break;
- case EVENP:
- SET(cflag, PARENB);
- SET(iflag, INPCK);
- CLR(cflag, PARODD);
- break;
- case ODDP:
- SET(cflag, PARENB);
- SET(iflag, INPCK);
- SET(cflag, PARODD);
- break;
- }
- }
-
- /* Nothing we can do with CRTBS. */
- if (ISSET(flags, PRTERA))
- SET(lflag, ECHOPRT);
- else
- CLR(lflag, ECHOPRT);
- if (ISSET(flags, CRTERA))
- SET(lflag, ECHOE);
- else
- CLR(lflag, ECHOE);
- /* Nothing we can do with TILDE. */
- if (ISSET(flags, MDMBUF))
- SET(cflag, MDMBUF);
- else
- CLR(cflag, MDMBUF);
- if (ISSET(flags, NOHANG))
- CLR(cflag, HUPCL);
- else
- SET(cflag, HUPCL);
- if (ISSET(flags, CRTKIL))
- SET(lflag, ECHOKE);
- else
- CLR(lflag, ECHOKE);
- if (ISSET(flags, CTLECH))
- SET(lflag, ECHOCTL);
- else
- CLR(lflag, ECHOCTL);
- if (!ISSET(flags, DECCTQ))
- SET(iflag, IXANY);
- else
- CLR(iflag, IXANY);
- CLR(lflag, TOSTOP|FLUSHO|PENDIN|NOFLSH);
- SET(lflag, ISSET(flags, TOSTOP|FLUSHO|PENDIN|NOFLSH));
-
- if (ISSET(flags, RAW|LITOUT|PASS8)) {
- CLR(cflag, CSIZE);
- SET(cflag, CS8);
- if (!ISSET(flags, RAW|PASS8))
- SET(iflag, ISTRIP);
- else
- CLR(iflag, ISTRIP);
- if (!ISSET(flags, RAW|LITOUT))
- SET(oflag, OPOST);
- else
- CLR(oflag, OPOST);
- } else {
- CLR(cflag, CSIZE);
- SET(cflag, CS7);
- SET(iflag, ISTRIP);
- SET(oflag, OPOST);
- }
-
- tmode.c_iflag = iflag;
- tmode.c_oflag = oflag;
- tmode.c_cflag = cflag;
- tmode.c_lflag = lflag;
-}
-#endif
-
#ifdef XXX_DELAY
struct delayval {
unsigned int delay; /* delay in ms */