dave@utcsrgv.UUCP (Dave Sherman) (10/17/84)
OK, I wanna do this the *right* way. We have students accessing our machine through various routes: hardwired terminals, dialups, and through our Datapac PAD. When they're on through the PAD, they don't get echoing from UNIX, because packets are only transmitted when they press CR. I therefore have the PAD set up to signal the remote PAD (where they're dialed into) to turn on echoing. In other words, echoing is coming from the PAD the user is talking to, not from UNIX. Now, I want to turn off echoing occasionally, most notably when prompting for a password. It's easy to do; I just have to send an obscure sequence down the line to indicate to the PAD that the remote parameter should be changed. Question is, where do I do it? 1. In the kernel: whenever echoing is turned off, and the line is hooked up to the PAD [how do we know?], send out the sequence. 2. In stty.c/ioctl.c, which implements the system call in C: when turning off echoing is a parameter [requires knowing whether it was on previously], send out the sequence, if we can tell from a system file like /etc/ttys that the line we're changing is hooked up to the PAD. 3. In getpass(3), which is a stdio routine which turns off echoing in the conventional way: if the line is indicated in /etc/ttys or /etc/PADttys as hooked up to the PAD, then instead of stty'ing to turn off echoing, send out the sequence. 4. In login.c, passwd.c and anywhere in my applications programs where I might want to turn off echoing. See the problem? It's easy to install in login.c, but then the next time I write a program which wants to turn off echoing, I have to do the code over again. Yet putting it deeper down, in stty(2) or in the kernel, is unportable and dangerous. Should I just write echooff() and echoon(), install them in /lib/libc.a and change getpass() to call these routines? This is on v7 on a Perkin-Elmer 3220 (not that it makes any difference). Dave Sherman The Law Society of Upper Canada {decvax,ihnp4}!utzoo!lsuc!dave [since utcsrgv will be down all next week] -- { allegra cornell decvax ihnp4 linus utzoo }!utcsrgv!dave