From owner-freebsd-audit Tue May 28 2:47:14 2002 Delivered-To: freebsd-audit@freebsd.org Received: from south.nanolink.com (south.nanolink.com [217.75.134.10]) by hub.freebsd.org (Postfix) with SMTP id 0B17337B403 for ; Tue, 28 May 2002 02:47:07 -0700 (PDT) Received: (qmail 81200 invoked by uid 85); 28 May 2002 09:56:05 -0000 Received: from unknown (HELO straylight.ringlet.net) (212.116.140.125) by south.nanolink.com with SMTP; 28 May 2002 09:55:49 -0000 Received: (qmail 11675 invoked by uid 1000); 28 May 2002 09:46:00 -0000 Date: Tue, 28 May 2002 12:45:59 +0300 From: Peter Pentchev To: Dima Dorfman Cc: audit@freebsd.org Subject: Re: VT_LOCKSWITCH Message-ID: <20020528124559.C374@straylight.oblivion.bg> Mail-Followup-To: Dima Dorfman , audit@freebsd.org References: <20020528085420.348AC3E5E@turbine.trit.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="Sr1nOIr3CvdE5hEN" Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20020528085420.348AC3E5E@turbine.trit.org>; from dima@trit.org on Tue, May 28, 2002 at 08:54:20AM +0000 X-Virus-Scanned: by Nik's Monitoring Daemon (AMaViS perl-11d) Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --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