summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/pcvt/pcvt_drv.c
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1997-04-14 15:54:39 +0000
committerbde <bde@FreeBSD.org>1997-04-14 15:54:39 +0000
commit1c0ab07a266f3b071ce84f79a038cb7ef340396b (patch)
tree13ae33e7ddec4a2869ffe451e056d82bcfa9375f /sys/i386/isa/pcvt/pcvt_drv.c
parent93bc52bbfc3efe16fd656b69eca9a3d6ee133b39 (diff)
downloadFreeBSD-src-1c0ab07a266f3b071ce84f79a038cb7ef340396b.zip
FreeBSD-src-1c0ab07a266f3b071ce84f79a038cb7ef340396b.tar.gz
Use the same IOPL check as in syscons.
Reviewed by: pst, joerg
Diffstat (limited to 'sys/i386/isa/pcvt/pcvt_drv.c')
-rw-r--r--sys/i386/isa/pcvt/pcvt_drv.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/sys/i386/isa/pcvt/pcvt_drv.c b/sys/i386/isa/pcvt/pcvt_drv.c
index e5abe05..506603a 100644
--- a/sys/i386/isa/pcvt/pcvt_drv.c
+++ b/sys/i386/isa/pcvt/pcvt_drv.c
@@ -1383,7 +1383,7 @@ vgapelinit(void)
#if defined XSERVER && !PCVT_USL_VT_COMPAT
/*----------------------------------------------------------------------*
* initialize for X mode
- * i.e.: grant current process (the X server) all IO priviledges,
+ * i.e.: grant current process (the X server) all IO privileges,
* and mark in static variable so other hooks can test for it,
* save all loaded fonts and screen pages to pageable buffers;
* if parameter `on' is false, the same procedure is done reverse.
@@ -1403,7 +1403,7 @@ pcvt_xmode_set(int on, struct proc *p)
struct syscframe *fp;
#endif /* PCVT_NETBSD > 9 */
- int i;
+ int error, i;
/* X will only run on VGA and Hercules adaptors */
@@ -1419,12 +1419,15 @@ pcvt_xmode_set(int on, struct proc *p)
if(on)
{
/*
- * Test whether the calling process has super-user priviledges.
+ * Test whether the calling process has super-user privileges
+ * and we're in insecure mode.
* This prevents us from granting the potential security hole
- * `IO priv' to any process (effective uid is checked).
+ * `IO priv' to insufficiently privileged processes.
*/
-
- if(suser(p->p_ucred, &p->p_acflag) != 0)
+ error = suser(p->p_ucred, &p->p_acflag);
+ if (error != 0)
+ return (error);
+ if (securelevel > 0)
return (EPERM);
if(pcvt_xmode)
OpenPOWER on IntegriCloud