From owner-freebsd-hackers Fri Apr 20 0:32:17 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from bazooka.unixfreak.org (bazooka.unixfreak.org [63.198.170.138]) by hub.freebsd.org (Postfix) with ESMTP id E905E37B43E for ; Fri, 20 Apr 2001 00:32:14 -0700 (PDT) (envelope-from dima@unixfreak.org) Received: from spike.unixfreak.org (spike [63.198.170.139]) by bazooka.unixfreak.org (Postfix) with ESMTP id 93BD43E09; Fri, 20 Apr 2001 00:32:14 -0700 (PDT) To: Dan Nelson Cc: hackers@FreeBSD.ORG Subject: Re: Restricting the console to one vty (patch) In-Reply-To: <20010418092731.B733@dan.emsphone.com>; from dnelson@emsphone.com on "Wed, 18 Apr 2001 09:27:31 -0500" Date: Fri, 20 Apr 2001 00:32:14 -0700 From: Dima Dorfman Message-Id: <20010420073214.93BD43E09@bazooka.unixfreak.org> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Dan Nelson writes: > In the last episode (Apr 18), Dima Dorfman said: > > Attached is a patch that makes it possible to restrict (``freeze'') > > the console to a single vty (the active one). This can be used in > > conjunction with, e.g., lock(1) to setup a relative safeguard against > > malicious access while the user is away from his terminal (lock(1) > > alone doesn't help unless the user wants to do it for every vty he's > > logged into, which quickly gets repetitive). I believe this would be > > especially useful for laptops. > > Isn't there already support for this? > > [ snip definition of struct vt_mode ] > > If you call VT_SETMODE and tell the console that screen switching is > VT_PROCESS, that will disable VTY switching (libvgl sets this so it can > disable graphics mode when the user wants to switch screens). It doesn't do quite what's needed in this case. This mechanism is intended to notify processes when the user wants to switch screens, not to allow the process to stop the switch. It can be used that way, but 1) the process must be in the foreground on that terminal, so if it is used it'd have to be built into lock(1) or some such; and 2) if you do try to switch the screen while it's active, weird stuff starts happening; e.g., all input to the program running stops for a while, then restarts. I don't know if this is how it's supposed to work (although that may very well be the case, since all the program should be doing is releasing resources to allow the switch to happen), but esp. the latter makes it kind of useless for this purpose. Dima Dorfman dima@unixfreak.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message