import less(1)
[unleashed/tickless.git] / usr / src / lib / libc / port / nsl / authsys_prot.c
blob02f0e2c5842087eb5714995828122af11a742f65
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
20 * CDDL HEADER END
24 * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
28 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
29 * Use is subject to license terms.
32 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
33 /* All Rights Reserved */
35 * Portions of this source code were derived from Berkeley
36 * 4.3 BSD under license from the Regents of the University of
37 * California.
41 * XDR for UNIX style authentication parameters for RPC
44 #include "mt.h"
45 #include <rpc/types.h>
46 #include <rpc/xdr.h>
47 #include <rpc/auth.h>
48 #include <rpc/auth_sys.h>
51 * XDR for unix authentication parameters.
53 bool_t
54 xdr_authsys_parms(XDR *xdrs, struct authsys_parms *p)
56 if (xdr_u_int(xdrs, &(p->aup_time)) &&
57 xdr_string(xdrs, &(p->aup_machname), MAX_MACHINE_NAME) &&
58 xdr_uid_t(xdrs, (uid_t *)&(p->aup_uid)) &&
59 xdr_gid_t(xdrs, (gid_t *)&(p->aup_gid)) &&
60 xdr_array(xdrs, (caddr_t *)&(p->aup_gids),
61 &(p->aup_len), NGRPS, (uint_t)sizeof (gid_t),
62 (xdrproc_t)xdr_gid_t))
63 return (TRUE);
64 return (FALSE);
68 * XDR user id types (uid_t)
70 bool_t
71 xdr_uid_t(XDR *xdrs, uid_t *ip)
73 /* CONSTCOND */
74 if (sizeof (uid_t) != sizeof (int))
75 return (xdr_short(xdrs, (short *)ip));
76 return (xdr_int(xdrs, (int *)ip));
80 * XDR group id types (gid_t)
82 bool_t
83 xdr_gid_t(XDR *xdrs, gid_t *ip)
85 /* CONSTCOND */
86 if (sizeof (gid_t) != sizeof (int))
87 return (xdr_short(xdrs, (short *)ip));
88 return (xdr_int(xdrs, (int *)ip));