[comp.unix.i386] Locking Virtual Terminals

gkm@cbnewsh.ATT.COM (gary.k.mc nees) (02/09/90)

I have a locking program which will lock any particular virtual terminal.
However, all one has to do to get in is to key to another vt which is not
locked.  Its too much to lock all of them. Does anyone know how to securly
lock the PC when the vtlmgr is running?  Is there a way to keep the ALT
key from being recognized? Any ideas? Has anyone written a program to lock
one terminal when one has several terminals running and prevent access to
other terminals?
Any help will be greatly appriciated. Thank you Larry Cambell for the program
for vt access using ALT-Fn.

Sincerely Gary McNees att.com!erebus!gkmpc!gkm

wsinpdb@eutws1.win.tue.nl (Paul de Bra) (02/13/90)

In article <8030@cbnewsh.ATT.COM> gkm@cbnewsh.ATT.COM (gary.k.mc nees,ho,) writes:
>I have a locking program which will lock any particular virtual terminal.
>However, all one has to do to get in is to key to another vt which is not
>locked.  Its too much to lock all of them. Does anyone know how to securly
>lock the PC when the vtlmgr is running?  Is there a way to keep the ALT
>key from being recognized? Any ideas? Has anyone written a program to lock
>one terminal when one has several terminals running and prevent access to
>other terminals?

The key to the solution is in kd(7).
One can set the vt-mode so the switching between vt's is disabled.
Try something like:
    vtmode.mode = VT_PROCESS;
    vtmode.waitv = 1;
    vtmode.relsig = SIGUSR1;
    vtmode.acqsig = SIGUSR1;
    vtmode.frsig = SIGUSR2;
    if (ioctl(egafd, VT_SETMODE, &vtmode) < 0)
      fprintf(stderr,"Warning, cannot set VT mode\n");
    signal(SIGUSR1, donothing);
    ...

Paul.
(debra@research.att.com)