Re: VT_LOCKSWITCH

Peter Pentchev <[email protected]>
Newsgroups gmane.os.freebsd.devel.audit
Message-ID <[email protected]>
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	[email protected]	[email protected]
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.
signature.asc (application/pgp-signature, 187 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (FreeBSD)

iD8DBQE881HX7Ri2jRYZRVMRAijtAJ9FkcijhtEmkiFC/rZGlBfGNViQ9ACgo+Cl
aYfgzSTEiL0sYZklqRwe//4=
=3Ceu
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.