'\" te .\" Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved. .TH door_ucred 3C "22 Mar 2005" "SunOS 5.11" "Standard C Library Functions" .SH NAME door_ucred \- return credential information associated with the client .SH SYNOPSIS .LP .nf \fBcc\fR \fB-mt\fR [ \fIflag\fR... ] \fIfile\fR... [ \fIlibrary\fR... ] #include \fBint\fR \fBdoor_ucred\fR(\fBucred_t **\fR\fIinfo\fR); .fi .SH DESCRIPTION .sp .LP The \fBdoor_ucred()\fR function returns credential information associated with the client, if any, of the current door invocation. .sp .LP When successful, \fBdoor_ucred()\fR writes a pointer to a user credential to the location pointed to by \fIinfo\fR if that location was previously \fINULL\fR. If that location was non-null, \fBdoor_ucred()\fR assumes that \fIinfo\fR points to a previously allocated \fBucred_t\fR which is then reused. The location pointed to by \fIinfo\fR can be used multiple times before being freed. The value returned in \fIinfo\fR must be freed using \fBucred_free\fR(3C). .sp .LP The resulting user credential includes information about the effective user and group ID, the real user and group ID, all privilege sets and the calling PID. .sp .LP The credential information associated with the client refers to the information from the immediate caller, not necessarily from the first thread in a chain of door calls. .SH RETURN VALUES .sp .LP Upon successful completion, \fBdoor_ucred()\fR returns 0. Otherwise, -1 is returned and \fBerrno\fR is set to indicate the error, in which case the memory location pointed to by the \fIinfo\fR argument is unchanged. .SH ERRORS .sp .LP The \fBdoor_ucred()\fR function will fail if: .sp .ne 2 .mk .na \fB\fBEAGAIN\fR\fR .ad .RS 10n .rt The location pointed to by \fIinfo\fR was \fINULL\fR and allocating memory sufficient to hold a ucred failed. .RE .sp .ne 2 .mk .na \fB\fBEFAULT\fR\fR .ad .RS 10n .rt The address of the \fIinfo\fR argument is invalid. .RE .sp .ne 2 .mk .na \fB\fBEINVAL\fR\fR .ad .RS 10n .rt There is no associated door client. .RE .sp .ne 2 .mk .na \fB\fBENOMEM\fR\fR .ad .RS 10n .rt The location pointed to by \fIinfo\fR was \fINULL\fR and allocating memory sufficient to hold a ucred failed. .RE .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPEATTRIBUTE VALUE _ Interface StabilityCommitted _ MT-LevelSafe .TE .SH SEE ALSO .sp .LP \fBdoor_call\fR(3C), \fBdoor_create\fR(3C), \fBucred_get\fR(3C), \fBattributes\fR(5)