xref: /freebsd/include/rpc/auth_unix.h (revision f26dae2bb45ed9b6724340e9f722826658676d9f)
1dba7a33eSGarrett Wollman /*
2dba7a33eSGarrett Wollman  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
3dba7a33eSGarrett Wollman  * unrestricted use provided that this legend is included on all tape
4dba7a33eSGarrett Wollman  * media and as a part of the software program in whole or part.  Users
5dba7a33eSGarrett Wollman  * may copy or modify Sun RPC without charge, but are not authorized
6dba7a33eSGarrett Wollman  * to license or distribute it to anyone else except as part of a product or
7dba7a33eSGarrett Wollman  * program developed by the user.
8dba7a33eSGarrett Wollman  *
9dba7a33eSGarrett Wollman  * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
1071d9c781SMike Pritchard  * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
11dba7a33eSGarrett Wollman  * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
12dba7a33eSGarrett Wollman  *
13dba7a33eSGarrett Wollman  * Sun RPC is provided with no support and without any obligation on the
14dba7a33eSGarrett Wollman  * part of Sun Microsystems, Inc. to assist in its use, correction,
15dba7a33eSGarrett Wollman  * modification or enhancement.
16dba7a33eSGarrett Wollman  *
17dba7a33eSGarrett Wollman  * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
18dba7a33eSGarrett Wollman  * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
19dba7a33eSGarrett Wollman  * OR ANY PART THEREOF.
20dba7a33eSGarrett Wollman  *
21dba7a33eSGarrett Wollman  * In no event will Sun Microsystems, Inc. be liable for any lost revenue
22dba7a33eSGarrett Wollman  * or profits or other special, indirect and consequential damages, even if
23dba7a33eSGarrett Wollman  * Sun has been advised of the possibility of such damages.
24dba7a33eSGarrett Wollman  *
25dba7a33eSGarrett Wollman  * Sun Microsystems, Inc.
26dba7a33eSGarrett Wollman  * 2550 Garcia Avenue
27dba7a33eSGarrett Wollman  * Mountain View, California  94043
2886b9a9ccSGarrett Wollman  *
2986b9a9ccSGarrett Wollman  *	from: @(#)auth_unix.h 1.8 88/02/08 SMI
3086b9a9ccSGarrett Wollman  *	from: @(#)auth_unix.h	2.2 88/07/29 4.0 RPCSRC
31f26dae2bSBill Paul  *	$Id: auth_unix.h,v 1.4 1996/01/30 23:31:42 mpp Exp $
32dba7a33eSGarrett Wollman  */
33dba7a33eSGarrett Wollman 
34dba7a33eSGarrett Wollman /*
35dba7a33eSGarrett Wollman  * auth_unix.h, Protocol for UNIX style authentication parameters for RPC
36dba7a33eSGarrett Wollman  *
37dba7a33eSGarrett Wollman  * Copyright (C) 1984, Sun Microsystems, Inc.
38dba7a33eSGarrett Wollman  */
39dba7a33eSGarrett Wollman 
40dba7a33eSGarrett Wollman /*
41dba7a33eSGarrett Wollman  * The system is very weak.  The client uses no encryption for  it
42dba7a33eSGarrett Wollman  * credentials and only sends null verifiers.  The server sends backs
43dba7a33eSGarrett Wollman  * null verifiers or optionally a verifier that suggests a new short hand
44dba7a33eSGarrett Wollman  * for the credentials.
45dba7a33eSGarrett Wollman  */
46dba7a33eSGarrett Wollman 
4786b9a9ccSGarrett Wollman #ifndef _RPC_AUTH_UNIX_H
4886b9a9ccSGarrett Wollman #define _RPC_AUTH_UNIX_H
4986b9a9ccSGarrett Wollman #include <sys/cdefs.h>
5086b9a9ccSGarrett Wollman 
51dba7a33eSGarrett Wollman /* The machine name is part of a credential; it may not exceed 255 bytes */
52dba7a33eSGarrett Wollman #define MAX_MACHINE_NAME 255
53dba7a33eSGarrett Wollman 
54dba7a33eSGarrett Wollman /* gids compose part of a credential; there may not be more than 16 of them */
55dba7a33eSGarrett Wollman #define NGRPS 16
56dba7a33eSGarrett Wollman 
57dba7a33eSGarrett Wollman /*
58dba7a33eSGarrett Wollman  * Unix style credentials.
59dba7a33eSGarrett Wollman  */
60dba7a33eSGarrett Wollman struct authunix_parms {
61dba7a33eSGarrett Wollman 	u_long	 aup_time;
62dba7a33eSGarrett Wollman 	char	*aup_machname;
63dba7a33eSGarrett Wollman 	int	 aup_uid;
64dba7a33eSGarrett Wollman 	int	 aup_gid;
65dba7a33eSGarrett Wollman 	u_int	 aup_len;
66dba7a33eSGarrett Wollman 	int	*aup_gids;
67dba7a33eSGarrett Wollman };
68dba7a33eSGarrett Wollman 
69f26dae2bSBill Paul #define authsys_parms authunix_parms
70f26dae2bSBill Paul 
7186b9a9ccSGarrett Wollman __BEGIN_DECLS
7286b9a9ccSGarrett Wollman extern bool_t xdr_authunix_parms __P((XDR *, struct authunix_parms *));
7386b9a9ccSGarrett Wollman __END_DECLS
74dba7a33eSGarrett Wollman 
75dba7a33eSGarrett Wollman /*
76dba7a33eSGarrett Wollman  * If a response verifier has flavor AUTH_SHORT,
77dba7a33eSGarrett Wollman  * then the body of the response verifier encapsulates the following structure;
78dba7a33eSGarrett Wollman  * again it is serialized in the obvious fashion.
79dba7a33eSGarrett Wollman  */
80dba7a33eSGarrett Wollman struct short_hand_verf {
81dba7a33eSGarrett Wollman 	struct opaque_auth new_cred;
82dba7a33eSGarrett Wollman };
8386b9a9ccSGarrett Wollman 
8486b9a9ccSGarrett Wollman #endif /* !_RPC_AUTH_UNIX_H */
85