xref: /onnv-gate/usr/src/uts/common/rpc/auth_sys.h (revision 11134:8aa0c4ca6639)
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*11134SCasper.Dik@Sun.COM  * Common Development and Distribution License (the "License").
6*11134SCasper.Dik@Sun.COM  * 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*11134SCasper.Dik@Sun.COM  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
230Sstevel@tonic-gate  * Use is subject to license terms.
240Sstevel@tonic-gate  */
250Sstevel@tonic-gate /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
260Sstevel@tonic-gate /* All Rights Reserved */
270Sstevel@tonic-gate /*
280Sstevel@tonic-gate  * Portions of this source code were derived from Berkeley
290Sstevel@tonic-gate  * 4.3 BSD under license from the Regents of the University of
300Sstevel@tonic-gate  * California.
310Sstevel@tonic-gate  */
320Sstevel@tonic-gate 
330Sstevel@tonic-gate /*
340Sstevel@tonic-gate  * auth_sys.h, Protocol for UNIX style authentication parameters for RPC
350Sstevel@tonic-gate  */
360Sstevel@tonic-gate 
370Sstevel@tonic-gate #ifndef	_RPC_AUTH_SYS_H
380Sstevel@tonic-gate #define	_RPC_AUTH_SYS_H
390Sstevel@tonic-gate 
400Sstevel@tonic-gate /*
410Sstevel@tonic-gate  * The system is very weak.  The client uses no encryption for  it
420Sstevel@tonic-gate  * credentials and only sends null verifiers.  The server sends backs
430Sstevel@tonic-gate  * null verifiers or optionally a verifier that suggests a new short hand
440Sstevel@tonic-gate  * for the credentials.
450Sstevel@tonic-gate  */
460Sstevel@tonic-gate 
470Sstevel@tonic-gate #include <sys/types.h>
48*11134SCasper.Dik@Sun.COM #include <sys/param.h>
490Sstevel@tonic-gate #include <rpc/types.h>
500Sstevel@tonic-gate #include <rpc/xdr.h>
510Sstevel@tonic-gate #include <rpc/auth.h>
520Sstevel@tonic-gate 
530Sstevel@tonic-gate #ifdef	__cplusplus
540Sstevel@tonic-gate extern "C" {
550Sstevel@tonic-gate #endif
560Sstevel@tonic-gate 
570Sstevel@tonic-gate /* The machine name is part of a credential; it may not exceed 255 bytes */
580Sstevel@tonic-gate #define	 MAX_MACHINE_NAME 255
590Sstevel@tonic-gate 
600Sstevel@tonic-gate /* gids compose part of a credential; there may not be more than 16 of them */
610Sstevel@tonic-gate #define	 NGRPS 16
620Sstevel@tonic-gate 
63*11134SCasper.Dik@Sun.COM /* gids compose part of a credential */
64*11134SCasper.Dik@Sun.COM #define	 NGRPS_LOOPBACK NGROUPS_UMAX
650Sstevel@tonic-gate 
660Sstevel@tonic-gate /*
670Sstevel@tonic-gate  * "sys" (Old UNIX) style credentials.
680Sstevel@tonic-gate  */
690Sstevel@tonic-gate struct authsys_parms {
700Sstevel@tonic-gate 	uint_t	 aup_time;
710Sstevel@tonic-gate 	char	*aup_machname;
720Sstevel@tonic-gate 	uid_t	 aup_uid;
730Sstevel@tonic-gate 	gid_t	 aup_gid;
740Sstevel@tonic-gate 	uint_t	 aup_len;
750Sstevel@tonic-gate 	gid_t	*aup_gids;
760Sstevel@tonic-gate };
770Sstevel@tonic-gate /* For backward compatibility */
780Sstevel@tonic-gate #define	 authunix_parms authsys_parms
790Sstevel@tonic-gate 
800Sstevel@tonic-gate #ifdef __STDC__
810Sstevel@tonic-gate extern bool_t xdr_authsys_parms(XDR *, struct authsys_parms *);
820Sstevel@tonic-gate extern bool_t xdr_authloopback_parms(XDR *, struct authsys_parms *);
830Sstevel@tonic-gate #else
840Sstevel@tonic-gate extern bool_t xdr_authsys_parms();
850Sstevel@tonic-gate extern bool_t xdr_authloopback_parms();
860Sstevel@tonic-gate #endif
870Sstevel@tonic-gate 
880Sstevel@tonic-gate 
890Sstevel@tonic-gate /* For backward compatibility */
900Sstevel@tonic-gate #define	xdr_authunix_parms(xdrs, p) xdr_authsys_parms(xdrs, p)
910Sstevel@tonic-gate 
920Sstevel@tonic-gate /*
930Sstevel@tonic-gate  * If a response verifier has flavor AUTH_SHORT, then the body of
940Sstevel@tonic-gate  * the response verifier encapsulates the following structure;
950Sstevel@tonic-gate  * again it is serialized in the obvious fashion.
960Sstevel@tonic-gate  */
970Sstevel@tonic-gate struct short_hand_verf {
980Sstevel@tonic-gate 	struct opaque_auth new_cred;
990Sstevel@tonic-gate };
1000Sstevel@tonic-gate 
1010Sstevel@tonic-gate struct svc_req;
1020Sstevel@tonic-gate 
1030Sstevel@tonic-gate extern bool_t xdr_gid_t(XDR *, gid_t *ip);
1040Sstevel@tonic-gate extern bool_t xdr_uid_t(XDR *, gid_t *ip);
1050Sstevel@tonic-gate 
1060Sstevel@tonic-gate #ifdef _KERNEL
1070Sstevel@tonic-gate extern bool_t xdr_authkern(XDR *);
1080Sstevel@tonic-gate extern bool_t xdr_authloopback(XDR *);
1090Sstevel@tonic-gate extern enum auth_stat _svcauth_unix(struct svc_req *, struct rpc_msg *);
1100Sstevel@tonic-gate extern enum auth_stat _svcauth_short(struct svc_req *, struct rpc_msg *);
1110Sstevel@tonic-gate #endif
1120Sstevel@tonic-gate 
1130Sstevel@tonic-gate #ifdef	__cplusplus
1140Sstevel@tonic-gate }
1150Sstevel@tonic-gate #endif
1160Sstevel@tonic-gate 
1170Sstevel@tonic-gate #endif	/* !_RPC_AUTH_SYS_H */
118