diff options
| author | Robert Watson <rwatson@FreeBSD.org> | 2001-09-26 20:14:03 +0000 |
|---|---|---|
| committer | Robert Watson <rwatson@FreeBSD.org> | 2001-09-26 20:14:03 +0000 |
| commit | 8002488bd9001e16e666af320c25ee890a83d839 (patch) | |
| tree | efa8aef087d87c9b6850105e4e8c5196627994e8 /sys/dev/pci | |
| parent | f7312ca2a9237b04268d67df0f86187ab10ebf7f (diff) | |
Notes
Diffstat (limited to 'sys/dev/pci')
| -rw-r--r-- | sys/dev/pci/pci_user.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/dev/pci/pci_user.c b/sys/dev/pci/pci_user.c index 6968241681bb..6131a43489e8 100644 --- a/sys/dev/pci/pci_user.c +++ b/sys/dev/pci/pci_user.c @@ -37,6 +37,7 @@ #include <sys/fcntl.h> #include <sys/conf.h> #include <sys/kernel.h> +#include <sys/proc.h> #include <sys/queue.h> #include <sys/types.h> @@ -87,10 +88,15 @@ struct cdevsw pcicdev = { static int pci_open(dev_t dev, int oflags, int devtype, struct thread *td) { - if ((oflags & FWRITE) && securelevel > 0) { - return EPERM; + int error; + + if (oflags & FWRITE) { + error = securelevel_gt(td->td_proc->p_ucred, 0); + if (error) + return (error); } - return 0; + + return (0); } static int |
