From: bruce@blilly.UUCP (Bruce Lilly)
Subject: Re: replacement for uugetty? [was: Re: HELP! Netfax 3.2 on SVR3.2]
Organization: Bruce Lilly
Date: Tue, 15 Sep 92 00:06:29 GMT

In article <BuKzE9.G0D@hico2.westmark.com> query@hico2.westmark.com wrote:
>
>Not that I know much about getty, but I suspect that switching
>to different services on the fly based on
>--> incoming connection messages from the modem <--
>will require much smarter serial port handling.
>
>I know my trailblazer won't work very well with my uucp
>if I have incoming status messages turned on, because
>of the "babbling to itself" problem that sometimes occurs when 
>the system starts mistaking modem return codes for login attempts.
>
>I can't expect a fax machine calling in to log in to an
>appropriate user account, and I'd sure like to use
>a combined fax modem for bi-directional modem and fax service
>at the same time.  It'd make sense not to have to pay for extra modems
>or phone lines.
>
[...]
>
>Any thoughts out there about this?

getty (and uugetty) does switch to different services (a.k.a.
login "shells") depending on incoming messages from
communications ports--namely the login/password combination.
UUCP logins get uucico, user logins get a shell.

You *might* be able to cure the "babbling" problem by setting up
an account that sends an appropriate initialization sequence to
the modem after receiving some sequence from the modem (status
messages, or echoes of the login/password prompts (keeping in
mind that only the first word is likely to be significant to
/bin/login (others are placed in the environment[*]))).

Similarly, depending on the exact sequence(s) sent by the modem,
you *might* be able to set up accounts to run appropriate
programs.

Some things to watch out for:
1)	tty modes set to a strange state if your modem insists
	on sending all upper-case characters
2)	whether or not you have dialup password checking turned
	on
3)	optional flags supplied to uugetty (e.g. -r)
4)	handling failed logins due to "babbling" (i.e. handling
	the difference (if any) between the login prompt issued
	by getty and the "login: " issued by /bin/login after a
	failed login attempt (your mileage may vary)). Also the
	"Login incorrect" and other possible messages (e.g. see #2
	above) which may be emitted by /bin/login.
5)	anything stored in /etc/issue
6)	anything stored in /etc/motd
7)	anything peculiar about getty, login, init... on your
	machine

Detailed explanations of the operation of getty can be found in
the man pages for getty(1M), uugetty(1M), login(1), and
gettydefs(4) (sorry, you need at least three manuals to
understand the process :-).  Basically, getty (or uugetty)
issues the login prompt and collects the response which is
passed to /bin/login. /bin/login then prompts for the password,
encrypts the password and compares the encrypted password thus
obtained to the encrypted password stored in /etc/passwd (or a
reasonable facsimile thereof). If they match, login runs
/etc/profile, spits out anything in /etc/motd, then the shell
specified in /etc/passwd for the login name used is exec'ed (if
not, /bin/login prompts again for a "login: "/"Password: "
combination). See the man pages (and experiment a little) to
understand the details.

*	this could be useful if the login "shell" examines the
environment to determine what "service" is appropriate.
-- 
	Bruce Lilly		blilly!bruce@Broadcast.Sony.COM
					...uunet!sonyusa!sonyd1!blilly!bruce