summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--login-utils/agetty.88
-rw-r--r--login-utils/agetty.c11
2 files changed, 14 insertions, 5 deletions
diff --git a/login-utils/agetty.8 b/login-utils/agetty.8
index 5bde294b9..876137475 100644
--- a/login-utils/agetty.8
+++ b/login-utils/agetty.8
@@ -3,7 +3,7 @@
agetty \- alternative Linux getty
.SH SYNOPSIS
-.BR "agetty " [\-8ihLmnw]
+.BR "agetty " [\-8ihLmnUw]
.RI "[-f " issue_file ]
.RI "[-l " login_program ]
.RI "[-I " init ]
@@ -163,6 +163,12 @@ Force the line to be a local line with no need for carrier detect. This can
be useful when you have a locally attached terminal where the serial line
does not set the carrier detect signal.
.TP
+\-U
+Turn on support for detecting an uppercase only terminal. This setting will
+detect a login name containing only capitals as indicating an uppercase
+only terminal and turn on some upper to lower case conversions. Note that
+this has no support for any unicode characters.
+.TP
\-w
Wait for the user or the modem to send a carriage-return or a
linefeed character before sending the \fI/etc/issue\fP (or other) file
diff --git a/login-utils/agetty.c b/login-utils/agetty.c
index c6c754d49..02de349b6 100644
--- a/login-utils/agetty.c
+++ b/login-utils/agetty.c
@@ -134,6 +134,7 @@ struct options {
#define F_WAITCRLF (1<<5) /* wait for CR or LF */
#define F_CUSTISSUE (1<<6) /* give alternative issue file */
#define F_NOPROMPT (1<<7) /* don't ask for login name! */
+#define F_LCUC (1<<8) /* Support for *LCUC stty modes */
/* Storage for things detected while the login name was read. */
@@ -374,7 +375,7 @@ parse_args(argc, argv, op)
extern int optind; /* getopt */
int c;
- while (isascii(c = getopt(argc, argv, "8I:LH:f:hil:mt:wn"))) {
+ while (isascii(c = getopt(argc, argv, "8I:LH:f:hil:mt:wUn"))) {
switch (c) {
case '8':
op->eightbits = 1;
@@ -451,6 +452,9 @@ parse_args(argc, argv, op)
case 'w':
op->flags |= F_WAITCRLF;
break;
+ case 'U':
+ op->flags |= F_LCUC;
+ break;
default:
usage();
}
@@ -1081,8 +1085,7 @@ char *get_logname(op, cp, tp)
}
}
/* Handle names with upper case and no lower case. */
-
- if ((cp->capslock = caps_lock(logname))) {
+ if ((op->flags & F_LCUC) && (cp->capslock = caps_lock(logname))) {
for (bp = logname; *bp; bp++)
if (isupper(*bp))
*bp = tolower(*bp); /* map name to lower case */
@@ -1197,7 +1200,7 @@ bcode(s)
void
usage()
{
- fprintf(stderr, _("Usage: %s [-8hiLmw] [-l login_program] [-t timeout] [-I initstring] [-H login_host] baud_rate,... line [termtype]\nor\t[-hiLmw] [-l login_program] [-t timeout] [-I initstring] [-H login_host] line baud_rate,... [termtype]\n"), progname);
+ fprintf(stderr, _("Usage: %s [-8hiLmUw] [-l login_program] [-t timeout] [-I initstring] [-H login_host] baud_rate,... line [termtype]\nor\t[-hiLmw] [-l login_program] [-t timeout] [-I initstring] [-H login_host] line baud_rate,... [termtype]\n"), progname);
exit(1);
}