Deleted Added
full compact
ucred.9 (147647) ucred.9 (183113)
1.\"
2.\" Copyright (C) 2001 Chad David <davidc@acns.ab.ca>. All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice(s), this list of conditions and the following disclaimer as

--- 10 unchanged lines hidden (view full) ---

19.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22.\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
25.\" DAMAGE.
26.\"
1.\"
2.\" Copyright (C) 2001 Chad David <davidc@acns.ab.ca>. All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice(s), this list of conditions and the following disclaimer as

--- 10 unchanged lines hidden (view full) ---

19.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22.\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
25.\" DAMAGE.
26.\"
27.\" $FreeBSD: head/share/man/man9/ucred.9 147647 2005-06-28 20:15:19Z hmp $
27.\" $FreeBSD: head/share/man/man9/ucred.9 183113 2008-09-17 15:49:44Z attilio $
28.\"
29.Dd March 3, 2002
30.Dt UCRED 9
31.Os
32.Sh NAME
33.Nm ucred ,
34.Nm crget ,
35.Nm crhold ,

--- 122 unchanged lines hidden (view full) ---

158.Pp
159In the common case, credentials required for access control decisions are
160used in a read-only manner.
161In these circumstances, the thread credential
162.Va td_ucred
163should be used, as it requires no locking to access safely, and remains stable
164for the duration of the call even in the face of a multi-threaded
165application changing the process credentials from another thread.
28.\"
29.Dd March 3, 2002
30.Dt UCRED 9
31.Os
32.Sh NAME
33.Nm ucred ,
34.Nm crget ,
35.Nm crhold ,

--- 122 unchanged lines hidden (view full) ---

158.Pp
159In the common case, credentials required for access control decisions are
160used in a read-only manner.
161In these circumstances, the thread credential
162.Va td_ucred
163should be used, as it requires no locking to access safely, and remains stable
164for the duration of the call even in the face of a multi-threaded
165application changing the process credentials from another thread.
166Primitives such as
167.Xr suser 9
168will assume the use of
169.Va td_ucred
170unless explicitly specified using
171.Xr suser_cred 9 .
172.Pp
173During a process credential update, the process lock must be held across
174check and update, to prevent race conditions.
175The process credential,
176.Va td->td_proc->p_ucred ,
177must be used both for check and update.
178If a process credential is updated during a system call and checks against
179the thread credential are to be made later during the same system call,

--- 31 unchanged lines hidden ---
166.Pp
167During a process credential update, the process lock must be held across
168check and update, to prevent race conditions.
169The process credential,
170.Va td->td_proc->p_ucred ,
171must be used both for check and update.
172If a process credential is updated during a system call and checks against
173the thread credential are to be made later during the same system call,

--- 31 unchanged lines hidden ---