Don't hide the real return code with EPERM.
This commit is contained in:
parent
5266303896
commit
5ff60a19d9
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: procfs_regs.c,v 1.14 2001/12/05 00:58:05 thorpej Exp $ */
|
||||
/* $NetBSD: procfs_regs.c,v 1.15 2002/01/12 18:51:56 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1993 Jan-Simon Pendry
|
||||
|
@ -40,7 +40,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: procfs_regs.c,v 1.14 2001/12/05 00:58:05 thorpej Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: procfs_regs.c,v 1.15 2002/01/12 18:51:56 christos Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -65,7 +65,7 @@ procfs_doregs(curp, p, pfs, uio)
|
|||
int kl;
|
||||
|
||||
if ((error = procfs_checkioperm(curp, p)) != 0)
|
||||
return (EPERM);
|
||||
return error;
|
||||
|
||||
kl = sizeof(r);
|
||||
kv = (char *) &r;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: procfs_vnops.c,v 1.87 2001/12/06 04:27:42 chs Exp $ */
|
||||
/* $NetBSD: procfs_vnops.c,v 1.88 2002/01/12 18:52:30 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1993 Jan-Simon Pendry
|
||||
|
@ -44,7 +44,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: procfs_vnops.c,v 1.87 2001/12/06 04:27:42 chs Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: procfs_vnops.c,v 1.88 2002/01/12 18:52:30 christos Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -242,6 +242,7 @@ procfs_open(v)
|
|||
} */ *ap = v;
|
||||
struct pfsnode *pfs = VTOPFS(ap->a_vp);
|
||||
struct proc *p1, *p2;
|
||||
int error;
|
||||
|
||||
p1 = ap->a_p; /* tracer */
|
||||
p2 = PFIND(pfs->pfs_pid); /* traced */
|
||||
|
@ -255,8 +256,8 @@ procfs_open(v)
|
|||
((pfs->pfs_flags & O_EXCL) && (ap->a_mode & FWRITE)))
|
||||
return (EBUSY);
|
||||
|
||||
if (procfs_checkioperm(p1, p2) != 0)
|
||||
return (EPERM);
|
||||
if ((error = procfs_checkioperm(p1, p2)) != 0)
|
||||
return (error);
|
||||
|
||||
if (ap->a_mode & FWRITE)
|
||||
pfs->pfs_flags = ap->a_mode & (FWRITE|O_EXCL);
|
||||
|
|
Loading…
Reference in New Issue