diff options
| author | Robert Watson <rwatson@FreeBSD.org> | 2000-08-30 04:49:09 +0000 |
|---|---|---|
| committer | Robert Watson <rwatson@FreeBSD.org> | 2000-08-30 04:49:09 +0000 |
| commit | 387d2c036bf02cf3a23705cc496577acdb829517 (patch) | |
| tree | 78428c175dc964a36c8008000a09c7a1e0cef19f /sys/kern/sys_process.c | |
| parent | c6fac29aff1f46a559899511e376d18b16f9c09d (diff) | |
Notes
Diffstat (limited to 'sys/kern/sys_process.c')
| -rw-r--r-- | sys/kern/sys_process.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index 4740476bdf94..02929610e829 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -217,7 +217,7 @@ ptrace(curp, uap) if ((p = pfind(uap->pid)) == NULL) return ESRCH; } - if (!PRISON_CHECK(curp, p)) + if (p_can(curp, p, P_CAN_SEE, NULL)) return (ESRCH); /* @@ -237,16 +237,8 @@ ptrace(curp, uap) if (p->p_flag & P_TRACED) return EBUSY; - /* not owned by you, has done setuid (unless you're root) */ - if ((p->p_cred->p_ruid != curp->p_cred->p_ruid) || - (p->p_flag & P_SUGID)) { - if ((error = suser(curp)) != 0) - return error; - } - - /* can't trace init when securelevel > 0 */ - if (securelevel > 0 && p->p_pid == 1) - return EPERM; + if ((error = p_can(curp, p, P_CAN_DEBUG, NULL))) + return error; /* OK */ break; |
