2 .\" Copyright (c) 2003 Joseph Koshy <jkoshy@FreeBSD.org>
4 .\" All rights reserved.
6 .\" This program is free software.
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\" notice, this list of conditions and the following disclaimer.
13 .\" 2. Redistributions in binary form must reproduce the above copyright
14 .\" notice, this list of conditions and the following disclaimer in the
15 .\" documentation and/or other materials provided with the distribution.
17 .\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
18 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 .\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
21 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 .Nd determine debuggability of a process
40 .Fn p_candebug "struct thread *td" "struct proc *p"
42 This function can be used to determine if a given process
44 is debuggable by the thread
49 variables directly influence the behaviour of
51 .Bl -tag -width indent
52 .It Va kern.securelevel
53 Debugging of the init process is not allowed if this variable is
56 .It Va security.bsd.unprivileged_proc_debug
57 Must be set to a non-zero value to allow unprivileged processes
58 access to the kernel's debug facilities.
66 if the process denoted by
68 is debuggable by thread
70 or a non-zero error return value otherwise.
74 The MAC subsystem denied debuggability.
78 is in the process of being
83 lacks super-user credentials and process
85 is executing a set-user-ID or set-group-ID executable.
89 lacks super-user credentials and process
91 group set is not a subset of
97 lacks super-user credentials and process
99 user IDs do not match thread
105 denotes the initial process
111 is greater than zero.
115 is not visible to thread
118 .Xr cr_seeotheruids 9
120 .Xr cr_seeothergids 9 .
124 has been jailed and process
126 does not belong to the same jail as
129 The MAC subsystem denied debuggability.
134 .Xr cr_seeothergids 9 ,
135 .Xr cr_seeotheruids 9 ,