[comp.unix.questions] Can't log in right on console to accounts in CAPS.

leisner.henr801c@xerox.com (05/12/91)

I created special accounts (all in CAPS). [on a sun sparcstation II running
SunOS 4.1.1 (B?).  There is no password to these accounts

Logging on via the ethernet does what it expected.

Logging in via the console converts everything it prints to CAPS, does
unexpected things (doesn't change directories right via the passwd file) and
prints lots of characters with a backslash in front of them.

I think the login programs checks for uppercase accounts on consoles (although
I'm not sure).

I'm pretty sure this once worked.  Any ideas?

marty
(Knowledge is useful in the Information Age)
(Software is mindstuff.  It is the hardest activity created by man)

ARPA:	leisner.henr801c@xerox.com
NS:  leisner:henr801c:xerox
UUCP:	hplabs!arisia!leisner

guy@auspex.auspex.com (Guy Harris) (05/13/91)

>I think the login programs checks for uppercase accounts on consoles (although
>I'm not sure).

No, it's "getty" that checks for uppercase accounts; "getty" isn't
involved in "rlogin" or "telnet", which is why, when you log in over the
Ethernet, the system doesn't assume you're stuck with an uppercase-only
terminal, but when you log in on the console, which does involve
"getty", it does.

"getty" does so on most UNIX systems.  The theory is that 1) nobody
would create an account with capital letters on a UNIX system, because
it doesn't buy you much and obliges you to use the shift key to refer to
the name of the account and 2) given that, the system can assume that,
if you type capital letters to "getty"s prompt, it's because you're on
an uppercase-only terminal, in which case it maps the upper-case letters
to lower-case on input and puts the tty driver in "this is an
uppercase-only terminal" mode, which means that upper-case letters typed
on input are turned into lower-case letters (unless preceded by a
backslash), lower-case letters generated on output are turned into
upper-case letters, and upper-case letters generated on output are
preceded with a backslash to distinguish them from lower-case letters. 
In addition, some special characters (e.g., '{' and '}') that are often
not present on upper-case only ("half-ASCII") terminals are also mapped
to '\(' and '\)' on output, and supported on input as '\(' and '\)' as
well.

>I'm pretty sure this once worked.

I'm pretty sure you're mistaken, unless you were running a "getty" that
can have that feature disabled, and had disabled it...

>Any ideas?

Try turning the "lc" capability on in the "/etc/gettytab" entries used
by the console and for all the other "real" terminals on your machine;
it should tell the system that those terminals support lower-case and
that an upper-case letter from that terminal is supposed to be an
upper-case letter.

Or don't create accounts with ALL-CAPS names, as UNIX, as one person
said, "tends not to listen when you shout at it".

gautier@charly.taclog.af.mil (Sgt Richard Gautier) (05/13/91)

Martin:

  Logging in with all CAPS does strange stuff.  How about logging
into the account with all small letters?  That may fix your
problem on Console.  I know that if I log into an account from
home with all CAPS, when the account is all small letters, I get the
same kinds of things that you are getting.  I think Unix is trying to
be SMART and agree with whatever you happen to be doing.

                                  Rich Gautier
gautier@taclg.af.mil

les@chinet.chi.il.us (Leslie Mikesell) (05/13/91)

In article <26859@adm.brl.mil> leisner.henr801c@xerox.com writes:

>Logging in via the console converts everything it prints to CAPS, does
>unexpected things (doesn't change directories right via the passwd file) and
>prints lots of characters with a backslash in front of them.

Others have explained why this happens, but I don't think that anyone
mentioned that you can fix it after the fact with appropriate incantations
to stty.  Under sysV, putting "stty -iuclc -olcuc -xcase" in your .profile
will take care of things even if you logged in in uppercase accidentally.
I trust SunOS has equivalents.

Les Mikesell
  les@chinet.chi.il.us

DAMJAN29588P%BUEF78%yubgef51@pucc.princeton.edu (Aleksandar Damnjanovic) (05/13/91)

 Martin_A._Leisner.Henr801C@XEROX.COM writes:
> I think the login programs checks for uppercase accounts on consoles (although
> I'm not sure).
On *every* UNIX and UNIX-like operating system I've tried,
the getty program maintains a 'feature' that might have been
usefull many years ago, but is just a nuisance nowadays:
if you enter an uppercase username, it assumes you are using
a teletype that doesn't have lowercase characters, and then
it tries to compensate.
So, if you are not prepared to write your own getty, switch
to lowercase usernames!

Mitch_C._Amiano.Henr801h@xerox.com (05/13/91)

>I created special accounts (all in CAPS). [on a sun sparcstation II running
>SunOS 4.1.1 (B?).  There is no password to these accounts
> [other stuff]
>Logging in via the console converts everything it prints to CAPS, does
>unexpected things (doesn't change directories right via the passwd file) and
>prints lots of characters with a backslash in front of them.
>[some more stuff]

I can't say if Sun0S has the capability, but under SCO-Unix/Xenix you could use
the command 'stty -lcase' to fix a login session which had gone into the
uppercase-only state. I used it to allow some VERY unskilled users to log in to
a point of sale system with both upper and lower case versions of the account
name. If SunOS doesn't have that flag, perhaps the capability is buried
somehwhere else.

ken@sugra.uucp (Kenneth Ng) (05/14/91)

In article <1991May12.214724.18394@chinet.chi.il.us>, les@chinet.chi.il.us (Leslie Mikesell) writes:
: In article <26859@adm.brl.mil> leisner.henr801c@xerox.com writes:
: >Logging in via the console converts everything it prints to CAPS, does
: >unexpected things (doesn't change directories right via the passwd file) and
: >prints lots of characters with a backslash in front of them.
: Others have explained why this happens, but I don't think that anyone
: mentioned that you can fix it after the fact with appropriate incantations
: to stty.  Under sysV, putting "stty -iuclc -olcuc -xcase" in your .profile

Or, do a 'stty -lcase'.  This is standard Unix "you just gota know" trivia.
I have yet to find this option in *ANY* man page.

-- 
Kenneth Ng
Please reply to ken@hertz.njit.edu until this machine properly recieves mail.
"No problem, here's how you build it" -- R. Barclay, ST: TNG

guy@auspex.auspex.com (Guy Harris) (05/16/91)

>Under sysV, putting "stty -iuclc -olcuc -xcase" in your .profile

Or your ".login", if you use the C shell (some S5 systems include it;
S5R4 does, and I think S5R3.2 does, and vendors have added it to earlier
systems).

>will take care of things even if you logged in in uppercase accidentally.
>I trust SunOS has equivalents.

SunOS has equivalents; if you're running SunOS 4.x, putting "stty -iuclc
-olcuc -xcase" in your ".profile" or ".rlogin" will take care of things.

So will "stty -lcase", no matter *what* release you're running of SunOS;
it'll also work in S5 (in S5, and in SunOS 4.x, "-lcase" is a
more-convenient shorthand for "-iuclc -olcuc -xcase") and systems (such
as SunOS prior to 4.0) with V7/BSD-flavored "stty" commands.

guy@auspex.auspex.com (Guy Harris) (05/20/91)

>Or, do a 'stty -lcase'.  This is standard Unix "you just gota know" trivia.
>I have yet to find this option in *ANY* man page.

Apparently you're unlucky, then.  From the SunOS 4.0.3 man page:

	...

  Combination Modes

	...

     [-]lcase    Set xcase, iuclc, and olcuc.  With a `-',  unset
                 them.

     [-]LCASE    Same as lcase (-lcase).

Similar things occur in the 4.3-tahoe man page:

	lcase	map upper case to lower case

	-lcase	do not map case

and in just about every *other* UNIX "stty" man page I've seen.

wwm@wa8tzg.mi.org (Bill Meahan) (05/20/91)

In article <7920@auspex.auspex.com> guy@auspex.auspex.com (Guy Harris) writes:
>>Or, do a 'stty -lcase'.  This is standard Unix "you just gota know" trivia.
>>I have yet to find this option in *ANY* man page.
>
>Apparently you're unlucky, then.  From the SunOS 4.0.3 man page:
>
>	...
>
>  Combination Modes
>
>	...
>
>     [-]lcase    Set xcase, iuclc, and olcuc.  With a `-',  unset
>                 them.
>
>     [-]LCASE    Same as lcase (-lcase).
>
>Similar things occur in the 4.3-tahoe man page:
>
>	lcase	map upper case to lower case
>
>	-lcase	do not map case
>
>and in just about every *other* UNIX "stty" man page I've seen.

Might not be true for SYS V derivatives.  On HP-UX, for example, use:
	
	[-]IUCLC	Force upper case to lower case conversion

in BOTH sections of the /etc/gettydefs entry.  WARNING:  Best not have
ANY upper case characters in the password - there will NOT be any
matches!!!!

To turn upper-to-lower case conversion off once the person has logged
in, put a:

	stty -iuclc

in /etc/profile.

NB:  the case of the flags above IS SIGNIFICANT!
-- 
Bill Meahan (WA8TZG)             |   Programming is simple:
wwm@wa8tzg.mi.org  OR            |
uunet!mailrus!sharkey!wa8tzg!wwm |   All you have to do is put the right
"Home for Cybernetic Orphans"    |   numbers in the right memory locations!

kherron@ms.uky.edu (Kenneth Herron) (05/20/91)

On our sequent symmetry (BSD derivative), placing the lc flag in the
appropriate gettytab entry disables the monocase check.  You have to
admit, the idea of monocase terminals is rather archaic...
-- 
Kenneth Herron                                            kherron@ms.uky.edu
University of Kentucky                                       +1 606 257 2975
Department of Mathematics       "So this won't be a total loss, can you make
         it so guys get to throw their mothers-in-law in?"  "Sure, why not?"

gwyn@smoke.brl.mil (Doug Gwyn) (05/21/91)

In article <1991May20.133746.15061@ms.uky.edu> kherron@ms.uky.edu (Kenneth Herron) writes:
>You have to admit, the idea of monocase terminals is rather archaic...

No, we don't have to admit that.  The best interactive Braille terminal
I know of requires monocase support, and works well with traditional
UNIX monocase facilities.

Please don't assume the whole world fits your parochial model, whatever
the topic.  That's the prime cause of cruftiness in system design.

jim@segue.segue.com (Jim Balter) (05/22/91)

In article <1991May19.190950.646@wa8tzg.mi.org> wwm@wa8tzg.mi.org (Bill Meahan) writes:
>In article <7920@auspex.auspex.com> guy@auspex.auspex.com (Guy Harris) writes:
>>     [-]lcase    Set xcase, iuclc, and olcuc.  With a `-',  unset
>>                 them.
>
>Might not be true for SYS V derivatives.  On HP-UX, for example, use:
>	
>	[-]IUCLC	Force upper case to lower case conversion

Sure, why RTFM when you can guess and misinform instead?  lcase is in SysV
and in HP-UX.  Since, as Guy pointed out, it is a combination mode, only
turning off iuclc when lcase was on will leave you with olcuc and xcase on,
which is not likely to be what you want.

guy@auspex.auspex.com (Guy Harris) (05/23/91)

>>     [-]lcase    Set xcase, iuclc, and olcuc.  With a `-',  unset
>>                 them.

...

>Might not be true for SYS V derivatives.

Hate to tell you this, but the "stty" in SunOS 4.0.3 *is* a derivative of
the S5R3 one....

>On HP-UX, for example, use:
>	
>	[-]IUCLC	Force upper case to lower case conversion
>
>in BOTH sections of the /etc/gettydefs entry.

That's "/etc/gettydefs", not "stty".  The two aren't the same, and I was
discussing the "stty" command.

In addition, ihe "I" in "IUCLC" indicates that it's one of the "i"nput
flags; it affects *only* input, *not* output.  Upper-case-only terminals
generally want to run with "IUCLC" (to map upper-case to lower-case on
input), "OLCUC" (to map lower-case to upper-case on output), and "XCASE"
(to cause upper-case characters to be mapped to '\' followed by the
character on output, and cause '\' followed by that character to be
mapped to an upper-case character on input; this also works for some
special characters such as "{" == "\(").

>To turn upper-to-lower case conversion off once the person has logged
>in, put a:
>
>	stty -iuclc

As with "-IUCLC" in "/etc/gettydefs", so with "stty -iuclc"; that just
affects input, not output, and doesn't do all you want on input.

>NB:  the case of the flags above IS SIGNIFICANT!

Yes, but S5's "stty" accepts both "lcase"/"-lcase" and "LCASE"/"-LCASE";
if, as is supposed to be the case, "STTY" is a link to "stty", it means
that even if you have an upper-case only terminal but *don't* have the
flags in question turned on, you can do "STTY LCASE" and turn them on.

wwm@wa8tzg.mi.org (Bill Meahan) (05/24/91)

In article <7979@auspex.auspex.com> guy@auspex.auspex.com (Guy Harris) writes:
>>>     [-]lcase    Set xcase, iuclc, and olcuc.  With a `-',  unset
>>>                 them.
>
>...
>
>>Might not be true for SYS V derivatives.
>
>Hate to tell you this, but the "stty" in SunOS 4.0.3 *is* a derivative of
>the S5R3 one....
>

HP-UX is a Sys V R ***2*** derivative :-(

>>On HP-UX, for example, use:
>>	
>>	[-]IUCLC	Force upper case to lower case conversion
>>
>>in BOTH sections of the /etc/gettydefs entry.
>
>That's "/etc/gettydefs", not "stty".  The two aren't the same, and I was
>discussing the "stty" command.
>
>In addition, ihe "I" in "IUCLC" indicates that it's one of the "i"nput
>flags; it affects *only* input, *not* output.  Upper-case-only terminals
>generally want to run with "IUCLC" (to map upper-case to lower-case on
>input), "OLCUC" (to map lower-case to upper-case on output), and "XCASE"
>(to cause upper-case characters to be mapped to '\' followed by the
>character on output, and cause '\' followed by that character to be
>mapped to an upper-case character on input; this also works for some
>special characters such as "{" == "\(").
>

Sometimes true, sometimes not.  For example, an HP3082 Industrial Touch
terminal has a built-in sealed 'keyboard' which generates upper-case
only characters.  An external HPHIL keyboard allows both upper and lower
case characters.  The screen will display anything.  Out in the factory,
it makes no sense to use the external keyboard, especially if the 3082
is hung on one of the building columns.  But how then to log in to a
UNIX system WITHOUT getting the \W\H\A\T\E\V\E\R blues.  Does BAD things
to curses-based forms :-)

In such applications, it may not be necessary to do the 'stty -iuclc'
trick, depending upon whether or not there is a need to generate UPPER
case data (say a part number) and whether or not the application
software 'cares' about what's entered.

As with most of life, which of several solutions you use may well depend
on individual circumstances.


BTW, the IUCLC/stty -iuclc approach is useful as well for public
terminals where the previous user may have accidentally left the
CAPS_LOCK key engaged.  At least this lets the user get logged in
without problems (assuming no upper-case characters in the password).

No argument with your approach, just one more way of doing things that
might be appropriate under certain circumstances.
-- 
Bill Meahan (WA8TZG)             |   Programming is simple:
wwm@wa8tzg.mi.org  OR            |
uunet!mailrus!sharkey!wa8tzg!wwm |   All you have to do is put the right
"Home for Cybernetic Orphans"    |   numbers in the right memory locations!

guy@auspex.auspex.com (Guy Harris) (05/27/91)

>HP-UX is a Sys V R ***2*** derivative :-(

So?  It should *still* have "stty -lcase".

>>Upper-case-only terminals generally want to run with "IUCLC" ...,
>>"OLCUC" ..., and "XCASE" ....
>
>Sometimes true, sometimes not.

Usually true, occasionally not.  Most "upper-case-only" terminals really
*are* upper-case-only; the HP terminal in question is a bit of an
exception, in that in its "default" configuration it limits input but
not output.

>BTW, the IUCLC/stty -iuclc approach is useful as well for public
>terminals where the previous user may have accidentally left the
>CAPS_LOCK key engaged.  At least this lets the user get logged in
>without problems (assuming no upper-case characters in the password).

If the user accidentally left the CAPS LOCK key engaged, "getty" will
see all upper-case letters when the user types their user name, and will
not only set IUCLC, it'll set OLCUC and XCASE as well, which means "stty
-iuclc" won't fix everything; "stty -lcase", however, will.