Skip site navigation (1)Skip section navigation (2)
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

--Sr1nOIr3CvdE5hEN
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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.
>=20
> Please review.
[snip]
> Index: usr.sbin/vidcontrol/vidcontrol.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> 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);
>  }
> =20
> +void
> +set_lockswitch(char *arg)
> +{
> +	int data;
> +
> +	if (!strcmp(arg, "off"))
> +		data =3D 0x01;
> +	else if (!strcmp(arg, "on"))
> +		data =3D 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

--=20
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.

--Sr1nOIr3CvdE5hEN
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (FreeBSD)

iD8DBQE881HX7Ri2jRYZRVMRAijtAJ9FkcijhtEmkiFC/rZGlBfGNViQ9ACgo+Cl
aYfgzSTEiL0sYZklqRwe//4=
=3Ceu
-----END PGP SIGNATURE-----

--Sr1nOIr3CvdE5hEN--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-audit" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020528124559.C374>