- * Determine whether td can wait for the exit of p. * Returns: 0 for permitted, an errno value otherwise * Locks: Sufficient locks to protect various components of td and p * must be held. td must be curthread, and a lock must * be held for p. * References: td and p must be valid for the lifetime of the call */
| 1805 | |
| 1806 | */ |
| 1807 | int |
| 1808 | p_canwait(struct thread *td, struct proc *p) |
| 1809 | { |
| 1810 | int error; |
| 1811 | |
| 1812 | KASSERT(td == curthread, ("%s: td not curthread", __func__)); |
| 1813 | PROC_LOCK_ASSERT(p, MA_OWNED); |
| 1814 | if ((error = prison_check(td->td_ucred, p->p_ucred))) |
| 1815 | return (error); |
| 1816 | #ifdef MAC |
| 1817 | if ((error = mac_proc_check_wait(td->td_ucred, p))) |
| 1818 | return (error); |
| 1819 | #endif |
| 1820 | #if 0 |
| 1821 | /* XXXMAC: This could have odd effects on some shells. */ |
| 1822 | if ((error = cr_canseeotheruids(td->td_ucred, p->p_ucred))) |
| 1823 | return (error); |
| 1824 | #endif |
| 1825 | |
| 1826 | return (0); |
| 1827 | } |
| 1828 | |
| 1829 | /* |
| 1830 | * Credential management. |
no test coverage detected