]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/man/man9/p_candebug.9
This commit was generated by cvs2svn to compensate for changes in r155511,
[FreeBSD/FreeBSD.git] / share / man / man9 / p_candebug.9
1 .\"
2 .\" Copyright (c) 2003 Joseph Koshy <jkoshy@freebsd.org>
3 .\"
4 .\" All rights reserved.
5 .\"
6 .\" This program is free software.
7 .\"
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
10 .\" are met:
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.
16 .\"
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.
27 .\"
28 .\" $FreeBSD$
29 .\"
30 .Dd November 11, 2003
31 .Os
32 .Dt P_CANDEBUG 9
33 .Sh NAME
34 .Nm p_candebug
35 .Nd determine debuggability of a process
36 .Sh SYNOPSIS
37 .In sys/proc.h
38 .Ft int
39 .Fn p_candebug "struct thread *td" "struct proc *p"
40 .Sh DESCRIPTION
41 This function can be used to determine if a given process
42 .Fa p
43 is debuggable by the thread
44 .Fa td .
45 .Sh SYSCTL VARIABLES
46 The following
47 .Xr sysctl 8
48 variables directly influence the behaviour of
49 .Fn p_candebug :
50 .Bl -tag -width indent
51 .It Va kern.securelevel
52 Debugging of the init process is not allowed if this variable is
53 .Li 1
54 or greater.
55 .It Va security.bsd.unprivileged_proc_debug
56 Must be set to a non-zero value to allow unprivileged processes
57 access to the kernel's debug facilities.
58 .El
59 .Sh RETURN VALUES
60 The
61 .Fn p_candebug
62 function
63 returns
64 .Li 0
65 if the process denoted by
66 .Fa p
67 is debuggable by thread
68 .Fa td ,
69 or a non-zero error return value otherwise.
70 .Sh ERRORS
71 .Bl -tag -width Er
72 .It Bq Er EACCESS
73 The MAC subsystem denied debuggability.
74 .It Bq Er EAGAIN
75 Process
76 .Fa p
77 is in the process of being
78 .Fn exec Ns 'ed.
79 .It Bq Er EPERM
80 Thread
81 .Fa td
82 lacks super-user credentials and process
83 .Fa p
84 is executing a set-user-ID or set-group-ID executable.
85 .It Bq Er EPERM
86 Thread
87 .Fa td
88 lacks super-user credentials and process
89 .Fa p Ns 's
90 group set is not a subset of
91 .Fa td Ns 's
92 effective group set.
93 .It Bq Er EPERM
94 Thread
95 .Fa td
96 lacks super-user credentials and process
97 .Fa p Ns 's
98 user IDs do not match thread
99 .Fa td Ns 's
100 effective user ID.
101 .It Bq Er EPERM
102 Process
103 .Fa p
104 denotes the initial process
105 .Fn initproc
106 and the
107 .Xr sysctl 8
108 variable
109 .Va kern.securelevel
110 is greater than zero.
111 .It Bq Er ESRCH
112 Process
113 .Fa p
114 is not visible to thread
115 .Fa td
116 as determined by
117 .Xr cr_seeotheruids 9
118 or
119 .Xr cr_seeothergids 9 .
120 .It Bq Er ESRCH
121 Thread
122 .Fa td
123 has been jailed and process
124 .Fa p
125 does not belong to the same jail as
126 .Fa td .
127 .It Bq Er ESRCH
128 The MAC subsystem denied debuggability.
129 .El
130 .Sh SEE ALSO
131 .Xr intro 2 ,
132 .Xr jail 2 ,
133 .Xr sysctl 8 ,
134 .Xr cr_seeothergids 9 ,
135 .Xr cr_seeotheruids 9 ,
136 .Xr mac 9 ,
137 .Xr prison_check 9