xref: /freebsd/include/rpc/auth_unix.h (revision 2e322d379631c3bd6107e295f3e5d814c7845fc7)
1*2e322d37SHiroki Sato /*-
2*2e322d37SHiroki Sato  * Copyright (c) 2009, Sun Microsystems, Inc.
3*2e322d37SHiroki Sato  * All rights reserved.
4dba7a33eSGarrett Wollman  *
5*2e322d37SHiroki Sato  * Redistribution and use in source and binary forms, with or without
6*2e322d37SHiroki Sato  * modification, are permitted provided that the following conditions are met:
7*2e322d37SHiroki Sato  * - Redistributions of source code must retain the above copyright notice,
8*2e322d37SHiroki Sato  *   this list of conditions and the following disclaimer.
9*2e322d37SHiroki Sato  * - Redistributions in binary form must reproduce the above copyright notice,
10*2e322d37SHiroki Sato  *   this list of conditions and the following disclaimer in the documentation
11*2e322d37SHiroki Sato  *   and/or other materials provided with the distribution.
12*2e322d37SHiroki Sato  * - Neither the name of Sun Microsystems, Inc. nor the names of its
13*2e322d37SHiroki Sato  *   contributors may be used to endorse or promote products derived
14*2e322d37SHiroki Sato  *   from this software without specific prior written permission.
15dba7a33eSGarrett Wollman  *
16*2e322d37SHiroki Sato  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17*2e322d37SHiroki Sato  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18*2e322d37SHiroki Sato  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19*2e322d37SHiroki Sato  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20*2e322d37SHiroki Sato  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21*2e322d37SHiroki Sato  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22*2e322d37SHiroki Sato  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23*2e322d37SHiroki Sato  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24*2e322d37SHiroki Sato  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25*2e322d37SHiroki Sato  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26*2e322d37SHiroki Sato  * POSSIBILITY OF SUCH DAMAGE.
2786b9a9ccSGarrett Wollman  *
2886b9a9ccSGarrett Wollman  *	from: @(#)auth_unix.h 1.8 88/02/08 SMI
2986b9a9ccSGarrett Wollman  *	from: @(#)auth_unix.h	2.2 88/07/29 4.0 RPCSRC
30a4add9a9SPeter Wemm  * $FreeBSD$
31dba7a33eSGarrett Wollman  */
32dba7a33eSGarrett Wollman 
33dba7a33eSGarrett Wollman /*
34dba7a33eSGarrett Wollman  * auth_unix.h, Protocol for UNIX style authentication parameters for RPC
35dba7a33eSGarrett Wollman  *
36dba7a33eSGarrett Wollman  * Copyright (C) 1984, Sun Microsystems, Inc.
37dba7a33eSGarrett Wollman  */
38dba7a33eSGarrett Wollman 
39dba7a33eSGarrett Wollman /*
40dba7a33eSGarrett Wollman  * The system is very weak.  The client uses no encryption for  it
41dba7a33eSGarrett Wollman  * credentials and only sends null verifiers.  The server sends backs
42dba7a33eSGarrett Wollman  * null verifiers or optionally a verifier that suggests a new short hand
43dba7a33eSGarrett Wollman  * for the credentials.
44dba7a33eSGarrett Wollman  */
45dba7a33eSGarrett Wollman 
4686b9a9ccSGarrett Wollman #ifndef _RPC_AUTH_UNIX_H
4786b9a9ccSGarrett Wollman #define _RPC_AUTH_UNIX_H
4886b9a9ccSGarrett Wollman #include <sys/cdefs.h>
4986b9a9ccSGarrett Wollman 
50dba7a33eSGarrett Wollman /* The machine name is part of a credential; it may not exceed 255 bytes */
51dba7a33eSGarrett Wollman #define MAX_MACHINE_NAME 255
52dba7a33eSGarrett Wollman 
53dba7a33eSGarrett Wollman /* gids compose part of a credential; there may not be more than 16 of them */
54dba7a33eSGarrett Wollman #define NGRPS 16
55dba7a33eSGarrett Wollman 
56dba7a33eSGarrett Wollman /*
57dba7a33eSGarrett Wollman  * Unix style credentials.
58dba7a33eSGarrett Wollman  */
59dba7a33eSGarrett Wollman struct authunix_parms {
60dba7a33eSGarrett Wollman 	u_long	 aup_time;
61dba7a33eSGarrett Wollman 	char	*aup_machname;
620d1040e5SPedro F. Giffuni 	u_int	 aup_uid;
630d1040e5SPedro F. Giffuni 	u_int	 aup_gid;
64dba7a33eSGarrett Wollman 	u_int	 aup_len;
650d1040e5SPedro F. Giffuni 	u_int	*aup_gids;
66dba7a33eSGarrett Wollman };
67dba7a33eSGarrett Wollman 
68f26dae2bSBill Paul #define authsys_parms authunix_parms
69f26dae2bSBill Paul 
7086b9a9ccSGarrett Wollman __BEGIN_DECLS
71bb28f3c2SWarner Losh extern bool_t xdr_authunix_parms(XDR *, struct authunix_parms *);
7286b9a9ccSGarrett Wollman __END_DECLS
73dba7a33eSGarrett Wollman 
74dba7a33eSGarrett Wollman /*
75dba7a33eSGarrett Wollman  * If a response verifier has flavor AUTH_SHORT,
76dba7a33eSGarrett Wollman  * then the body of the response verifier encapsulates the following structure;
77dba7a33eSGarrett Wollman  * again it is serialized in the obvious fashion.
78dba7a33eSGarrett Wollman  */
79dba7a33eSGarrett Wollman struct short_hand_verf {
80dba7a33eSGarrett Wollman 	struct opaque_auth new_cred;
81dba7a33eSGarrett Wollman };
8286b9a9ccSGarrett Wollman 
8386b9a9ccSGarrett Wollman #endif /* !_RPC_AUTH_UNIX_H */
84