tags 156242 patch
thanks

The following patch makes the username-in-upper-case feature optional.

I have chosen to make it default to off since this feature was designed
to cater for serial terminals that were last sold almost 30 years ago,
thus the likelyhood that anyone will need this feature turned on is
vanishingly small.

Hamish.


diff -ur orig/util-linux-2.13.1/login-utils/agetty.8 
util-linux-2.13.1/login-utils/agetty.8
--- orig/util-linux-2.13.1/login-utils/agetty.8 2007-08-27 23:00:34.000000000 
+1000
+++ util-linux-2.13.1/login-utils/agetty.8      2008-02-27 22:40:58.350612010 
+1100
@@ -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 @@
 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 -ur orig/util-linux-2.13.1/login-utils/agetty.c 
util-linux-2.13.1/login-utils/agetty.c
--- orig/util-linux-2.13.1/login-utils/agetty.c 2008-01-16 20:31:41.000000000 
+1100
+++ util-linux-2.13.1/login-utils/agetty.c      2008-02-27 22:56:21.040272811 
+1100
@@ -165,6 +165,7 @@
 #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. */
 
@@ -412,7 +413,7 @@
     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;
@@ -489,6 +490,9 @@
        case 'w':
            op->flags |= F_WAITCRLF;
            break;
+       case 'U':
+           op->flags |= F_LCUC;
+           break;
        default:
            usage();
        }
@@ -1117,7 +1121,7 @@
     }
     /* Handle names with upper case and no lower case. */
 
-    if ((cp->capslock = caps_lock(logname))) {
+    if (((cp->capslock = caps_lock(logname))) && (op->flags & F_LCUC)) {
        for (bp = logname; *bp; bp++)
            if (isupper(*bp))
                *bp = tolower(*bp);             /* map name to lower case */
@@ -1177,7 +1181,7 @@
     }
     /* Account for upper case without lower case. */
 
-    if (cp->capslock) {
+    if (cp->capslock && (op->flags & F_LCUC)) {
        tp->c_iflag |= IUCLC;
        tp->c_lflag |= XCASE;
        tp->c_oflag |= OLCUC;
@@ -1230,7 +1234,7 @@
 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);
 }
 

Attachment: signature.asc
Description: Digital signature

Reply via email to