Date: Tue, 28 May 2002 12:45:59 +0300 From: Peter Pentchev <roam@ringlet.net> To: Dima Dorfman <dima@trit.org> Cc: audit@freebsd.org Subject: Re: VT_LOCKSWITCH Message-ID: <20020528124559.C374@straylight.oblivion.bg> In-Reply-To: <20020528085420.348AC3E5E@turbine.trit.org>; from dima@trit.org on Tue, May 28, 2002 at 08:54:20AM %2B0000 References: <20020528085420.348AC3E5E@turbine.trit.org>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
On Tue, May 28, 2002 at 08:54:20AM +0000, Dima Dorfman wrote:
> The attached patch adds an -S option to vidcontrol(1) that allows the
> user to disallow vty switching. It is implemented using a new
> VT_LOCKSWITCH ioctl. Although it is possible to implement something
> like this by VT_SETMODEing to VT_PROCESS and never releasing the vty,
> that method has a number of downsides, the biggest of which is that
> some program has to stay resident for the lock to be in effect.
>
> Please review.
[snip]
> Index: usr.sbin/vidcontrol/vidcontrol.c
> ===================================================================
> RCS file: /ref/cvsf/src/usr.sbin/vidcontrol/vidcontrol.c,v
> retrieving revision 1.41
> diff -u -r1.41 vidcontrol.c
> --- usr.sbin/vidcontrol/vidcontrol.c 16 Mar 2002 23:35:51 -0000 1.41
> +++ usr.sbin/vidcontrol/vidcontrol.c 27 May 2002 23:38:02 -0000
> @@ -518,6 +518,23 @@
> ioctl(0, CONS_MOUSECTL, &mouse);
> }
>
> +void
> +set_lockswitch(char *arg)
> +{
> + int data;
> +
> + if (!strcmp(arg, "off"))
> + data = 0x01;
> + else if (!strcmp(arg, "on"))
> + data = 0x02;
> + else {
> + warnx("argument to -S must either on or off");
A very, very minor nit: should this not be 'must *be* either on or off'? :)
Other than that, the patch - and the new functionality - looks just fine
to me. Great work! :)
G'luck,
Peter
--
Peter Pentchev roam@ringlet.net roam@FreeBSD.org
PGP key: http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553
"yields falsehood, when appended to its quotation." yields falsehood, when appended to its quotation.
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (FreeBSD)
iD8DBQE881HX7Ri2jRYZRVMRAijtAJ9FkcijhtEmkiFC/rZGlBfGNViQ9ACgo+Cl
aYfgzSTEiL0sYZklqRwe//4=
=3Ceu
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020528124559.C374>
