xref: /onnv-gate/usr/src/head/ucred.h (revision 1676:37f4a3e2bd99)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*1676Sjpk  * Common Development and Distribution License (the "License").
6*1676Sjpk  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
210Sstevel@tonic-gate /*
22*1676Sjpk  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
230Sstevel@tonic-gate  * Use is subject to license terms.
240Sstevel@tonic-gate  */
250Sstevel@tonic-gate 
260Sstevel@tonic-gate #ifndef	_UCRED_H_
270Sstevel@tonic-gate #define	_UCRED_H_
280Sstevel@tonic-gate 
290Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
300Sstevel@tonic-gate 
310Sstevel@tonic-gate #include <sys/types.h>
320Sstevel@tonic-gate #include <sys/priv.h>
33*1676Sjpk #include <sys/tsol/label.h>
340Sstevel@tonic-gate 
350Sstevel@tonic-gate #ifdef	__cplusplus
360Sstevel@tonic-gate extern "C" {
370Sstevel@tonic-gate #endif
380Sstevel@tonic-gate 
390Sstevel@tonic-gate typedef struct ucred_s ucred_t;
400Sstevel@tonic-gate 
410Sstevel@tonic-gate /*
420Sstevel@tonic-gate  * library functions prototype.
430Sstevel@tonic-gate  */
440Sstevel@tonic-gate #if	defined(__STDC__)
450Sstevel@tonic-gate 
460Sstevel@tonic-gate extern ucred_t *ucred_get(pid_t pid);
470Sstevel@tonic-gate 
480Sstevel@tonic-gate extern void ucred_free(ucred_t *);
490Sstevel@tonic-gate 
500Sstevel@tonic-gate extern uid_t ucred_geteuid(const ucred_t *);
510Sstevel@tonic-gate extern uid_t ucred_getruid(const ucred_t *);
520Sstevel@tonic-gate extern uid_t ucred_getsuid(const ucred_t *);
530Sstevel@tonic-gate extern gid_t ucred_getegid(const ucred_t *);
540Sstevel@tonic-gate extern gid_t ucred_getrgid(const ucred_t *);
550Sstevel@tonic-gate extern gid_t ucred_getsgid(const ucred_t *);
560Sstevel@tonic-gate extern int   ucred_getgroups(const ucred_t *, const gid_t **);
570Sstevel@tonic-gate 
580Sstevel@tonic-gate extern const priv_set_t *ucred_getprivset(const ucred_t *, priv_ptype_t);
590Sstevel@tonic-gate extern uint_t ucred_getpflags(const ucred_t *, uint_t);
600Sstevel@tonic-gate 
610Sstevel@tonic-gate extern pid_t ucred_getpid(const ucred_t *); /* for door_cred compatibility */
620Sstevel@tonic-gate 
630Sstevel@tonic-gate extern size_t ucred_size(void);
640Sstevel@tonic-gate 
650Sstevel@tonic-gate extern int getpeerucred(int, ucred_t **);
660Sstevel@tonic-gate 
670Sstevel@tonic-gate extern zoneid_t ucred_getzoneid(const ucred_t *);
680Sstevel@tonic-gate 
69*1676Sjpk extern bslabel_t *ucred_getlabel(const ucred_t *);
70*1676Sjpk 
710Sstevel@tonic-gate extern projid_t ucred_getprojid(const ucred_t *);
720Sstevel@tonic-gate 
730Sstevel@tonic-gate #else	/* Non ANSI */
740Sstevel@tonic-gate 
750Sstevel@tonic-gate extern ucred_t *ucred_get(/* pid_t pid */);
760Sstevel@tonic-gate 
770Sstevel@tonic-gate extern void ucred_free(/* ucred_t * */);
780Sstevel@tonic-gate 
790Sstevel@tonic-gate extern uid_t ucred_geteuid(/* ucred_t * */);
800Sstevel@tonic-gate extern uid_t ucred_getruid(/* ucred_t * */);
810Sstevel@tonic-gate extern uid_t ucred_getsuid(/* ucred_t * */);
820Sstevel@tonic-gate extern gid_t ucred_getegid(/* ucred_t * */);
830Sstevel@tonic-gate extern gid_t ucred_getrgid(/* ucred_t * */);
840Sstevel@tonic-gate extern gid_t ucred_getsgid(/* ucred_t * */);
850Sstevel@tonic-gate extern int   ucred_getgroups(/* ucred_t *, gid_t ** */);
860Sstevel@tonic-gate 
870Sstevel@tonic-gate extern priv_set_t *ucred_getprivset(/* ucred_t *, priv_ptype_t */);
880Sstevel@tonic-gate extern uint_t ucred_getpflags(/* ucred_t *, uint_t */);
890Sstevel@tonic-gate 
900Sstevel@tonic-gate extern pid_t ucred_getpid(/* ucred_t * */);
910Sstevel@tonic-gate 
920Sstevel@tonic-gate extern size_t ucred_size(/* void */);
930Sstevel@tonic-gate 
940Sstevel@tonic-gate extern int getpeerucred(/* int, ucred_t ** */);
950Sstevel@tonic-gate 
960Sstevel@tonic-gate extern zoneid_t ucred_getzoneid(/* ucred_t * */);
970Sstevel@tonic-gate 
98*1676Sjpk extern bslabel_t *ucred_getlabel(/* const ucred_t * */);
99*1676Sjpk 
1000Sstevel@tonic-gate extern projid_t ucred_getprojid(/* ucred_t * */);
1010Sstevel@tonic-gate 
1020Sstevel@tonic-gate #endif	/* __STDC__ */
1030Sstevel@tonic-gate 
1040Sstevel@tonic-gate #ifdef	__cplusplus
1050Sstevel@tonic-gate }
1060Sstevel@tonic-gate #endif
1070Sstevel@tonic-gate 
1080Sstevel@tonic-gate #endif	/* _UCRED_H_ */
109