diff options
author | phk <phk@FreeBSD.org> | 1999-01-30 12:21:49 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1999-01-30 12:21:49 +0000 |
commit | 3d7d9296c026c35f49268a07b8c8afec5ab94b05 (patch) | |
tree | c16bd660e63dd9310a3af68b745abf0e2352a579 /sys/i386/isa/wfd.c | |
parent | 67f187760e45386080ca97c6bc73608f9fe52ae5 (diff) | |
download | FreeBSD-src-3d7d9296c026c35f49268a07b8c8afec5ab94b05.zip FreeBSD-src-3d7d9296c026c35f49268a07b8c8afec5ab94b05.tar.gz |
Use suser() to determine super-user-ness, don't examine cr_uid directly.
Diffstat (limited to 'sys/i386/isa/wfd.c')
-rw-r--r-- | sys/i386/isa/wfd.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/sys/i386/isa/wfd.c b/sys/i386/isa/wfd.c index 60ceb0b..b47b1e5 100644 --- a/sys/i386/isa/wfd.c +++ b/sys/i386/isa/wfd.c @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: wfd.c,v 1.16 1998/09/15 08:15:30 gibbs Exp $ + * $Id: wfd.c,v 1.17 1998/12/07 21:58:24 archie Exp $ */ /* @@ -681,20 +681,23 @@ int wfdioctl (dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) } switch (cmd) { case CDIOCSETDEBUG: - if (p->p_cred->pc_ucred->cr_uid) - return (EPERM); + error = suser(p->p_ucred, &p->p_acflag); + if (error) + return (error); t->flags |= F_DEBUG; atapi_debug (t->ata, 1); return 0; case CDIOCCLRDEBUG: - if (p->p_cred->pc_ucred->cr_uid) - return (EPERM); + error = suser(p->p_ucred, &p->p_acflag); + if (error) + return (error); t->flags &= ~F_DEBUG; atapi_debug (t->ata, 0); return 0; case CDIOCRESET: - if (p->p_cred->pc_ucred->cr_uid) - return (EPERM); + error = suser(p->p_ucred, &p->p_acflag); + if (error) + return (error); return wfd_request_wait (t, ATAPI_TEST_UNIT_READY, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); case CDIOCEJECT: |