Don't allow i/o operations for non-root users.

This commit is contained in:
Bruce Evans 1995-10-14 07:09:58 +00:00
parent 21e00296ec
commit f2b0c6b282
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=11467

View File

@ -207,6 +207,7 @@ struct spigot_softc *ss = (struct spigot_softc *)&spigot_softc[UNIT(dev)];
int
spigot_ioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
{
int error;
struct spigot_softc *ss = (struct spigot_softc *)&spigot_softc[UNIT(dev)];
struct trapframe *fp;
struct spigot_info *info;
@ -218,6 +219,9 @@ struct spigot_info *info;
ss->signal_num = *((int *)data);
break;
case SPIGOT_IOPL_ON: /* allow access to the IO PAGE */
error = suser(p->p_ucred, &p->p_acflag);
if (error != 0)
return error;
fp=(struct trapframe *)p->p_md.md_regs;
fp->tf_eflags |= PSL_IOPL;
break;