Page MenuHomeFreeBSD

D38288.diff
No OneTemporary

D38288.diff

Index: sys/kern/kern_prot.c
===================================================================
--- sys/kern/kern_prot.c
+++ sys/kern/kern_prot.c
@@ -1682,8 +1682,8 @@
int
p_candebug(struct thread *td, struct proc *p)
{
- int credentialchanged, error, grpsubset, i, uidsubset;
+ int error, grpsubset, i, uidsubset;
KASSERT(td == curthread, ("%s: td not curthread", __func__));
PROC_LOCK_ASSERT(p, MA_OWNED);
if (td->td_proc == p)
@@ -1724,11 +1724,6 @@
td->td_ucred->cr_uid == p->p_ucred->cr_svuid &&
td->td_ucred->cr_uid == p->p_ucred->cr_ruid);
- /*
- * Has the credential of the process changed since the last exec()?
- */
- credentialchanged = (p->p_flag & P_SUGID);
-
/*
* If p's gids aren't a subset, or the uids aren't a subset,
* or the credential has changed, require appropriate privilege
@@ -1740,19 +1735,22 @@
return (error);
}
- if (credentialchanged) {
+ /*
+ * Has the credential of the process changed since the last exec()?
+ */
+ if ((p->p_flag & P_SUGID) != 0) {
error = priv_check(td, PRIV_DEBUG_SUGID);
if (error)
return (error);
}
/* Can't trace init when securelevel > 0. */
if (p == initproc) {
error = securelevel_gt(td->td_ucred, 0);
if (error)
return (error);
}
/*
* Can't trace a process that's currently exec'ing.
*

File Metadata

Mime Type
text/plain
Expires
Thu, Jul 9, 2:15 PM (18 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34890413
Default Alt Text
D38288.diff (1 KB)

Event Timeline