2 .\" Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH DOOR_UCRED 3C "Mar 22, 2005"
8 door_ucred \- return credential information associated with the client
12 \fBcc\fR \fB-mt\fR [ \fIflag\fR... ] \fIfile\fR... [ \fIlibrary\fR... ]
15 \fBint\fR \fBdoor_ucred\fR(\fBucred_t **\fR\fIinfo\fR);
20 The \fBdoor_ucred()\fR function returns credential information associated with
21 the client, if any, of the current door invocation.
24 When successful, \fBdoor_ucred()\fR writes a pointer to a user credential to
25 the location pointed to by \fIinfo\fR if that location was previously
26 \fINULL\fR. If that location was non-null, \fBdoor_ucred()\fR assumes that
27 \fIinfo\fR points to a previously allocated \fBucred_t\fR which is then reused.
28 The location pointed to by \fIinfo\fR can be used multiple times before being
29 freed. The value returned in \fIinfo\fR must be freed using
33 The resulting user credential includes information about the effective user and
34 group ID, the real user and group ID, all privilege sets and the calling PID.
37 The credential information associated with the client refers to the information
38 from the immediate caller, not necessarily from the first thread in a chain of
42 Upon successful completion, \fBdoor_ucred()\fR returns 0. Otherwise, -1 is
43 returned and \fBerrno\fR is set to indicate the error, in which case the memory
44 location pointed to by the \fIinfo\fR argument is unchanged.
47 The \fBdoor_ucred()\fR function will fail if:
54 The location pointed to by \fIinfo\fR was \fINULL\fR and allocating memory
55 sufficient to hold a ucred failed.
64 The address of the \fIinfo\fR argument is invalid.
73 There is no associated door client.
82 The location pointed to by \fIinfo\fR was \fINULL\fR and allocating memory
83 sufficient to hold a ucred failed.
88 See \fBattributes\fR(5) for descriptions of the following attributes:
96 ATTRIBUTE TYPE ATTRIBUTE VALUE
98 Interface Stability Stable
105 \fBdoor_call\fR(3C), \fBdoor_create\fR(3C), \fBucred_get\fR(3C),