ucred.9 (79684) | ucred.9 (86917) |
---|---|
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 79684 2001-07-13 18:35:48Z ru $ | 27.\" $FreeBSD: head/share/man/man9/ucred.9 86917 2001-11-26 18:37:50Z ru $ |
28.\" 29.Dd July 9, 2001 30.Dt UCRED 9 31.Os 32.Sh NAME 33.Nm ucred , 34.Nm crget , 35.Nm crhold , 36.Nm crfree , | 28.\" 29.Dd July 9, 2001 30.Dt UCRED 9 31.Os 32.Sh NAME 33.Nm ucred , 34.Nm crget , 35.Nm crhold , 36.Nm crfree , |
37.Nm crshared , |
|
37.Nm crcopy , 38.Nm crdup 39.Nd "functions related to user credentials" 40.Sh SYNOPSIS 41.In sys/param.h 42.In sys/ucred.h 43.Ft "struct ucred *" 44.Fn crget void 45.Ft void 46.Fn crhold "struct ucred *cr" 47.Ft void 48.Fn crfree "struct ucred *cr" | 38.Nm crcopy , 39.Nm crdup 40.Nd "functions related to user credentials" 41.Sh SYNOPSIS 42.In sys/param.h 43.In sys/ucred.h 44.Ft "struct ucred *" 45.Fn crget void 46.Ft void 47.Fn crhold "struct ucred *cr" 48.Ft void 49.Fn crfree "struct ucred *cr" |
50.Ft int 51.Fn crshared "struct ucred *cr" 52.Ft void 53.Fn crcopy "struct ucred *dest" "struct ucred *src" |
|
49.Ft "struct ucred *" | 54.Ft "struct ucred *" |
50.Fn crcopy "struct ucred *cr" 51.Ft "struct ucred *" | |
52.Fn crdup "struct ucred *cr" 53.Sh DESCRIPTION 54The 55.Nm 56family of functions is used to manage user credential structures 57.Pq Vt "struct ucred" 58within the kernel. 59.Pp --- 8 unchanged lines hidden (view full) --- 68function increases the reference count on the credential. 69.Pp 70The 71.Fn crfree 72function decreases the reference count on the credential. 73If the count drops to 0, the storage for the structure is freed. 74.Pp 75The | 55.Fn crdup "struct ucred *cr" 56.Sh DESCRIPTION 57The 58.Nm 59family of functions is used to manage user credential structures 60.Pq Vt "struct ucred" 61within the kernel. 62.Pp --- 8 unchanged lines hidden (view full) --- 71function increases the reference count on the credential. 72.Pp 73The 74.Fn crfree 75function decreases the reference count on the credential. 76If the count drops to 0, the storage for the structure is freed. 77.Pp 78The |
79.Fn crshared 80function returns true if the credential is shared. 81A credential is considered to be shared if its reference 82count is greater than one. 83.Pp 84The |
|
76.Fn crcopy | 85.Fn crcopy |
77function calls 78.Fn crdup 79to create a new structure, and copies the old credentials, 80if the reference count is greater than 1; 81otherwise, the original is returned. | 86function copies the contents of the source (template) 87credential into the destination template. 88The 89.Vt uidinfo 90structure within the destination is referenced 91by calling 92.Xr uihold 9 . |
82.Pp 83The 84.Fn crdup | 93.Pp 94The 95.Fn crdup |
85function allocates memory for a new structure, 86copies the contents of the original structure 87into it, references the 88.Va cr_uidinfo 89and 90.Va cr_ruidinfo 91fields, sets the reference count 92to 1, and then returns the new structure. | 96function allocates memory for a new structure and copies the 97contents of 98.Fa cr 99into it. 100The actual copying is performed by 101.Fn crcopy . |
93.Sh RETURN VALUES 94The functions that return values all return a pointer to a 95.Vt ucred 96structure. | 102.Sh RETURN VALUES 103The functions that return values all return a pointer to a 104.Vt ucred 105structure. |
97In the case of 98.Fn crcopy , 99the return value may be the same structure you passed to it. | |
100.Sh SEE ALSO 101.Xr uihold 9 102.Sh AUTHORS 103This man page was written by 104.An Chad David Aq davidc@acns.ab.ca . | 106.Sh SEE ALSO 107.Xr uihold 9 108.Sh AUTHORS 109This man page was written by 110.An Chad David Aq davidc@acns.ab.ca . |